feat: Add loading after stop scan action.

This commit is contained in:
sunwen
2024-10-29 13:57:29 +08:00
parent 2e92378b44
commit 0ae12bece8
8 changed files with 189 additions and 57 deletions

View File

@@ -24,6 +24,7 @@
#include "dialogs/StartScanProcessDialog.h"
#include "dialogs/CEchoTestDialog.h"
#include "dialogs/WorklistLoadingDialog.h"
#include "dialogs/StopScanLoadingDialog.h"
#include "network/DicomCfgDialog.h"
#include "network/GetAdminPsw.h"
@@ -483,6 +484,14 @@ void DialogManager::requestLoadingWorklist()
mWorklistLoadingDialog->exec();
}
void DialogManager::requestStopScanLoadingDialog()
{
StopScanLoadingDialog dialog(mTopWidget);
setTopWidget(&dialog);
dialog.exec();
releaseTopWidget(&dialog);
}
void DialogManager::raiseDeviceInfo(QObject* parent, QObject* aInfoData)
{
QPair<QString, unsigned int>* infoData = (QPair<QString, unsigned int>*)(aInfoData);

View File

@@ -88,6 +88,7 @@ public:
void invokeOperationEnd(QObject* parent, QObject* msg);
void setFocusToTopDialog();
void requestLoadingWorklist();
void requestStopScanLoadingDialog();
void requestEmergencyButtonPushed(bool aIsLeftButton, bool aIsRest);
private:

View File

@@ -3,9 +3,11 @@
#include <QHBoxLayout>
#include <QToolButton>
#include <QTimer>
#include "event/EventCenter.h"
#include "log/LogManager.h"
#include "dialogs/DialogManager.h"
GUIMessageDialog::GUIMessageDialog(QWidget *parent)
: QDialog(parent)
@@ -118,6 +120,7 @@ void GUIMessageDialog::startLoading() {
accept();
LOG_USER_OPERATION("Stop Scan");
EventCenter::Default()->triggerEvent(GUIEvents::RequestFullScanStop, nullptr, nullptr);
DialogManager::Default()->requestStopScanLoadingDialog();
});
connect(mConfirmCancleButton, &QToolButton::clicked, [=]()

View File

@@ -0,0 +1,58 @@
#include "StopScanLoadingDialog.h"
#include <QVBoxLayout>
#include <QTimer>
#include <QLabel>
#include <QSpacerItem>
#include "components/LoadingWidget.h"
namespace
{
const int LOADING_TIME = 3000;
}
StopScanLoadingDialog::StopScanLoadingDialog(QWidget* aParent, Qt::WindowFlags aFlag)
: GUIFormBaseDialog (aParent, aFlag)
, mLoadingWidget(new LoadingWidget(mFormWidget))
, mTimer(new QTimer(this))
{
setFixedWidth(580);
QVBoxLayout* layout = new QVBoxLayout(mFormWidget);
layout->setSpacing(20);
setWindowFlags (Qt :: FramelessWindowHint | Qt :: Dialog);
mFormWidget->setObjectName("StopScanLoading");
mFormWidget->setFixedSize(560,320);
QLabel* loadingMessage = new QLabel(tr("Device is Stopping"), mFormWidget);
loadingMessage->setAlignment(Qt::AlignCenter);
layout->addWidget(loadingMessage);
mLoadingWidget->setColor("#0078d8");
mLoadingWidget->setFixedHeight(48);
mLoadingWidget->setMaxDiameter(10);
mLoadingWidget->setMinDiameter(2);
mLoadingWidget->setCount(8);
layout->addWidget(mLoadingWidget);
layout->addItem(new QSpacerItem(20, 80, QSizePolicy::Fixed));
mLoadingWidget->setAttribute(Qt::WA_TranslucentBackground);
setAttribute(Qt::WA_TranslucentBackground);
mBtnWidget->hide();
setButtonMode(DialogButtonMode::None);
mTimer->setSingleShot(true);
connect(mTimer, &QTimer::timeout, this, &QDialog::accept);
}
StopScanLoadingDialog::~StopScanLoadingDialog()
{
}
void StopScanLoadingDialog::showEvent(QShowEvent *aEvent)
{
mTimer->start(LOADING_TIME);
GUIFormBaseDialog::showEvent(aEvent);
}

View File

@@ -0,0 +1,25 @@
#ifndef STOPSCANLOADINGDIALOG_H
#define STOPSCANLOADINGDIALOG_H
#include "GUIFormBaseDialog.h"
class LoadingWidget;
class QTimer;
class StopScanLoadingDialog : public GUIFormBaseDialog
{
Q_OBJECT
public:
StopScanLoadingDialog(QWidget* aParent = nullptr, Qt::WindowFlags aFlag = Qt::WindowFlags());
~StopScanLoadingDialog() override;
protected:
void showEvent(QShowEvent *aEvent) override;
private:
LoadingWidget* mLoadingWidget;
QTimer* mTimer;
};
#endif // STOPSCANLOADINGDIALOG_H

View File

@@ -1248,6 +1248,27 @@ QWidget#formWidget QLabel#CEchoMessage{
font-size: 24px;
}
QWidget#StopScanLoading {
background: qlineargradient(x1:0,
y1: 0,
x2: 0,
y2: 1,
stop: 0.0 darkgray,
stop: 0.5 lightgray,
stop: 1.0 darkgray);
border-radius: 20px;
border: 5px solid #0078d8;
}
QWidget#StopScanLoading QLabel
{
font-size: 30px;
font-weight: Bold;
color: #3078d8;
}

