From ecd46bea73bfeed2d3acf49d22a7854a3b1a8f54 Mon Sep 17 00:00:00 2001 From: Elias Alberts Date: Mon, 24 Jan 2022 15:25:14 +0300 Subject: [PATCH 01/12] kj upd --- kjarni | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kjarni b/kjarni index 0cc6b81..036c104 160000 --- a/kjarni +++ b/kjarni @@ -1 +1 @@ -Subproject commit 0cc6b819e7695578196b976f4c553f21d26041d2 +Subproject commit 036c1041ceb85f9a00ff4d47e6b74df5e12fa647 From dbd692989631d748a8af1efa93acd73ac1f3cde2 Mon Sep 17 00:00:00 2001 From: Elias Alberts Date: Mon, 24 Jan 2022 16:15:57 +0300 Subject: [PATCH 02/12] kj upd --- kjarni | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kjarni b/kjarni index 036c104..d5c034e 160000 --- a/kjarni +++ b/kjarni @@ -1 +1 @@ -Subproject commit 036c1041ceb85f9a00ff4d47e6b74df5e12fa647 +Subproject commit d5c034e6ed8c10418d82230257eda68f17bd2fdc From 7a561dd810255af100d343d070555cbed9e74999 Mon Sep 17 00:00:00 2001 From: Elias Alberts Date: Mon, 24 Jan 2022 17:40:14 +0300 Subject: [PATCH 03/12] first attempt to write sql --- app/src/main.cpp | 6 +++++- kjarni | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main.cpp b/app/src/main.cpp index 3fbf1a4..28a523f 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" @@ -112,7 +113,10 @@ int main(int argc, char* argv[]) // app layer initializaion // TODO: remove json after sql implementation - app::CommunicationService communicationService("./link_config.json"); + data_source::CommunicationDescriptionRepositorySql communicationDescriptionRepository( + schema.db()); + app::CommunicationService communicationService("./link_config.json", + &communicationDescriptionRepository); app::Locator::provide(&communicationService); // Presentation initialization diff --git a/kjarni b/kjarni index d5c034e..741c90d 160000 --- a/kjarni +++ b/kjarni @@ -1 +1 @@ -Subproject commit d5c034e6ed8c10418d82230257eda68f17bd2fdc +Subproject commit 741c90d81ddcde0afc7b60949648fc0ab275bff7 From 3f8e7d3e1f9f57199067deed6d780dd083bed6e4 Mon Sep 17 00:00:00 2001 From: Elias Alberts Date: Mon, 24 Jan 2022 18:48:48 +0300 Subject: [PATCH 04/12] working sql read-write --- kjarni | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kjarni b/kjarni index 741c90d..b9be121 160000 --- a/kjarni +++ b/kjarni @@ -1 +1 @@ -Subproject commit 741c90d81ddcde0afc7b60949648fc0ab275bff7 +Subproject commit b9be1212c7b96e2eb4367c28e3c03a537f692abd From 6c2fda8b411efa5a988d3703011ec5d90a93a5c5 Mon Sep 17 00:00:00 2001 From: Elias Alberts Date: Tue, 25 Jan 2022 10:49:04 +0300 Subject: [PATCH 05/12] cmake style and os.matrix --- .github/workflows/node.js.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 6876014..bb7d5e4 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,17 +1,18 @@ -# 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 ] +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 +28,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 From 5eb222163ebd676c9db076592a8b5b615e52055f Mon Sep 17 00:00:00 2001 From: Elias Alberts Date: Tue, 25 Jan 2022 10:58:54 +0300 Subject: [PATCH 06/12] actions : added --- .github/workflows/node.js.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index bb7d5e4..93399d6 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,6 +1,13 @@ name: Node.js CI -on: [ push, pull_request ] +on: + push: + branches: + - 'main' + - 'develop' + tags: + pull_request: + env: BUILD_TYPE: Release From 1115e17c170c1baddd1ab9c607b141867227c84a Mon Sep 17 00:00:00 2001 From: Elias Alberts Date: Mon, 31 Jan 2022 16:08:55 +0300 Subject: [PATCH 07/12] added comm sql --- app/link_config.json | 8 -------- app/src/main.cpp | 5 ++--- kjarni | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 app/link_config.json 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/main.cpp b/app/src/main.cpp index 287f0b1..afd8382 100644 --- a/app/src/main.cpp +++ b/app/src/main.cpp @@ -74,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); @@ -116,8 +116,7 @@ int main(int argc, char* argv[]) // TODO: remove json after sql implementation data_source::CommunicationDescriptionRepositorySql communicationDescriptionRepository( schema.db()); - app::CommunicationService communicationService("./link_config.json", - &communicationDescriptionRepository); + app::CommunicationService communicationService(&communicationDescriptionRepository); app::Locator::provide(&communicationService); // Presentation initialization diff --git a/kjarni b/kjarni index 0b8a260..3caa2b0 160000 --- a/kjarni +++ b/kjarni @@ -1 +1 @@ -Subproject commit 0b8a260d00cfdcba6b3c41a76e1f83f5f5993a34 +Subproject commit 3caa2b0fb3cc0735f8805a0d716576684be93803 From 9c6d6885d9c1e4f57ceb9081058567c4ee93d0fb Mon Sep 17 00:00:00 2001 From: Elias Alberts Date: Mon, 31 Jan 2022 16:19:49 +0300 Subject: [PATCH 08/12] jerom removed json copy --- modules/Jerom-The-Mavlink | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Jerom-The-Mavlink b/modules/Jerom-The-Mavlink index acfe1e5..7197760 160000 --- a/modules/Jerom-The-Mavlink +++ b/modules/Jerom-The-Mavlink @@ -1 +1 @@ -Subproject commit acfe1e5d0643983eb45ecfcaf0cd646b8f2b442b +Subproject commit 719776067517adf1d04850dbf98a1da327acbb18 From 129ff334a86a5cfb02d517dc40d84f6674bbb7d1 Mon Sep 17 00:00:00 2001 From: Elias Alberts Date: Tue, 1 Feb 2022 11:12:15 +0300 Subject: [PATCH 09/12] fix build --- 2ndparty/loodsman | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 6a0f32b14f3f5c9b8da8dd03df7acbbce8dea1df Mon Sep 17 00:00:00 2001 From: Elias Alberts Date: Tue, 1 Feb 2022 11:16:07 +0300 Subject: [PATCH 10/12] merge sebmodules --- kjarni | 2 +- modules/Jerom-The-Mavlink | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kjarni b/kjarni index 3caa2b0..2161c34 160000 --- a/kjarni +++ b/kjarni @@ -1 +1 @@ -Subproject commit 3caa2b0fb3cc0735f8805a0d716576684be93803 +Subproject commit 2161c348e8fa777f6cac3ff55b586a8bf9e07255 diff --git a/modules/Jerom-The-Mavlink b/modules/Jerom-The-Mavlink index 7197760..059c452 160000 --- a/modules/Jerom-The-Mavlink +++ b/modules/Jerom-The-Mavlink @@ -1 +1 @@ -Subproject commit 719776067517adf1d04850dbf98a1da327acbb18 +Subproject commit 059c4523e0bd1f88d12ec7ce3a103a8cca1ba94a From ca494b6b7643558d176dd43761b7f01dd49b7f28 Mon Sep 17 00:00:00 2001 From: Elias Alberts Date: Tue, 1 Feb 2022 11:52:02 +0300 Subject: [PATCH 11/12] cleanup, kj upd --- kjarni | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kjarni b/kjarni index 2161c34..4118daa 160000 --- a/kjarni +++ b/kjarni @@ -1 +1 @@ -Subproject commit 2161c348e8fa777f6cac3ff55b586a8bf9e07255 +Subproject commit 4118daaeab3401b3a20175d5f21c88beb4886a7d From c9ca0c2b01da992f541cc98bcc4e3d7ea4c8ad86 Mon Sep 17 00:00:00 2001 From: Elias Alberts Date: Wed, 2 Feb 2022 11:19:20 +0300 Subject: [PATCH 12/12] added comm_controller --- .../communication_controller.cpp | 16 ++++++++++++ .../communication/communication_controller.h | 26 +++++++++++++++++++ app/src/main.cpp | 1 - kjarni | 2 +- 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 app/src/communication/communication_controller.cpp create mode 100644 app/src/communication/communication_controller.h 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 afd8382..42c4cf6 100644 --- a/app/src/main.cpp +++ b/app/src/main.cpp @@ -113,7 +113,6 @@ int main(int argc, char* argv[]) app::Locator::provide(&layout); // app layer initializaion - // TODO: remove json after sql implementation data_source::CommunicationDescriptionRepositorySql communicationDescriptionRepository( schema.db()); app::CommunicationService communicationService(&communicationDescriptionRepository); diff --git a/kjarni b/kjarni index 4118daa..8e04ac8 160000 --- a/kjarni +++ b/kjarni @@ -1 +1 @@ -Subproject commit 4118daaeab3401b3a20175d5f21c88beb4886a7d +Subproject commit 8e04ac80b9adc9efa7aa1516c4e2cd4b0d4e6453