feat: add auto drainage.

This commit is contained in:
sunwen
2025-05-28 14:04:13 +08:00
parent 27fff41eb3
commit 3063efd223
11 changed files with 201 additions and 108 deletions

View File

@@ -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);

View File

@@ -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();

View File

@@ -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("<font color='red'>&nbsp;&nbsp;&nbsp;%1</font>").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"));