From 76ce6e0c26ef65be0d0c35c8228465a0cb3d4e5b Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Mon, 10 Jul 2023 16:09:16 +0200 Subject: [PATCH] Move hwif to thread --- src/ATBAPP/ATBDeviceControllerPlugin.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.cpp b/src/ATBAPP/ATBDeviceControllerPlugin.cpp index f4ecca6..4575a96 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.cpp +++ b/src/ATBAPP/ATBDeviceControllerPlugin.cpp @@ -5,6 +5,7 @@ #include "src/ATBAPP/support/JSON.h" #include +#include #include #include @@ -46,6 +47,11 @@ ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) connect(dynamic_cast(hw), SIGNAL(hwapi_doorCBinAndAllDoorsClosed()), this, SLOT(onCBinAndAllDoorsClosed()), Qt::QueuedConnection); connect(dynamic_cast(hw), SIGNAL(hwapi_doorAllDoorsClosed()), this, SLOT(onAllDoorsClosed()), Qt::QueuedConnection); // check for errors, switch to mode IDLE + // move hw object to separate thread: + auto hwThread = new QThread; + dynamic_cast(hw)->moveToThread(hwThread); + hwThread->start(); + this->diag = new DeviceControllerDiag(this); connect(this->diag, &DeviceControllerDiag::newVoltage, this, &ATBDeviceControllerPlugin::onNewVoltage);