diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 6876014..93399d6 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -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/ @@ -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}} \ No newline at end of file diff --git a/2ndparty/loodsman b/2ndparty/loodsman index 146fff9..2931ac0 160000 --- a/2ndparty/loodsman +++ b/2ndparty/loodsman @@ -1 +1 @@ -Subproject commit 146fff9d0cf78054c61df46c4cedf0d2d9bbc500 +Subproject commit 2931ac0fbd5266ac20907c224553ea7cdb9fbdc6 diff --git a/app/link_config.json b/app/link_config.json deleted file mode 100644 index b1c6985..0000000 --- a/app/link_config.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "name": "SITL", - "type": "udp", - "local_port": 14550, - "protocol": "Mavlink" - } -] diff --git a/app/src/communication/communication_controller.cpp b/app/src/communication/communication_controller.cpp new file mode 100644 index 0000000..6db4e17 --- /dev/null +++ b/app/src/communication/communication_controller.cpp @@ -0,0 +1,16 @@ +#include "communication_controller.h" + +#include "locator.h" + +using namespace md::presentation; + +CommunicationController::CommunicationController(QObject* parent) : + m_communicationService(app::Locator::get()) +{ + Q_ASSERT(m_communicationService); +} + +QList CommunicationController::communicationDescriptions() +{ + return m_communicationService->communicationDescriptions(); +} diff --git a/app/src/communication/communication_controller.h b/app/src/communication/communication_controller.h new file mode 100644 index 0000000..97b4148 --- /dev/null +++ b/app/src/communication/communication_controller.h @@ -0,0 +1,26 @@ +#ifndef COMMUNICATION_CONTROLLER_H +#define COMMUNICATION_CONTROLLER_H + +#include + +#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 communicationDescriptions(); + +private: + app::CommunicationService* const m_communicationService; +}; +} // namespace md::presentation +#endif //COMMUNICATION_CONTROLLER_H diff --git a/app/src/main.cpp b/app/src/main.cpp index f9535a6..42c4cf6 100644 --- a/app/src/main.cpp +++ b/app/src/main.cpp @@ -20,6 +20,7 @@ #include // 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" @@ -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); @@ -112,8 +113,9 @@ int main(int argc, char* argv[]) app::Locator::provide(&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(&communicationService); // Presentation initialization diff --git a/kjarni b/kjarni index a461b09..8e04ac8 160000 --- a/kjarni +++ b/kjarni @@ -1 +1 @@ -Subproject commit a461b099b81f6dfeaef8ff8aa47b3c2d760ec53e +Subproject commit 8e04ac80b9adc9efa7aa1516c4e2cd4b0d4e6453 diff --git a/modules/Jerom-The-Mavlink b/modules/Jerom-The-Mavlink index b9d8f70..059c452 160000 --- a/modules/Jerom-The-Mavlink +++ b/modules/Jerom-The-Mavlink @@ -1 +1 @@ -Subproject commit b9d8f707b55d39d517acffe710a491b2767ca32c +Subproject commit 059c4523e0bd1f88d12ec7ce3a103a8cca1ba94a