From 0aa477fb58aa0550d24d021ca6fec7b09be239da Mon Sep 17 00:00:00 2001 From: sunwen Date: Tue, 18 Jun 2024 11:43:58 +0800 Subject: [PATCH] fix: Add trigger StopScanProcess event while start scan failed. --- src/device/DeviceManager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/device/DeviceManager.cpp b/src/device/DeviceManager.cpp index d8d3295..ecab858 100644 --- a/src/device/DeviceManager.cpp +++ b/src/device/DeviceManager.cpp @@ -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();