Update drainage with dms control.
This commit is contained in:
@@ -124,6 +124,11 @@ void DeviceManager::initDevice()
|
||||
connect(EventCenter::Default(), &EventCenter::RequestPreviewScan,this, &DeviceManager::startPreview);
|
||||
//shutdown
|
||||
connect(EventCenter::Default(), &EventCenter::RequestShutdown, this, &DeviceManager::shutdown);
|
||||
//Drainage
|
||||
connect(EventCenter::Default(), &EventCenter::RequestDrainage, this, [this](QObject* sender, QObject* detail)
|
||||
{
|
||||
controlDrainage(*(QString*)detail);
|
||||
});
|
||||
|
||||
//Sync action
|
||||
mGetDeviceStatusAction = new DmsSyncAction(USRV_SCAN, ACT_SCAN_STATUS, this, "responseGetDeviceStatus(const QString&)", this);
|
||||
@@ -1011,3 +1016,19 @@ bool DeviceManager::getCEStatus()
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void DeviceManager::controlDrainage(const QString& aCode)
|
||||
{
|
||||
mPumpControlAction->setSendData(QString("{\"pumb\":%1}").arg(aCode));
|
||||
auto result = mPumpControlAction->execute();
|
||||
if(result.mIsSucessful)
|
||||
{
|
||||
QJsonObject jsonObj = toJsonObject(result.mData);
|
||||
if(jsonObj["code"].toInt() == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
QString msg = tr("Open pump failed.");
|
||||
THROW_ERROR(msg);
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@ private:
|
||||
bool startCEScan();
|
||||
void startTransfer();
|
||||
void initEmptyScanMeasurementID();
|
||||
void controlDrainage(const QString& aCode);
|
||||
|
||||
void processScanProgress(const QString& aProgress);
|
||||
void processInitializeProgress(const QString& aProgress);
|
||||
|
||||
Reference in New Issue
Block a user