Empty scan comfirm and Drainage disable logic

This commit is contained in:
kradchen
2023-09-25 10:56:25 +08:00
parent 08037224ad
commit f128e36698
5 changed files with 99 additions and 71 deletions

View File

@@ -26,6 +26,10 @@ AlertDialog::AlertDialog(QWidget *parent, Qt::WindowFlags f)
void AlertDialog::setAlertMessage(const QString &msg) {
mLblMsg->setText(msg);
if (msg.length()>28)
{
mLblMsg->setWordWrap(true);
}
}
void AlertDialog::setTitle(const QString &msg) {

View File

@@ -37,7 +37,7 @@ ScanFormWidget::ScanFormWidget(QWidget* parent)
, mLblProtocol(new QLabel(this))
, mBtnLeft(new QToolButton(this))
, mBtnRight(new QToolButton(this))
, mBtnRefresh(new QToolButton(this))
, mBtnEScan(new QToolButton(this))
, mBtnPreview(new QToolButton(this))
, mBtnStop(new QToolButton(this))
, mBtnScan(new QToolButton(this))
@@ -123,31 +123,33 @@ void ScanFormWidget::initScanContent() {
}
void ScanFormWidget::initScanControlBar(QHBoxLayout *layout){
mBtnRefresh->setObjectName("btnRefresh");
mBtnEScan->setObjectName("btnRefresh");
mBtnPreview->setObjectName("btnPreview");
mBtnStop->setObjectName("btnStop");
mBtnScan->setObjectName("btnScan");
mBtnDrainage->setObjectName("btnDrainage");
mBtnDrainage->setCheckable(true);
mBtnRefresh->setText(tr("Empty Scan"));
mBtnEScan->setText(tr("Empty Scan"));
mBtnPreview->setText(tr("Preview"));
mBtnStop->setText(tr("Stop"));
mBtnScan->setText(tr("Scan"));
mBtnDrainage->setText(tr("Drainage"));
mBtnScan->setEnabled(false);
mBtnRefresh->setEnabled(false);
mBtnEScan->setEnabled(false);
mBtnPreview->setEnabled(false);
mBtnStop->setEnabled(false);
layout->addWidget(mBtnRefresh);
layout->addWidget(mBtnEScan);
layout->addWidget(mBtnPreview);
layout->addWidget(mBtnStop);
layout->addWidget(mBtnScan);
layout->addWidget(mBtnDrainage);
connect(mBtnRefresh, &QToolButton::clicked, [=]() {
connect(mBtnEScan, &QToolButton::clicked, [=]() {
int result = DialogManager::Default()->requestAlertMessage(tr("Please make sure the holder is only contain water!"),DialogButtonMode::OkAndCancel,tr("Confirm Scan"));
if (result != QDialog::Accepted)return;
QString patientInf(mPatInf->getCurrentPatientJsonString(true));
LOG_USER_OPERATION("Start Empty Scan")
EventCenter::Default()->triggerEvent(RequestEmptyScan, nullptr, (QObject*)(&patientInf));
@@ -155,6 +157,7 @@ void ScanFormWidget::initScanControlBar(QHBoxLayout *layout){
connect(mBtnPreview, &QToolButton::clicked, [=]() {
LOG_USER_OPERATION(QString("Start Preview, ID: %1").arg(mPatInf->getPatientID()))
EventCenter::Default()->triggerEvent(RequestPreviewScan, nullptr, nullptr);
});
connect(DeviceManager::Default(), &DeviceManager::startPreviewScanResult, [this](bool aIsSucessful)
{
@@ -228,12 +231,15 @@ void ScanFormWidget::setPreviewing(bool val) {
mBtnPreview->setCheckable(val);
mBtnPreview->setChecked(val);
mBtnPreview->setEnabled(!val);
mBtnRefresh->setEnabled(!val);
mBtnEScan->setEnabled(!val);
mBtnScan->setEnabled(!val);
mBtnDrainage->setEnabled(!val);
}
void ScanFormWidget::renderLoading() {
setPreviewing(true);
uchar c_data[PREVIEW_ROW][PREVIEW_COL];
for (auto data_ptr : c_data) {
memset(data_ptr, 0, PREVIEW_COL);
@@ -298,13 +304,13 @@ void ScanFormWidget::initEvents() {//Events-------------------------------------
if (data)
{
mBtnScan->setEnabled(true);
mBtnRefresh->setEnabled(true);
mBtnEScan->setEnabled(true);
mBtnPreview->setEnabled(true);
mBtnStop->setEnabled(true);
}
else{
mBtnScan->setEnabled(false);
mBtnRefresh->setEnabled(false);
mBtnEScan->setEnabled(false);
mBtnPreview->setEnabled(false);
mBtnStop->setEnabled(false);
}
@@ -324,7 +330,7 @@ void ScanFormWidget::initEvents() {//Events-------------------------------------
void ScanFormWidget::reloadLanguage(){
mBtnLeft->setText(tr("LEFT"));
mBtnRight->setText(tr("RIGHT"));
mBtnRefresh->setText(tr("Empty Scan"));
mBtnEScan->setText(tr("Empty Scan"));
mBtnPreview->setText(tr("Preview"));
mBtnStop->setText(tr("Stop"));
mBtnScan->setText(tr("Scan"));

View File

@@ -24,7 +24,7 @@ private:
QLabel* mLblProtocol;
QToolButton* mBtnLeft;
QToolButton* mBtnRight;
QToolButton* mBtnRefresh;
QToolButton* mBtnEScan;
QToolButton* mBtnPreview;
QToolButton* mBtnStop;
QToolButton* mBtnScan;

View File

@@ -1184,6 +1184,14 @@ parameters
<source>Drainaging</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please make sure the holder is only contain water!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Confirm Scan</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ScanSearchCriteriaForm</name>

View File

@@ -399,22 +399,22 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="746"/>
<location filename="../device/DeviceManager.cpp" line="748"/>
<source>Data is currently being transmitted, please shut down later.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="753"/>
<location filename="../device/DeviceManager.cpp" line="755"/>
<source>Shut down failed, please push emergency button to shutdown.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="1030"/>
<location filename="../device/DeviceManager.cpp" line="1032"/>
<source>Recon disconnected.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="1103"/>
<location filename="../device/DeviceManager.cpp" line="1105"/>
<source>Open pump failed.</source>
<translation type="unfinished"></translation>
</message>
@@ -1106,7 +1106,7 @@
</message>
<message>
<location filename="../../build/ui_NetworkCfgDialog.h" line="457"/>
<location filename="../network/NetworkCfgDialog.cpp" line="37"/>
<location filename="../network/NetworkCfgDialog.cpp" line="40"/>
<source>IP Address</source>
<translation type="unfinished">IP地址</translation>
</message>
@@ -1199,28 +1199,28 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../network/NetworkCfgDialog.cpp" line="37"/>
<location filename="../network/NetworkCfgDialog.cpp" line="40"/>
<location filename="../network/NetworkCfgDialog.cpp" line="43"/>
<source>Netmask</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../network/NetworkCfgDialog.cpp" line="40"/>
<location filename="../network/NetworkCfgDialog.cpp" line="43"/>
<source>Destination</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../network/NetworkCfgDialog.cpp" line="40"/>
<location filename="../network/NetworkCfgDialog.cpp" line="43"/>
<source>Gateway</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../network/NetworkCfgDialog.cpp" line="43"/>
<location filename="../network/NetworkCfgDialog.cpp" line="46"/>
<source>Apply</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../network/NetworkCfgDialog.cpp" line="44"/>
<location filename="../network/NetworkCfgDialog.cpp" line="47"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
@@ -1581,45 +1581,55 @@
<name>ScanFormWidget</name>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="63"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="331"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="337"/>
<source>Protocol</source>
<translation></translation>
</message>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="70"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="325"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="331"/>
<source>LEFT</source>
<translation></translation>
</message>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="71"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="326"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="332"/>
<source>RIGHT</source>
<translation></translation>
</message>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="133"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="327"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="333"/>
<source>Empty Scan</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="137"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="174"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="214"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="336"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="177"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="217"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="342"/>
<source>Drainage</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="192"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="151"/>
<source>Please make sure the holder is only contain water!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="151"/>
<source>Confirm Scan</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="195"/>
<source>No refresh data exists, please do Refresh operation first.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="178"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="207"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="336"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="181"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="210"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="342"/>
<source>Drainaging</source>
<translation type="unfinished"></translation>
</message>
@@ -1629,33 +1639,33 @@
</message>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="134"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="328"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="334"/>
<source>Preview</source>
<translation></translation>
</message>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="135"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="329"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="335"/>
<source>Stop</source>
<translation></translation>
</message>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="136"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="330"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="336"/>
<source>Scan</source>
<translation></translation>
</message>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="101"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="332"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="338"/>
<source>Preview Parameters</source>
<translation></translation>
</message>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="106"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="116"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="334"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="335"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="340"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="341"/>
<source>some settings
parameters
@@ -1664,7 +1674,7 @@ parameters
</message>
<message>
<location filename="../forms/scan/ScanFormWidget.cpp" line="111"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="333"/>
<location filename="../forms/scan/ScanFormWidget.cpp" line="339"/>
<source>Scan Parameters</source>
<translation></translation>
</message>
@@ -1756,24 +1766,24 @@ parameters
<context>
<name>SelectFormWidget</name>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="87"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="290"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="91"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="294"/>
<source>Account</source>
<translation></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="114"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="118"/>
<source>Worklist</source>
<translation>()</translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="112"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="292"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="116"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="296"/>
<source>Add</source>
<translation>()</translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="293"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="297"/>
<source>Edit</source>
<translation></translation>
</message>
@@ -1782,84 +1792,84 @@ parameters
<translation type="vanished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="113"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="117"/>
<source>Select</source>
<translation></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="90"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="94"/>
<source>ShutDown</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="96"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="100"/>
<source>Shut down now ?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="96"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="100"/>
<source>Shut Down</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="149"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="153"/>
<source>Can&apos;t delete selected Patient !</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="149"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="170"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="153"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="174"/>
<source>Alert</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="154"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="158"/>
<source>Delete Patient &quot;%1&quot; ?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="154"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="158"/>
<source>Confirm</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="170"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="174"/>
<source>Can&apos;t delete selected Patient , db submit error!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="263"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="283"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="267"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="287"/>
<source>AccessionNumber</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="264"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="284"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="268"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="288"/>
<source>Name</source>
<translation></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="265"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="285"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="269"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="289"/>
<source>Birth Date</source>
<translation></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="266"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="286"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="270"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="290"/>
<source>Gender</source>
<translation></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="267"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="287"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="271"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="291"/>
<source>Add Date</source>
<translation></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="268"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="288"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="272"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="292"/>
<source>Comment</source>
<translation></translation>
</message>
@@ -1953,22 +1963,22 @@ parameters
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/settings/SystemSettingForm.cpp" line="162"/>
<location filename="../forms/settings/SystemSettingForm.cpp" line="163"/>
<source>used: %1G</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/settings/SystemSettingForm.cpp" line="166"/>
<location filename="../forms/settings/SystemSettingForm.cpp" line="167"/>
<source>Get disk used size fail!</source>
<translation type="unfinished">使</translation>
</message>
<message>
<location filename="../forms/settings/SystemSettingForm.cpp" line="179"/>
<location filename="../forms/settings/SystemSettingForm.cpp" line="180"/>
<source>total: %1G</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/settings/SystemSettingForm.cpp" line="183"/>
<location filename="../forms/settings/SystemSettingForm.cpp" line="184"/>
<source>Get disk total size fail!</source>
<translation type="unfinished"></translation>
</message>