fix: Fix drainage do not dislpay complete dialog.
This commit is contained in:
@@ -147,6 +147,7 @@ void DeviceManager::initDevice()
|
||||
{
|
||||
this->processDrainageResult("{\"code\":-1,\"info\":\"454\"}");
|
||||
});
|
||||
connect(EventCenter::Default(), &EventCenter::RequestAutoDrainage, this, &DeviceManager::startAutoDrainage);
|
||||
mWaterfloodAction = new DmsAsyncAction(USRV_CONTROL, ACT_CTL_WINJECT, this, "responseWaterflood(const QString&)", this);
|
||||
mWaterfloodAction->setTimeoutInterval(WATERPROCESS_TIMEOUT);
|
||||
connect(mWaterfloodAction, &DmsAsyncAction::timeout, [this]()
|
||||
@@ -443,6 +444,11 @@ void DeviceManager::prepareFinishScan(bool isNormalFinish, const QString& aReaso
|
||||
if(!mIsEmptyScan)
|
||||
{
|
||||
TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
|
||||
if(mIsAutoDrainage)
|
||||
{
|
||||
mIsAutoDrainage = false;
|
||||
exitWaterProcess();
|
||||
}
|
||||
}
|
||||
TRIGGER_EVENT(InvokeOperationEnd, nullptr, var);
|
||||
return;
|
||||
@@ -1183,24 +1189,33 @@ bool DeviceManager::getCEStatus()
|
||||
|
||||
void DeviceManager::startDrainage()
|
||||
{
|
||||
mIsAutoDrainage = false;
|
||||
if(!mDrainageControlAction->execute())
|
||||
{
|
||||
QString msg = tr("Open drain vavle failed.");
|
||||
emit startDrainageControlResult(false, msg);
|
||||
emit startDrainageControlResult(false);
|
||||
THROW_ERROR(msg);
|
||||
}
|
||||
}
|
||||
|
||||
void DeviceManager::startAutoDrainage()
|
||||
{
|
||||
mIsAutoDrainage = true;
|
||||
mDrainageControlAction->execute();
|
||||
}
|
||||
|
||||
void DeviceManager::processDrainageResult(const QString& aResponse)
|
||||
{
|
||||
QJsonObject jsonObj = toJsonObject(aResponse);
|
||||
if(jsonObj["code"].toInt() == 0 )
|
||||
{
|
||||
emit startDrainageControlResult(true);
|
||||
emit startDrainageControlResult(true, mIsAutoDrainage);
|
||||
return;
|
||||
}
|
||||
|
||||
QString msg = tr("Open drain vavle failed.") + tr("\nError: ") + jsonObj["info"].toString();
|
||||
emit startDrainageControlResult(false, msg);
|
||||
emit startDrainageControlResult(false, mIsAutoDrainage);
|
||||
THROW_ERROR(msg);
|
||||
}
|
||||
|
||||
void DeviceManager::startWaterflood()
|
||||
@@ -1273,6 +1288,7 @@ void DeviceManager::processWaterProcessExitResult(const QString &aResponse)
|
||||
|
||||
void DeviceManager::processWaterProcessFinishedResult(const QString &aResponse)
|
||||
{
|
||||
mIsAutoDrainage = false;
|
||||
QJsonObject jsonObj = toJsonObject(aResponse);
|
||||
if(jsonObj["code"].toInt() == 0 )
|
||||
{
|
||||
|
||||
@@ -105,6 +105,7 @@ private:
|
||||
bool startCEScan();
|
||||
void initEmptyScanMeasurementID();
|
||||
void startDrainage();
|
||||
void startAutoDrainage();
|
||||
void startWaterflood();
|
||||
void startWaterClean();
|
||||
void exitWaterProcess();
|
||||
@@ -184,7 +185,7 @@ signals:
|
||||
void initializeFinished();
|
||||
void initializeProgress(const QString& aProgress);
|
||||
void startPreviewScanResult(bool aIsSucessful);
|
||||
void startDrainageControlResult(bool aIsSucessful, const QString& aMessage = "");
|
||||
void startDrainageControlResult(bool aIsSucessful, bool aIsAutoDrainage = false);
|
||||
void startWaterfloodResult(bool aIsSucessful);
|
||||
void startWaterCleanResult(bool aIsSucessful);
|
||||
void exitWaterProcessResult(bool aIsSucessful);
|
||||
@@ -210,6 +211,7 @@ private:
|
||||
bool mIsInitializing = false;
|
||||
bool mIsAutoLocating = false;
|
||||
bool mIsFirstInTransferPorgress = false;
|
||||
bool mIsAutoDrainage = false;
|
||||
|
||||
QString mCurrentScanMeasurementID = "";
|
||||
QString mCurrentEmptyMeasurementID = "";
|
||||
|
||||
Reference in New Issue
Block a user