Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Communication description sql #48

Draft
wants to merge 15 commits into
base: develop
Choose a base branch
from
29 changes: 22 additions & 7 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on: [ push, pull_request ]
on:
push:
branches:
- 'main'
- 'develop'
tags:
pull_request:


env:
BUILD_TYPE: Release

jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-20.04 ]
node-version: [ 12.x, 14.x, 16.x ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

Expand All @@ -27,5 +35,12 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run configure
- run: npm run build
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
8 changes: 0 additions & 8 deletions app/link_config.json

This file was deleted.

16 changes: 16 additions & 0 deletions app/src/communication/communication_controller.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "communication_controller.h"

#include "locator.h"

using namespace md::presentation;

CommunicationController::CommunicationController(QObject* parent) :
m_communicationService(app::Locator::get<app::CommunicationService>())
{
Q_ASSERT(m_communicationService);
}

QList<md::domain::CommunicationDescription*> CommunicationController::communicationDescriptions()
{
return m_communicationService->communicationDescriptions();
}
26 changes: 26 additions & 0 deletions app/src/communication/communication_controller.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef COMMUNICATION_CONTROLLER_H
#define COMMUNICATION_CONTROLLER_H

#include <QObject>

#include "communication_service.h"

namespace md::presentation
{
class CommunicationController : public QObject
{
Q_OBJECT

Q_PROPERTY(domain::CommunicationDescription* links READ communicationDescriptions)

public:
explicit CommunicationController(QObject* parent = nullptr);
~CommunicationController() override = default;

QList<domain::CommunicationDescription*> communicationDescriptions();

private:
app::CommunicationService* const m_communicationService;
};
} // namespace md::presentation
#endif //COMMUNICATION_CONTROLLER_H
8 changes: 5 additions & 3 deletions app/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <QtWebEngine>

// Data source
#include "communication_description_repository_sql.h"
#include "home_items_repository_sql.h"
#include "missions_repository_sql.h"
#include "route_items_repository_sql.h"
Expand Down Expand Up @@ -73,7 +74,7 @@ int main(int argc, char* argv[])
QVersionNumber(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH).toString());

QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
QGuiApplication::setAttribute( Qt::AA_UseHighDpiPixmaps, true);
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
QGuiApplication::setAttribute(Qt::AA_ShareOpenGLContexts);

QGuiApplication app(argc, argv);
Expand Down Expand Up @@ -112,8 +113,9 @@ int main(int argc, char* argv[])
app::Locator::provide<presentation::IGuiLayout>(&layout);

// app layer initializaion
// TODO: remove json after sql implementation
app::CommunicationService communicationService("./link_config.json");
data_source::CommunicationDescriptionRepositorySql communicationDescriptionRepository(
schema.db());
app::CommunicationService communicationService(&communicationDescriptionRepository);
app::Locator::provide<app::CommunicationService>(&communicationService);

// Presentation initialization
Expand Down
2 changes: 1 addition & 1 deletion modules/Jerom-The-Mavlink