Add stop drainage automatically after 30 seconds.
This commit is contained in:
@@ -138,6 +138,10 @@ void DeviceManager::initDevice()
|
|||||||
mShutDownAction->setTimeoutInterval(SHUT_DOWN_TIMEOUT);
|
mShutDownAction->setTimeoutInterval(SHUT_DOWN_TIMEOUT);
|
||||||
mPumpControlAction = new DmsAsyncAction(USRV_CONTROL, ACT_CTL_PUMP, this, "responsePumpControl(const QString&)", this);
|
mPumpControlAction = new DmsAsyncAction(USRV_CONTROL, ACT_CTL_PUMP, this, "responsePumpControl(const QString&)", this);
|
||||||
mPumpControlAction->setTimeoutInterval(PUMP_TIMEOUT);
|
mPumpControlAction->setTimeoutInterval(PUMP_TIMEOUT);
|
||||||
|
connect(mPumpControlAction, &DmsAsyncAction::timeout, this, [this]()
|
||||||
|
{
|
||||||
|
this->processPumpResult("{\"code\":-1}");
|
||||||
|
});
|
||||||
connect(mGetScanProgressAction, &DmsAsyncAction::timeout, this, &DeviceManager::scanTimeout);
|
connect(mGetScanProgressAction, &DmsAsyncAction::timeout, this, &DeviceManager::scanTimeout);
|
||||||
connect(mShutDownAction, &DmsAsyncAction::timeout, this, &DeviceManager::shutdownDmsFailed);
|
connect(mShutDownAction, &DmsAsyncAction::timeout, this, &DeviceManager::shutdownDmsFailed);
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include <QButtonGroup>
|
#include <QButtonGroup>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QTimer>
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
|
|
||||||
#include "forms/scan/PatientInformationForm.h"
|
#include "forms/scan/PatientInformationForm.h"
|
||||||
@@ -29,6 +30,7 @@ namespace{
|
|||||||
const size_t PREVIEW_COL = 140;
|
const size_t PREVIEW_COL = 140;
|
||||||
const float PIXEL_SPACING = 1.5f;
|
const float PIXEL_SPACING = 1.5f;
|
||||||
const float HALF_ROI_WIDTH = 100.0f;
|
const float HALF_ROI_WIDTH = 100.0f;
|
||||||
|
const unsigned int DRAINAGE_TIME = 30000;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScanFormWidget::ScanFormWidget(QWidget* parent)
|
ScanFormWidget::ScanFormWidget(QWidget* parent)
|
||||||
@@ -47,6 +49,7 @@ ScanFormWidget::ScanFormWidget(QWidget* parent)
|
|||||||
, mLblE(new QLabel(this))
|
, mLblE(new QLabel(this))
|
||||||
, mLblParams(new QLabel(this))
|
, mLblParams(new QLabel(this))
|
||||||
, mLblE2(new QLabel(this))
|
, mLblE2(new QLabel(this))
|
||||||
|
, mDrainageTimer(new QTimer(this))
|
||||||
{
|
{
|
||||||
|
|
||||||
auto layout = new QHBoxLayout(ui->commandWidget);
|
auto layout = new QHBoxLayout(ui->commandWidget);
|
||||||
@@ -56,7 +59,11 @@ ScanFormWidget::ScanFormWidget(QWidget* parent)
|
|||||||
initScanControlBar(layout);
|
initScanControlBar(layout);
|
||||||
initScanContent();
|
initScanContent();
|
||||||
initEvents();
|
initEvents();
|
||||||
|
mDrainageTimer->setSingleShot(true);
|
||||||
|
connect(mDrainageTimer, &QTimer::timeout, this, [this]()
|
||||||
|
{
|
||||||
|
mBtnDrainage->click();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScanFormWidget::initProtocolUI(QHBoxLayout *layout) {
|
void ScanFormWidget::initProtocolUI(QHBoxLayout *layout) {
|
||||||
@@ -171,6 +178,7 @@ void ScanFormWidget::initScanControlBar(QHBoxLayout *layout){
|
|||||||
mBtnDrainage->setEnabled(true);
|
mBtnDrainage->setEnabled(true);
|
||||||
if(!aIsSucessful)
|
if(!aIsSucessful)
|
||||||
{
|
{
|
||||||
|
mDrainageTimer->stop();
|
||||||
bool isChecked = mBtnDrainage->isChecked();
|
bool isChecked = mBtnDrainage->isChecked();
|
||||||
mBtnDrainage->setChecked(!isChecked);
|
mBtnDrainage->setChecked(!isChecked);
|
||||||
if(isChecked)
|
if(isChecked)
|
||||||
@@ -213,6 +221,7 @@ void ScanFormWidget::initScanControlBar(QHBoxLayout *layout){
|
|||||||
mBtnDrainage->setEnabled(false);
|
mBtnDrainage->setEnabled(false);
|
||||||
if(aSatus == true)
|
if(aSatus == true)
|
||||||
{
|
{
|
||||||
|
mDrainageTimer->start(DRAINAGE_TIME);
|
||||||
QString code = "1";
|
QString code = "1";
|
||||||
mBtnDrainage->setText(tr("Drainaging"));
|
mBtnDrainage->setText(tr("Drainaging"));
|
||||||
EventCenter::Default()->triggerEvent(RequestDrainage, nullptr, (QObject*)(&code));
|
EventCenter::Default()->triggerEvent(RequestDrainage, nullptr, (QObject*)(&code));
|
||||||
@@ -220,6 +229,7 @@ void ScanFormWidget::initScanControlBar(QHBoxLayout *layout){
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
mDrainageTimer->stop();
|
||||||
QString code = "0";
|
QString code = "0";
|
||||||
mBtnDrainage->setText(tr("Drainage"));
|
mBtnDrainage->setText(tr("Drainage"));
|
||||||
EventCenter::Default()->triggerEvent(RequestDrainage, nullptr, (QObject*)(&code));
|
EventCenter::Default()->triggerEvent(RequestDrainage, nullptr, (QObject*)(&code));
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ private:
|
|||||||
QLabel* mLblE;
|
QLabel* mLblE;
|
||||||
QLabel* mLblParams;
|
QLabel* mLblParams;
|
||||||
QLabel* mLblE2;
|
QLabel* mLblE2;
|
||||||
|
QTimer* mDrainageTimer;
|
||||||
void initProtocolUI(QHBoxLayout *layout);
|
void initProtocolUI(QHBoxLayout *layout);
|
||||||
void initScanControlBar(QHBoxLayout *layout);
|
void initScanControlBar(QHBoxLayout *layout);
|
||||||
void initScanContent();
|
void initScanContent();
|
||||||
|
|||||||
Reference in New Issue
Block a user