View File

@@ -1864,6 +1864,13 @@ The emergency button has been pushed. Please reset it before other operations.</
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StopScanLoadingDialog</name>
<message>
<source>Device is Stopping</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SystemCorrectionForm</name>
<message>

View File

@@ -97,7 +97,7 @@
<context>
<name>AccessionInformation</name>
<message>
<location filename="../forms/select/AccessionInformation.cpp" line="42"/>
<location filename="../forms/select/AccessionInformation.cpp" line="45"/>
<source>Position</source>
<translation type="unfinished"></translation>
</message>
@@ -471,7 +471,7 @@
<location filename="../device/DeviceManager.cpp" line="170"/>
<location filename="../device/DeviceManager.cpp" line="835"/>
<location filename="../device/DeviceManager.cpp" line="843"/>
<location filename="../device/DeviceManager.cpp" line="1463"/>
<location filename="../device/DeviceManager.cpp" line="1471"/>
<source>DMS connection error</source>
<translation type="unfinished">DMS失去连接</translation>
</message>
@@ -503,7 +503,7 @@ progress:99%</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="230"/>
<location filename="../device/DeviceManager.cpp" line="226"/>
<source>Fail to connect to DB!Reboot device to try!</source>
<translation type="unfinished">!</translation>
</message>
@@ -560,56 +560,56 @@ After lying down, click the confirm buttonto start scanning on the next side.</s
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="1037"/>
<location filename="../device/DeviceManager.cpp" line="1047"/>
<location filename="../device/DeviceManager.cpp" line="1123"/>
<location filename="../device/DeviceManager.cpp" line="1045"/>
<location filename="../device/DeviceManager.cpp" line="1055"/>
<location filename="../device/DeviceManager.cpp" line="1131"/>
<source>Scan data transfer failed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="1101"/>
<location filename="../device/DeviceManager.cpp" line="1109"/>
<source>Scan data transfer Succeeded!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="1145"/>
<location filename="../device/DeviceManager.cpp" line="1153"/>
<source>Create empty scan data failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="1168"/>
<location filename="../device/DeviceManager.cpp" line="1176"/>
<source>Create scan data failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="1235"/>
<location filename="../device/DeviceManager.cpp" line="1243"/>
<source>Recon disconnected.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="1312"/>
<location filename="../device/DeviceManager.cpp" line="1327"/>
<location filename="../device/DeviceManager.cpp" line="1320"/>
<location filename="../device/DeviceManager.cpp" line="1335"/>
<source>Open pump failed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="1344"/>
<location filename="../device/DeviceManager.cpp" line="1352"/>
<source>Recon error, can&apos;t start scan process</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="1385"/>
<location filename="../device/DeviceManager.cpp" line="1437"/>
<location filename="../device/DeviceManager.cpp" line="1393"/>
<location filename="../device/DeviceManager.cpp" line="1445"/>
<source>Start auto locate failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="1457"/>
<location filename="../device/DeviceManager.cpp" line="1465"/>
<source>The data quality is low, please restart the data scan.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/DeviceManager.cpp" line="1485"/>
<location filename="../device/DeviceManager.cpp" line="1493"/>
<source>Device reset failed, please contact maintenance person</source>
<translation type="unfinished"></translation>
</message>
@@ -629,12 +629,12 @@ After lying down, click the confirm buttonto start scanning on the next side.</s
<translation type="obsolete">7</translation>
</message>
<message>
<location filename="../dialogs/DialogManager.cpp" line="672"/>
<location filename="../dialogs/DialogManager.cpp" line="681"/>
<source>The left emergency button has been pressed. Please reset left the emergency button before operating the device</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dialogs/DialogManager.cpp" line="681"/>
<location filename="../dialogs/DialogManager.cpp" line="690"/>
<source>The right emergency button has been pressed. Please reset right the emergency button before operating the device</source>
<translation type="unfinished"></translation>
</message>
@@ -847,24 +847,24 @@ After lying down, click the confirm buttonto start scanning on the next side.</s
<translation></translation>
</message>
<message>
<location filename="../dialogs/GUIMessageDialog.cpp" line="37"/>
<location filename="../dialogs/GUIMessageDialog.cpp" line="43"/>
<location filename="../dialogs/GUIMessageDialog.cpp" line="39"/>
<location filename="../dialogs/GUIMessageDialog.cpp" line="45"/>
<source>Stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dialogs/GUIMessageDialog.cpp" line="40"/>
<location filename="../dialogs/GUIMessageDialog.cpp" line="148"/>
<location filename="../dialogs/GUIMessageDialog.cpp" line="42"/>
<location filename="../dialogs/GUIMessageDialog.cpp" line="151"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dialogs/GUIMessageDialog.cpp" line="46"/>
<location filename="../dialogs/GUIMessageDialog.cpp" line="48"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../dialogs/GUIMessageDialog.cpp" line="106"/>
<location filename="../dialogs/GUIMessageDialog.cpp" line="108"/>
<source>Confirm stop the scan.
</source>
<translation type="unfinished">
@@ -2583,80 +2583,80 @@ parameters
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="92"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="381"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="391"/>
<source>Worklist</source>
<translation>线</translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="164"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="376"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="174"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="386"/>
<source>Add</source>
<translation></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="162"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="374"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="172"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="384"/>
<source>Edit</source>
<translation></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="66"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="379"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="389"/>
<source>Patient Information Manage</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="93"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="382"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="392"/>
<source>Local</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="163"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="375"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="173"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="385"/>
<source>Delete</source>
<translation></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="165"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="378"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="175"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="388"/>
<source>Pull</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="166"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="377"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="176"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="387"/>
<source>Select</source>
<translation></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="214"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="224"/>
<source>Can&apos;t delete selected Patient !</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="214"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="235"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="224"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="245"/>
<source>Alert</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="219"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="229"/>
<source>Delete Patient &quot;%1&quot; ?</source>
<translation type="unfinished">&quot;%1&quot;</translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="219"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="229"/>
<source>Confirm</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="235"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="245"/>
<source>Can&apos;t delete selected Patient , db submit error!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="333"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="343"/>
<source>ID</source>
<translation type="unfinished">ID</translation>
</message>
@@ -2665,32 +2665,32 @@ parameters
<translation type="obsolete"></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="334"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="367"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="344"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="377"/>
<source>Name</source>
<translation></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="335"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="368"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="345"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="378"/>
<source>Birth Date</source>
<translation></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="336"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="369"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="346"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="379"/>
<source>Gender</source>
<translation></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="337"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="370"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="347"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="380"/>
<source>Add Date</source>
<translation></translation>
</message>
<message>
<location filename="../forms/select/SelectFormWidget.cpp" line="338"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="371"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="348"/>
<location filename="../forms/select/SelectFormWidget.cpp" line="381"/>
<source>Comment</source>
<translation></translation>
</message>
@@ -2842,6 +2842,14 @@ parameters
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StopScanLoadingDialog</name>
<message>
<location filename="../dialogs/StopScanLoadingDialog.cpp" line="27"/>
<source>Device is Stopping</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SystemCorrectionForm</name>
<message>
@@ -3063,12 +3071,12 @@ parameters
<context>
<name>UsctStateManager</name>
<message>
<location filename="../device/UsctStateManager.cpp" line="52"/>
<location filename="../device/UsctStateManager.cpp" line="59"/>
<source>Recon fatal error.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../device/UsctStateManager.cpp" line="58"/>
<location filename="../device/UsctStateManager.cpp" line="65"/>
<source>Recon DB error.</source>
<translation type="unfinished"></translation>
</message>