feat: Add error message when emergency button pushed.
This commit is contained in:
@@ -146,6 +146,7 @@ void DeviceManager::initDevice()
|
||||
mGetAutoLocatePositionAction = new DmsAsyncAction(USRV_CONTROL, ACT_CTL_MOTION_POSITION, this, "responseGetAutoLocatePosition(const QString&)", this);
|
||||
mGetSoftwareVersionAction = new DmsAsyncAction(USRV_INFOCFG, ACT_IFCFG_VERINFO, this,"responseGetSoftwareVersion(const QString&)", this);
|
||||
mGetSoftwareVersionAction->setTimeoutInterval(GETDMSVERSION_TIMEOUT);
|
||||
mEmergencyResetAction = new DmsAsyncAction(USRV_CONTROL, ACT_CTL_EMG_RESET, this,"responseEmergencyButtonReset(const QString&)", this);
|
||||
connect(mGetSoftwareVersionAction, &DmsAsyncAction::timeout, [this]()
|
||||
{
|
||||
emit getDmsVersionResponsed("DMS Version Fetch Error");
|
||||
@@ -764,6 +765,9 @@ void DeviceManager::processReceiveDMSInfoResult(int aServerID, int aActionID, co
|
||||
emit responseGetAutoLocatePosition(aContents);
|
||||
processAutoLocatePosition(aContents);
|
||||
break;
|
||||
case ACT_CTL_EMG_RESET:
|
||||
processEmergencyButtonReset(aContents);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -779,6 +783,19 @@ void DeviceManager::processAlarm(const QString& aAlarm)
|
||||
qDebug()<<"processAlarm : "<<alarmCode;
|
||||
if(alarmCode >= 400 && alarmCode < 500)
|
||||
{
|
||||
switch (alarmCode)
|
||||
{
|
||||
case 492://left emergency button pushed
|
||||
prepareFinishScan(false,"");
|
||||
emit emergencyButtonPushed(true, false);
|
||||
return;
|
||||
case 494://right emergency button pushed
|
||||
prepareFinishScan(false,"");
|
||||
emit emergencyButtonPushed(false, false);
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(mIsScanning)
|
||||
{
|
||||
prepareFinishScan(false, alarm);
|
||||
@@ -912,7 +929,7 @@ void DeviceManager::getScanProcess()
|
||||
|
||||
void DeviceManager::shutdownDms()
|
||||
{
|
||||
if(mIsTransfering)
|
||||
if(mIsTransfering)
|
||||
{
|
||||
QString msg = tr("Data is currently being transmitted, please shut down later.");
|
||||
THROW_ERROR(msg);
|
||||
@@ -1438,3 +1455,31 @@ void DeviceManager::prepareCheckReconConnection()
|
||||
}
|
||||
emit checkReconConnection();
|
||||
}
|
||||
|
||||
void DeviceManager::processEmergencyButtonReset(const QString& aResponse)
|
||||
{
|
||||
QJsonObject jsonObj = toJsonObject(aResponse);
|
||||
int code = jsonObj["code"].toInt();
|
||||
if(code == -1)
|
||||
{
|
||||
QString errorMessage = tr("Device reset failed, please contact maintenance person");
|
||||
THROW_ERROR(errorMessage);
|
||||
}
|
||||
|
||||
if(jsonObj["info"].toString() == "left" )
|
||||
{
|
||||
emit emergencyButtonPushed(true, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if(jsonObj["info"].toString() == "right" )
|
||||
{
|
||||
emit emergencyButtonPushed(false, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void DeviceManager::prepareEmergencyReset()
|
||||
{
|
||||
mEmergencyResetAction->execute();
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ public:
|
||||
bool hasValidEmptyScan();
|
||||
bool updateTransferProgress();
|
||||
int getTransferProgress();
|
||||
void prepareEmergencyReset();
|
||||
|
||||
public slots:
|
||||
void updateReconState();
|
||||
@@ -125,6 +126,7 @@ private:
|
||||
void processShutDownDms(const QString& aResponse);
|
||||
void processPumpResult(const QString& aResponse);
|
||||
void processGetSoftwareVersion(const QString& aResponse);
|
||||
void processEmergencyButtonReset(const QString& aResponse);
|
||||
|
||||
void insertEmptyScanRecord();
|
||||
void insertScanRecord();
|
||||
@@ -167,6 +169,7 @@ signals:
|
||||
void responseStopAutoLocate(const QString& aResponse);
|
||||
void responseGetAutoLocatePosition(const QString& aResponse);
|
||||
void responseCheckDataQuality(const QString& aResponse);
|
||||
void responseEmergencyButtonReset(const QString& aResponse);
|
||||
//Recon
|
||||
void createEmptyScanToRecon(const QString& aScanID, const QString& aPath);
|
||||
void createScanToRecon(const QString& aScanID, const QString& aStudyUID,const QString& aMPPSUID, const QString& aReferenceID, const QString& aPath);
|
||||
@@ -185,6 +188,7 @@ signals:
|
||||
void shutdownDmsSended();
|
||||
void shutdownDmsFailed();
|
||||
void getDmsVersionResponsed(const QString& aDmsVersion);
|
||||
void emergencyButtonPushed(bool aIsLeft, bool aIsReset);
|
||||
|
||||
|
||||
private:
|
||||
@@ -241,6 +245,7 @@ private:
|
||||
DmsAsyncAction* mPumpControlAction = nullptr;
|
||||
DmsAsyncAction* mGetAutoLocatePositionAction = nullptr;
|
||||
DmsAsyncAction* mGetSoftwareVersionAction = nullptr;
|
||||
DmsAsyncAction* mEmergencyResetAction = nullptr;
|
||||
|
||||
InfoReceiveWorker* mInfoReceiveWorker = nullptr;
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ enum{
|
||||
ACT_CTL_MOTION_START, //启动自动定位功能
|
||||
ACT_CTL_MOTION_STOP, //停止自动定位功能
|
||||
ACT_CTL_MOTION_POSITION, //查询自动定位状态(位置)
|
||||
ACT_CTL_EMG_RESET, //复位急停按钮
|
||||
ACT_CTL_DRIVER, //驱动控制(加载卸载驱动)
|
||||
ACT_CTL_EXIT, //退出程序和守护进程
|
||||
|
||||
@@ -98,7 +99,7 @@ enum{
|
||||
//设备升级
|
||||
enum{
|
||||
ACT_FMW_NONE = 0,
|
||||
ACT_FMW_RESP, //上报升级结果
|
||||
ACT_FMW_RESP, //上报升级结果
|
||||
ACT_FMW_CFG, //固件升级配置(json格式)
|
||||
ACT_FMW_LOAD, //下载固件到设备
|
||||
ACT_FMW_START, //启动固件升级
|
||||
@@ -142,6 +143,7 @@ enum{
|
||||
ACT_DIG_PROGRESS, //进度上报
|
||||
ACT_DIG_WARNING, //报警状态上报
|
||||
ACT_DIG_MISCT, //杂类测试。
|
||||
ACT_DIG_SIMULATOR, //模拟功能配置
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user