Enable Scan confirm setting.
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
#include "appvals/AppGlobalValues.h"
|
#include "appvals/AppGlobalValues.h"
|
||||||
#include "json/ScanJson.h"
|
#include "json/ScanJson.h"
|
||||||
|
#include "json/jsonobject.h"
|
||||||
#define TRIGGER_EVENT EventCenter::Default()->triggerEvent
|
#define TRIGGER_EVENT EventCenter::Default()->triggerEvent
|
||||||
|
|
||||||
#define THROW_ERROR(errormsg)\
|
#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) {
|
void DeviceManager::timerEvent(QTimerEvent* event) {
|
||||||
if (event->timerId() == deviceInfTimerID) {
|
if (event->timerId() == deviceInfTimerID) {
|
||||||
@@ -218,7 +223,7 @@ void DeviceManager::timerEvent(QTimerEvent* event) {
|
|||||||
int phase = inf.progress/100 + 1;
|
int phase = inf.progress/100 + 1;
|
||||||
int progress = inf.progress % 100;
|
int progress = inf.progress % 100;
|
||||||
QString extraMsg = (AppGlobalValues::EmptyScanFlag().toBool()||(scanPhase != 3))?"":", patient can leave";
|
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);
|
TRIGGER_EVENT(GUIEvents::InvokeOperationProgress, nullptr, (QObject *) &var);
|
||||||
if (scanPhase != phase) {
|
if (scanPhase != phase) {
|
||||||
if (phase > 3 || scanPhase > phase ){
|
if (phase > 3 || scanPhase > phase ){
|
||||||
@@ -228,8 +233,8 @@ void DeviceManager::timerEvent(QTimerEvent* event) {
|
|||||||
}
|
}
|
||||||
scanPhase = phase;
|
scanPhase = phase;
|
||||||
if (scanPhase == 2){
|
if (scanPhase == 2){
|
||||||
if (!AppGlobalValues::EmptyScanFlag().toBool()) {
|
if (!AppGlobalValues::EmptyScanFlag().toBool() && JsonObject::Instance()->getScanConfirm()) {
|
||||||
var.setValue(QString("Scan phase 2 waiting for patient!\r\n Click \"Next\" to continue!"));
|
var.setValue(QString("Waiting for patient to start scan!\r\n Click \"Next\" to continue!"));
|
||||||
TRIGGER_EVENT(GUIEvents::InvokeOperationPending, nullptr, (QObject *) &var);
|
TRIGGER_EVENT(GUIEvents::InvokeOperationPending, nullptr, (QObject *) &var);
|
||||||
goto exitTimer;
|
goto exitTimer;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user