diff --git a/src/device/DeviceManager.cpp b/src/device/DeviceManager.cpp index 49787bb..376d5a4 100644 --- a/src/device/DeviceManager.cpp +++ b/src/device/DeviceManager.cpp @@ -146,25 +146,25 @@ void DeviceManager::initDevice() mDrainageControlAction->setTimeoutInterval(WATERPROCESS_TIMEOUT); connect(mDrainageControlAction, &DmsAsyncAction::timeout, [this]() { - this->processDrainageResult("{\"code\":-1}"); + this->processDrainageResult("{\"code\":-1,\"info\":\"454\"}"); }); mWaterfloodAction = new DmsAsyncAction(USRV_CONTROL, ACT_CTL_WINJECT, this, "responseWaterflood(const QString&)", this); mWaterfloodAction->setTimeoutInterval(WATERPROCESS_TIMEOUT); connect(mWaterfloodAction, &DmsAsyncAction::timeout, [this]() { - this->processWaterfloodResult("{\"code\":-1}"); + this->processWaterfloodResult("{\"code\":-1,\"info\":\"454\"}"); }); mWaterCleanAction = new DmsAsyncAction(USRV_CONTROL, ACT_CTL_WCLEAN, this, "responseWaterclean(const QString&)", this); mWaterCleanAction->setTimeoutInterval(WATERPROCESS_TIMEOUT); connect(mWaterCleanAction, &DmsAsyncAction::timeout, [this]() { - this->processWaterCleanResult("{\"code\":-1}"); + this->processWaterCleanResult("{\"code\":-1,\"info\":\"454\"}"); }); mWaterProcessExitAction = new DmsAsyncAction(USRV_CONTROL, ACT_CTL_WEXIT, this, "responseWaterProcessExit(const QString&)", this); mWaterProcessExitAction->setTimeoutInterval(WATERPROCESS_TIMEOUT); connect(mWaterProcessExitAction, &DmsAsyncAction::timeout, [this]() { - this->processWaterProcessExitResult("{\"code\":-1}"); + this->processWaterProcessExitResult("{\"code\":-1,\"info\":\"454\"}"); }); mGetAutoLocatePositionAction = new DmsAsyncAction(USRV_CONTROL, ACT_CTL_MOTION_POSITION, this, "responseGetAutoLocatePosition(const QString&)", this); mGetSoftwareVersionAction = new DmsAsyncAction(USRV_INFOCFG, ACT_IFCFG_VERINFO, this,"responseGetSoftwareVersion(const QString&)", this); @@ -238,11 +238,11 @@ void DeviceManager::initDevice() mCheckInitStatusTimer = startTimer(500); } -void DeviceManager::initGUI(bool aIsInitSucceed) +void DeviceManager::initGUI(bool aIsInitSucceed, int aCode) { if(!AppGlobalValues::DBconnected().toBool()) { - emitErrorCallback(tr("Fail to connect to DB!Reboot device to try!")); + emitErrorCallback(tr("Fail to connect to DB!Reboot device to try!") + tr("\nError: ") + QString::number(455)); emit initializeFinished(); return; } @@ -275,7 +275,7 @@ void DeviceManager::initGUI(bool aIsInitSucceed) else { UsctStateManager::getInstance()->setState(DmsState, false); - QString msg = tr("Initialize Failed."); + QString msg = tr("Initialize Failed.") + tr("\nError: ") + QString::number(aCode); THROW_ERROR(msg); emit initializeProgress("33"); QThread::msleep(500); @@ -605,7 +605,7 @@ void DeviceManager::checkInitStatus() killTimer(mCheckInitStatusTimer); mCheckInitStatusTimer = -1; } - initGUI(false); + initGUI(false, 454); return; } @@ -617,7 +617,7 @@ void DeviceManager::checkInitStatus() killTimer(mCheckInitStatusTimer); mCheckInitStatusTimer = -1; } - initGUI(true); + initGUI(true, 0); } else if(jsonObj["code"].toInt() == 2) { @@ -626,7 +626,7 @@ void DeviceManager::checkInitStatus() killTimer(mCheckInitStatusTimer); mCheckInitStatusTimer = -1; } - initGUI(false); + initGUI(false, jsonObj["info"].toInt()); } } @@ -1217,7 +1217,7 @@ void DeviceManager::processDrainageResult(const QString& aResponse) } emit startDrainageControlResult(false); - QString msg = tr("Open drain vavle failed."); + QString msg = tr("Open drain vavle failed.") + tr("\nError: ") + jsonObj["info"].toString(); THROW_ERROR(msg); } @@ -1241,7 +1241,7 @@ void DeviceManager::processWaterfloodResult(const QString &aResponse) } emit startWaterfloodResult(false); - QString msg = tr("Water injection failed."); + QString msg = tr("Water injection failed.")+ tr("\nError: ") + jsonObj["info"].toString();; THROW_ERROR(msg); } @@ -1265,7 +1265,7 @@ void DeviceManager::processWaterCleanResult(const QString &aResponse) } emit startWaterCleanResult(false); - QString msg = tr("Cleaning startup failed."); + QString msg = tr("Cleaning startup failed.") + tr("\nError: ") + jsonObj["info"].toString(); THROW_ERROR(msg); } @@ -1294,10 +1294,10 @@ void DeviceManager::processWaterProcessFinishedResult(const QString &aResponse) QJsonObject jsonObj = toJsonObject(aResponse); if(jsonObj["code"].toInt() == 0 ) { - emit waterProcessFinishedResult(true); + emit waterProcessFinishedResult(true, jsonObj["info"].toString()); return; } - emit waterProcessFinishedResult(false); + emit waterProcessFinishedResult(false, jsonObj["info"].toString()); } void DeviceManager::updateReconConnectionState(bool aIsConnected) diff --git a/src/device/DeviceManager.h b/src/device/DeviceManager.h index 029d9d7..eae7d10 100644 --- a/src/device/DeviceManager.h +++ b/src/device/DeviceManager.h @@ -112,7 +112,7 @@ private: void checkInitStatus(); bool startAutoLocate(); void stopAutoLocate(); - void initGUI(bool aIsInitSucceed); + void initGUI(bool aIsInitSucceed, int aCode); void checkDataQuality(); void processScanProgress(const QString& aProgress); @@ -189,7 +189,7 @@ signals: void startWaterfloodResult(bool aIsSucessful); void startWaterCleanResult(bool aIsSucessful); void exitWaterProcessResult(bool aIsSucessful); - void waterProcessFinishedResult(bool aIsSucessful); + void waterProcessFinishedResult(bool aIsSucessful, const QString& aInfoCode); void startAutoLocateResult(bool aIsSucessful); void updateAutoLocatePosition(int aX, int aY, int aZ); void autolocatePositionEffective(); diff --git a/src/forms/scan/ScanFormWidget.cpp b/src/forms/scan/ScanFormWidget.cpp index 8b4d9bf..5f73b27 100644 --- a/src/forms/scan/ScanFormWidget.cpp +++ b/src/forms/scan/ScanFormWidget.cpp @@ -271,7 +271,7 @@ void ScanFormWidget::initCommandWidget(QHBoxLayout *layout) } }); - connect(DeviceManager::Default(), &DeviceManager::waterProcessFinishedResult, [this](bool aIsSucessful) + connect(DeviceManager::Default(), &DeviceManager::waterProcessFinishedResult, [this](bool aIsSucessful, const QString& aInfo) { if(!mIsWaterProcessing) { @@ -302,13 +302,13 @@ void ScanFormWidget::initCommandWidget(QHBoxLayout *layout) switch (mWaterProcessMode) { case WaterFloodMode: - message = tr("Waterflood failed."); + message = tr("Waterflood failed.") + tr("\nError: ") + aInfo; break; case DrainageMode: - message = tr("Drainage failed."); + message = tr("Drainage failed.") + tr("\nError: ") + aInfo; break; case WaterCleanMode: - message = tr("Clean failed."); + message = tr("Clean failed.") + tr("\nError: ") + aInfo; break; } EventCenter::Default()->triggerEvent(GUIEvents::GUIErrorRaise, nullptr, (QObject*)&message); diff --git a/src/translations/en_US.ts b/src/translations/en_US.ts index 20bee37..443e012 100644 --- a/src/translations/en_US.ts +++ b/src/translations/en_US.ts @@ -418,6 +418,11 @@ After lying down, click the confirm buttonto start scanning on the next side.Cleaning startup failed. + + +Error: + + DialogManager @@ -1691,6 +1696,11 @@ The emergency button has been pushed. Please reset it before other operations.Draining + + +Error: + + ScanSearchCriteriaForm diff --git a/src/translations/zh_CN.ts b/src/translations/zh_CN.ts index 3b49132..6b2efba 100644 --- a/src/translations/zh_CN.ts +++ b/src/translations/zh_CN.ts @@ -515,6 +515,17 @@ progress:99% Fail to connect to DB!Reboot device to try! 数据库连接失败,请重启设备后再试! + + + + + + + +Error: + +错误: + Device is not ready, start scan operation failed! @@ -2570,6 +2581,15 @@ The emergency button has been pushed. Please reset it before other operations.Drainage finished. Please do the disinfection in next step. 排水完成,请下一步进行清洁消毒 + + + + + +Error: + +错误: + Drainage failed. @@ -3428,7 +3448,7 @@ parameters Gender - 患者编码性别 + 患者性别