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);