diff --git a/cfgs/usct-product.json b/cfgs/usct-product.json index 3a2f131..d8282db 100644 --- a/cfgs/usct-product.json +++ b/cfgs/usct-product.json @@ -125,5 +125,8 @@ "filter": { "usage": "0", "maximumusage": "100" - } + }, + "WaterProcess": { + "AutoDrainage": false + } } diff --git a/src/device/DeviceManager.cpp b/src/device/DeviceManager.cpp index a816ab2..4c9c667 100644 --- a/src/device/DeviceManager.cpp +++ b/src/device/DeviceManager.cpp @@ -115,6 +115,7 @@ void DeviceManager::initDevice() connect(EventCenter::Default(), &EventCenter::RequestShutdown, this, &DeviceManager::shutdownDms); //Drainage connect(EventCenter::Default(), &EventCenter::RequestDrainage, this, &DeviceManager::startDrainage); + connect(EventCenter::Default(), &EventCenter::RequestAutoDrainage, this, &DeviceManager::startAutoDrainage); connect(EventCenter::Default(), &EventCenter::RequestWaterflood, this, &DeviceManager::startWaterflood); connect(EventCenter::Default(), &EventCenter::RequestWaterClean, this, &DeviceManager::startWaterClean); connect(EventCenter::Default(), &EventCenter::RequestWaterModeExit, this, &DeviceManager::exitWaterProcess); @@ -382,6 +383,7 @@ void DeviceManager::processScanProgress(const QString& aProgress) { case 1: { + mIsFirstInTransferPorgress = true; QVariant var(tr("progress:%1%").arg(msg)); TRIGGER_EVENT(InvokeOperationProgress, nullptr, (QObject *) &var); break; @@ -395,7 +397,11 @@ void DeviceManager::processScanProgress(const QString& aProgress) } else { - ScanProcessSequence::getInstance()->fullScanDataExport(); + if(mIsFirstInTransferPorgress) + { + mIsFirstInTransferPorgress = false; + ScanProcessSequence::getInstance()->fullScanDataExport(); + } var = QVariant(tr("Patient can leave.\nprogress:%1%").arg(msg)); } TRIGGER_EVENT(InvokeOperationProgress, nullptr, (QObject *) &var); @@ -1178,6 +1184,7 @@ bool DeviceManager::getCEStatus() void DeviceManager::startDrainage() { + mIsAutoDrainage = false; if(!mDrainageControlAction->execute()) { emit startDrainageControlResult(false); @@ -1186,8 +1193,22 @@ void DeviceManager::startDrainage() } } +void DeviceManager::startAutoDrainage() +{ + if(!JsonObject::Instance()->getAutoDrainage()) + { + return; + } + mIsAutoDrainage = true; + mDrainageControlAction->execute(); +} + void DeviceManager::processDrainageResult(const QString& aResponse) { + if(mIsAutoDrainage) + { + return; + } QJsonObject jsonObj = toJsonObject(aResponse); if(jsonObj["code"].toInt() == 0 ) { diff --git a/src/device/DeviceManager.h b/src/device/DeviceManager.h index 7218845..029d9d7 100644 --- a/src/device/DeviceManager.h +++ b/src/device/DeviceManager.h @@ -105,6 +105,7 @@ private: bool startCEScan(); void initEmptyScanMeasurementID(); void startDrainage(); + void startAutoDrainage(); void startWaterflood(); void startWaterClean(); void exitWaterProcess(); @@ -209,6 +210,8 @@ private: bool mIsPreviewing = false; bool mIsInitializing = false; bool mIsAutoLocating = false; + bool mIsFirstInTransferPorgress = false; + bool mIsAutoDrainage = false; QString mCurrentScanMeasurementID = ""; QString mCurrentEmptyMeasurementID = ""; diff --git a/src/event/EventCenter.h b/src/event/EventCenter.h index 26d337f..67603c2 100644 --- a/src/event/EventCenter.h +++ b/src/event/EventCenter.h @@ -16,6 +16,7 @@ ADD_EVENT_VALUE(RequestContinueScan)\ ADD_EVENT_VALUE(RequestFullScanStop)\ ADD_EVENT_VALUE(RequestPreviewStop)\ ADD_EVENT_VALUE(RequestDrainage)\ +ADD_EVENT_VALUE(RequestAutoDrainage)\ ADD_EVENT_VALUE(RequestWaterflood)\ ADD_EVENT_VALUE(RequestWaterClean)\ ADD_EVENT_VALUE(RequestWaterModeExit)\ diff --git a/src/forms/scan/ScanFormWidget.cpp b/src/forms/scan/ScanFormWidget.cpp index 1df48f7..dd0aadf 100644 --- a/src/forms/scan/ScanFormWidget.cpp +++ b/src/forms/scan/ScanFormWidget.cpp @@ -379,6 +379,11 @@ void ScanFormWidget::initCommandWidget(QHBoxLayout *layout) connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::fullScanDataExport, [this]() { mScanProcessLabel->setText(tr("Data exporting, patient can leave the holder")); + if(ScanProcessSequence::getInstance()->getScanPositionSize() == 1) + { + mScanProcessLabel->setText(tr("Data exporting, patient can leave the holder, drainage in progress.")); + EventCenter::Default()->triggerEvent(GUIEvents::RequestAutoDrainage, nullptr, nullptr); + } }); connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::startFullScan, this, &ScanFormWidget::prepareStartFullScan, Qt::QueuedConnection); diff --git a/src/forms/settings/GeneralForm.cpp b/src/forms/settings/GeneralForm.cpp index a707847..9fa0eb9 100644 --- a/src/forms/settings/GeneralForm.cpp +++ b/src/forms/settings/GeneralForm.cpp @@ -170,6 +170,18 @@ GeneralForm::GeneralForm(QWidget* aParent) screenSaverHeaderLayout->addWidget(screenSaverButton); screenSaverHeaderLayout->addSpacerItem(new QSpacerItem(1000, 20, QSizePolicy::Fixed)); + //Auto Drainage + QWidget* autoDrainageHeader = new QWidget(this); + mLayout->addWidget(autoDrainageHeader); + QHBoxLayout* autoDrainageHeaderLayout = new QHBoxLayout(autoDrainageHeader); + QLabel* autoDrainageLabel = new QLabel(tr("Auto Drainage"), this); + autoDrainageHeaderLayout->addWidget(autoDrainageLabel); + autoDrainageHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding)); + ImageSwitch* autoDrainageButton = new ImageSwitch(autoDrainageHeader); + autoDrainageButton->setChecked(JsonObject::Instance()->getAutoDrainage()); + autoDrainageHeaderLayout->addWidget(autoDrainageButton); + autoDrainageHeaderLayout->addSpacerItem(new QSpacerItem(1000, 20, QSizePolicy::Fixed)); + //DiskIcon QWidget* diskHeader = new QWidget(this); QWidget* diskContent = new QWidget(this); @@ -255,6 +267,8 @@ GeneralForm::GeneralForm(QWidget* aParent) diskLabel->setText(tr("Disk Storage")); worklistFilterDateLabel->setText(tr("Worklist Date Filter")); worklistFilterModalityLabel->setText(tr("Worklist Modality Filter")); + filterUsageLabel->setText(tr("Filter Usage Reset")); + filterUsageResetButton->setText(tr("Reset")); anonyButton->setChecked(JsonObject::Instance()->getAnonymousMode()); scanProtocolButton->setText(GetProtocalHelper::getProtocalStr()); worklistFilterDateButton->setText(WorklistFilterHelper::getCurrentWorklistFilterDate()); @@ -279,6 +293,13 @@ GeneralForm::GeneralForm(QWidget* aParent) LOG_USER_OPERATION((isOpen ? QString("Open") : QString("Close")) + " Screen Saver"); }); + connect(autoDrainageButton, &ImageSwitch::clicked, [=]() + { + bool isOpen = autoDrainageButton->getChecked(); + JsonObject::Instance()->setAutoDrainage(isOpen); + LOG_USER_OPERATION((isOpen ? QString("Open") : QString("Close")) + " Auto Drainage"); + }); + connect(scanProtocolButton, &QPushButton::clicked, [=]() { DialogResult result = DialogManager::Default()->requestSelectProtocal(); diff --git a/src/forms/settings/SystemCorrectionForm.cpp b/src/forms/settings/SystemCorrectionForm.cpp index 182c1a8..1159739 100644 --- a/src/forms/settings/SystemCorrectionForm.cpp +++ b/src/forms/settings/SystemCorrectionForm.cpp @@ -79,7 +79,7 @@ void SystemCorrectionForm::init() QHBoxLayout* emptyScanButtonLayout = new QHBoxLayout(emptyScanButtonArea); QPushButton* emptyScanButton = new QPushButton(this); emptyScanButton->setText(tr("Excute empty scan")); - emptyScanButton->setFixedWidth(250); + emptyScanButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); emptyScanButtonLayout->addWidget(emptyScanButton); emptyScanButtonLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding)); vboxLayout->addWidget(emptyScanButtonArea); @@ -97,6 +97,8 @@ void SystemCorrectionForm::init() emptyScanTitle->setText(tr("Empty Scan")); emptyScanDescribe->setText(tr("Empty water scanning involves collecting ultrasound data while the tank is filled with water and free of any objects. It is essential to ensure that the tank is fully filled with water and devoid of any objects before conducting the scan. The purpose of collecting empty water data is to obtain baseline information on the time and energy variations of ultrasound propagation inside the inspection tank. This information is utilized for reconstructing reference data for transmission ultrasound imaging. Additionally, empty water data can be utilized for system status assessment and spatial calibration of the system. Therefore, empty water scanning should be performed regularly, with a frequency of once every month.")); mCurrentEmptyScanDate->setText(tr("Current date for Empty Scanning %1-%2-%3").arg(lastScanDate.year()).arg(lastScanDate.month()).arg(lastScanDate.day())); + QString dateText = tr("%1-%2-%3").arg(expirationScanDate.year()).arg(expirationScanDate.month()).arg(expirationScanDate.day());; + QString dateFormat = currentDate.daysTo(expirationScanDate) < 3 ? QString("   %1").arg(dateText) : QString(" %1").arg(dateText); mExpirationEmptyScanDate->setText(tr("Expiration date for Empty Scanning %1").arg(dateFormat)); mCurrentEmptyScanState->setText(tr("Current state for Empty Scanning %1").arg(getStateString(mEmptyScanState))); emptyScanButton->setText(tr("Excute empty scan")); diff --git a/src/json/jsonobject.cpp b/src/json/jsonobject.cpp index b82a284..1290399 100644 --- a/src/json/jsonobject.cpp +++ b/src/json/jsonobject.cpp @@ -72,6 +72,7 @@ void JsonObject::init() mScreenSaverMode = getBool("screensaver","open"); mScreenSaverInfoList = QString(getJsonString("screensaver", "content")).split(";"); mDmsSimulator = getBool("dms","simulator"); + mAutoDrainage = getBool("WaterProcess","AutoDrainage"); mOperationLogExpireDays = QString(getJsonString("operatorlog", "expire")).toInt(); mPatientListExpireDays = QString(getJsonString("patientlist", "expire")).toInt(); mScanListExpireDays = QString(getJsonString("reconlist", "expire")).toInt(); @@ -716,3 +717,14 @@ int JsonObject::getFilterMaximumUsage() return mMaximumFilterUsage; } +bool JsonObject::getAutoDrainage() +{ + return mAutoDrainage; +} + +void JsonObject::setAutoDrainage(bool aIsAutoDrainage) +{ + mAutoDrainage = aIsAutoDrainage; + setBool("WaterProcess","AutoDrainage", aIsAutoDrainage, true); +} + diff --git a/src/json/jsonobject.h b/src/json/jsonobject.h index 5a3c7e4..1c80622 100644 --- a/src/json/jsonobject.h +++ b/src/json/jsonobject.h @@ -105,6 +105,9 @@ public: bool getMppsOpen(); void setMppsOpen(bool aIsOpen); + bool getAutoDrainage(); + void setAutoDrainage(bool aIsAutoDrainage); + const char* getEmptyScanID(); void setEmptyScanID(const char* id); @@ -204,6 +207,7 @@ private: bool mScreenSaverMode; bool mMppsOpen; bool mScanCanWithoutRecon; + bool mAutoDrainage; diff --git a/src/translations/en_US.ts b/src/translations/en_US.ts index f21845f..2393a73 100644 --- a/src/translations/en_US.ts +++ b/src/translations/en_US.ts @@ -666,6 +666,10 @@ After lying down, click the confirm buttonto start scanning on the next side.Please confirm if the filter usage reset is required? + + Auto Drainage + + GetAdminPsw @@ -1677,6 +1681,10 @@ The emergency button has been pushed. Please reset it before other operations.Please confirm if cleaning and disinfection are required ? + + Data exporting, patient can leave the holder, drainage in progress. + + ScanSearchCriteriaForm diff --git a/src/translations/zh_CN.ts b/src/translations/zh_CN.ts index 9ac6430..2699482 100644 --- a/src/translations/zh_CN.ts +++ b/src/translations/zh_CN.ts @@ -468,89 +468,89 @@ DeviceManager - - - - + + + + DMS connection error DMS失去连接 - - + + progress:%1% 进度:%1% - + Patient can leave. progress:%1% 检查对象可以起身 进度:%1% - + Data quality assessment in progress progress:99% 数据质量判断中 进度:99% - - - + + + Initialize Failed. 初始化失败 - + Fail to connect to DB!Reboot device to try! 数据库连接失败,请重启设备后再试! - + Device is not ready, start scan operation failed! 设备状态错误,无法开始检查流程 - + Device is not ready, start empty scan operation failed! 设备状态错误,无法开始空水扫查 - + Scan completed! Please prepare for the next scan. After lying down, click the confirm buttonto start scanning on the next side. 扫查结束,请准备下一侧扫查。 请在趴好后再点击确认按钮! - + Scan completed! 扫查结束 - + Error: 错误: - + Start scan failed. Reason:time out. 扫查启动失败,原因:超时 - + Start scan failed. Reason:%1 扫查启动失败,原因:%1 - + Start CE Scan Failed. CE扫查启动失败 - + Shut down failed, please push emergency button to shutdown. 关机失败,请按紧急按钮进行关机。 @@ -559,55 +559,55 @@ After lying down, click the confirm buttonto start scanning on the next side.扫查数据上传失败 - + Create empty scan data failed 空水数据新增失败 - + Create scan data failed 扫查数据新增失败 - + Recon disconnected. 重建服务器已断开连接 - - + + Open pump failed. 排水阀打开失败 - - + + Water injection failed. 注水启动失败 - - + + Cleaning failed. 清洁启动失败 - + Recon error, can't start scan process 重建服务器错误,无法开始检查流程 - + Start auto locate failed 自动化定位启动失败 - + The data quality is low, please restart the data scan. 扫查数据质量较低,请重新开始检查流程 - + Device reset failed, please contact maintenance person 设备复位失败,请联系维修人员 @@ -873,7 +873,7 @@ After lying down, click the confirm buttonto start scanning on the next side.GeneralForm - + Language 语言 @@ -884,60 +884,67 @@ After lying down, click the confirm buttonto start scanning on the next side. - - + + Institution Addr 机构地址 - + Lock Screen 锁屏时间 - + Scan Protocol 默认检查协议 - + Worklist Modality Filter Worklist模态过滤器 - + Worklist Date Filter Worklist时间过滤器 + Filter Usage Reset 重置滤芯使用量 + Reset 重置 - + Anonymous Mode 匿名模式 - + Screen Saver 屏保 + + + Auto Drainage + 自动排水 + - + Complete Notify 检查结束确认 @@ -946,8 +953,8 @@ After lying down, click the confirm buttonto start scanning on the next side.Worklist过滤器 - - + + Disk Storage 磁盘存储 @@ -956,27 +963,27 @@ After lying down, click the confirm buttonto start scanning on the next side.中文 - + Used: %1G - + Total: %1G - + Get disk used size fail! 磁盘使用空间获取失败! - + Please confirm if the filter usage reset is required? 请确认是否重置滤芯用量? - + Get disk total size fail! 磁盘总空间获取失败! @@ -1561,47 +1568,47 @@ After lying down, click the confirm buttonto start scanning on the next side. - - + + Select 选择 - - + + Scan 扫描 - - + + Recon 重建 - + Please execute the empty scan, assist with system calibration, when empty scan is completed, the system should operate normally. 请先进行空水扫查,辅助系统校正,空水扫查结束后,系统正常运行。 - - - + + + Warning 警告 - + There are %1 days left until the next empty scan. Please remind users to conduct the empty scan in time. 距离下次空水扫查还有%1天,请用户及时进行空水扫查。 - + Shut down failed, please push emergency button to shutdown. 关机失败,请按紧急按钮进行关机。 - + Due to empty scan data corruption on the server, needs to be execute the empty scan. No other operations can be conducted until the scan is complete. 服务器端空水数据损坏,需要进行空水扫查,空水扫查结束前无法进行其他操作。 @@ -1618,8 +1625,8 @@ After lying down, click the confirm buttonto start scanning on the next side.管理 - - + + Settings 设置 @@ -2394,14 +2401,14 @@ The emergency button has been pushed. Please reset it before other operations. - - + + Drainage 排水 - + Account 账户 @@ -2422,7 +2429,7 @@ The emergency button has been pushed. Please reset it before other operations. - + ShutDown 关机 @@ -2432,23 +2439,23 @@ The emergency button has been pushed. Please reset it before other operations. - + Start Scan 开始检查流程 - - + + Waterflood 注水 - - + + Clean 清洁 @@ -2465,7 +2472,7 @@ The emergency button has been pushed. Please reset it before other operations. - + Waterflooding 注水中 @@ -2482,22 +2489,22 @@ The emergency button has been pushed. Please reset it before other operations. - + Drainaging 排水中 - - + + Confirm cleaning 清洁确认 - - + + Cleaning 清洁中 @@ -2512,7 +2519,7 @@ The emergency button has been pushed. Please reset it before other operations.注水完成 - + Please click the confirm button for cleaning after disinfection. 请消毒完成后,再点击确认按钮进行清洁 @@ -2561,8 +2568,8 @@ The emergency button has been pushed. Please reset it before other operations. - - + + Please confirm checking patient information to start the process 请确定检查对象信息开始流程 @@ -2577,17 +2584,22 @@ The emergency button has been pushed. Please reset it before other operations.数据导出中,检查对象可以离开检查仓 - + + Data exporting, patient can leave the holder, drainage in progress. + 数据导出中,检查对象可以离开检查仓,自动排水中 + + + cleanning finished. 清洁完成 - + Left side scan initiated, auto positioning in progress. 左侧扫查启动,自动定位中 - + Right side scan initiated, auto positioning in progress. 右侧扫查启动,自动定位中 @@ -3003,61 +3015,62 @@ parameters - + Current date for Empty Scanning %1-%2-%3 当前空水数据扫描时间 %1年%2月%3日 - + + %1-%2-%3 %1年%2月%3日 - - + + Expiration date for Empty Scanning %1 当前空水数据有效期限%1 - + Excute empty scan 执行空水扫描 - + Please make sure the holder is only contain water! 请确认Holder中已灌满水,并没有其他物体的情况下再启动空水扫描 - + Confirm Scan 扫查确认 - + Scan completed 扫查结束 - - - - - + + + + + Current state for Empty Scanning %1 当前空水数据系统状态 %1 - + Expired 过期 - + Broked 损坏 @@ -3078,18 +3091,18 @@ parameters 传输成功 - + Recon Error 服务器端错误 - + Normal 正常 - + Unknow 未知