Enable Scan confirm setting.

This commit is contained in:
Krad
2022-05-13 17:58:48 +08:00
parent d268d48bc2
commit 60fa56cc18

View File

@@ -11,6 +11,7 @@
#include <qdebug.h>
#include "appvals/AppGlobalValues.h"
#include "json/ScanJson.h"
#include "json/jsonobject.h"
#define TRIGGER_EVENT EventCenter::Default()->triggerEvent
#define THROW_ERROR(errormsg)\
@@ -183,6 +184,10 @@ void DeviceManager::initDevice() {
}
const char * getPhaseName(int phase){
const char* names[3] = {"Initializing","Scanning", "CE Measuring"};
return names[phase-1];
}
void DeviceManager::timerEvent(QTimerEvent* event) {
if (event->timerId() == deviceInfTimerID) {
@@ -218,7 +223,7 @@ void DeviceManager::timerEvent(QTimerEvent* event) {
int phase = inf.progress/100 + 1;
int progress = inf.progress % 100;
QString extraMsg = (AppGlobalValues::EmptyScanFlag().toBool()||(scanPhase != 3))?"":", patient can leave";
QVariant var(QString("Phase %1%3\r\n progress:%2%").arg(scanPhase).arg(progress).arg(extraMsg));
QVariant var(QString("%1%3\r\n progress:%2%").arg(getPhaseName(scanPhase)).arg(progress).arg(extraMsg));
TRIGGER_EVENT(GUIEvents::InvokeOperationProgress, nullptr, (QObject *) &var);
if (scanPhase != phase) {
if (phase > 3 || scanPhase > phase ){
@@ -228,8 +233,8 @@ void DeviceManager::timerEvent(QTimerEvent* event) {
}
scanPhase = phase;
if (scanPhase == 2){
if (!AppGlobalValues::EmptyScanFlag().toBool()) {
var.setValue(QString("Scan phase 2 waiting for patient!\r\n Click \"Next\" to continue!"));
if (!AppGlobalValues::EmptyScanFlag().toBool() && JsonObject::Instance()->getScanConfirm()) {
var.setValue(QString("Waiting for patient to start scan!\r\n Click \"Next\" to continue!"));
TRIGGER_EVENT(GUIEvents::InvokeOperationPending, nullptr, (QObject *) &var);
goto exitTimer;
}