fix: Add trigger StopScanProcess event while start scan failed.

This commit is contained in:
sunwen
2024-06-18 11:43:58 +08:00
parent a48adea949
commit 0aa477fb58

View File

@@ -824,9 +824,10 @@ bool DeviceManager::startFullScan(const QString& aPatientInfo)
DmsSyncActionResult result = mFullScanAction->execute();
if(!result.mIsSucessful)
{
QString message = QString("Dms connection error. Reason:%1").arg(result.mData);
QString message = tr("Start scan failed. Reason:time out.");
THROW_ERROR(message);
LOG_SYS_OPERATION("Start full scan failed. " + message)
LOG_SYS_OPERATION("Start full scan failed. " + message);
TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
return false;
}
@@ -835,8 +836,9 @@ bool DeviceManager::startFullScan(const QString& aPatientInfo)
if(code != 0)
{
QString msg = jsonObj["info"].toString();
LOG_SYS_OPERATION("Start full scan failed. " + msg)
LOG_SYS_OPERATION("Start full scan failed. " + msg);
THROW_ERROR(msg);
TRIGGER_EVENT(StopScanProcess, nullptr, nullptr);
return false;
}
mCurrentScanMeasurementID = jsonObj["measurement id"].toString();