Move hwif to thread
This commit is contained in:
		@@ -5,6 +5,7 @@
 | 
			
		||||
#include "src/ATBAPP/support/JSON.h"
 | 
			
		||||
 | 
			
		||||
#include <QTimer>
 | 
			
		||||
#include <QThread>
 | 
			
		||||
#include <QTextCodec>
 | 
			
		||||
#include <QDebug>
 | 
			
		||||
 | 
			
		||||
@@ -46,6 +47,11 @@ ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent)
 | 
			
		||||
    connect(dynamic_cast<QObject*>(hw), SIGNAL(hwapi_doorCBinAndAllDoorsClosed()), this, SLOT(onCBinAndAllDoorsClosed()), Qt::QueuedConnection);
 | 
			
		||||
    connect(dynamic_cast<QObject*>(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<QObject*>(hw)->moveToThread(hwThread);
 | 
			
		||||
    hwThread->start();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    this->diag = new DeviceControllerDiag(this);
 | 
			
		||||
    connect(this->diag, &DeviceControllerDiag::newVoltage, this, &ATBDeviceControllerPlugin::onNewVoltage);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user