Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55a579ea50 | ||
|
|
6e8d198a7a | ||
|
|
d047b77907 | ||
|
|
cfc18ed05e | ||
|
|
614aca056e | ||
|
|
f9825023ad |
@@ -7,7 +7,6 @@
|
||||
#include <QVariant>
|
||||
#include <QTimerEvent>
|
||||
#include <QDate>
|
||||
#include <QDateTime>
|
||||
#include <qdebug.h>
|
||||
#include "appvals/AppGlobalValues.h"
|
||||
#include "json/ScanJson.h"
|
||||
@@ -241,13 +240,15 @@ void DeviceManager::scanProcess(int sProgress) {
|
||||
(scanPhase != 3)) ? "": ", patient can leave";
|
||||
QVariant var(QString("%1%3\r\n progress:%2%").arg(getPhaseName(scanPhase)).arg(progress).arg(extraMsg));
|
||||
TRIGGER_EVENT(InvokeOperationProgress, nullptr, (QObject *) &var);
|
||||
// 300 means finished
|
||||
if (sProgress == 300) return;
|
||||
//phase control
|
||||
//no change return
|
||||
if (scanPhase == phase) return;
|
||||
// error phase
|
||||
if (phase > 3 || scanPhase > phase) {
|
||||
QString errorMsg = QString("Error Scan Phase code, current Phase code:%1, new Phase code:%2!").arg(
|
||||
scanPhase, phase);
|
||||
scanPhase).arg(phase);
|
||||
THROW_ERROR(errorMsg)
|
||||
exitScanTimer();
|
||||
return;
|
||||
@@ -255,7 +256,7 @@ void DeviceManager::scanProcess(int sProgress) {
|
||||
// enter phase 2
|
||||
if ((scanPhase = phase) == 2) {
|
||||
if (!AppGlobalValues::EmptyScanFlag().toBool() && JsonObject::Instance()->getScanConfirm()) {
|
||||
var.setValue(QString("Waiting for patient to start scan!\r\n Click \"Next\" to continue!"));
|
||||
var.setValue(QString("Waiting for operator to start scan!\r\n Click \"Next\" to continue!"));
|
||||
TRIGGER_EVENT(InvokeOperationPending, nullptr, (QObject *) &var);
|
||||
exitScanTimer();
|
||||
}
|
||||
|
||||
@@ -15,6 +15,10 @@ public:
|
||||
static DeviceManager manager;
|
||||
return &manager;
|
||||
}
|
||||
DeviceManager() = default;
|
||||
~DeviceManager() override = default ;
|
||||
DeviceManager(const DeviceManager&) = delete;
|
||||
DeviceManager operator=(const DeviceManager&) = delete;
|
||||
/**
|
||||
* init device, include Shimlib and it's error call back,
|
||||
* deviceInfTimer to get temperature of water, and the
|
||||
@@ -94,7 +98,7 @@ private:
|
||||
bool previewing = false;
|
||||
volatile bool endLoop = false;
|
||||
bool errorOccurred = false;
|
||||
QThread* previewDataCaller;
|
||||
QThread* previewDataCaller = nullptr;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ void ScanJson::save() {
|
||||
}
|
||||
QFile f(QString("%1/jsons/%2.json").arg(QCoreApplication::applicationDirPath(),scanID.c_str()));
|
||||
f.open(QFileDevice::ReadWrite);
|
||||
cJSON_AddItemToObject(root, "EmptyScanID", cJSON_CreateString(emptyScanID.c_str()));
|
||||
cJSON_AddItemToObject(root, "EmptyScanID",
|
||||
cJSON_CreateString(emptyScanID.empty()?JsonObject::Instance()->getEmptyScanID():emptyScanID.c_str()));
|
||||
cJSON_AddItemToObject(root, "ScanID", cJSON_CreateString(scanID.c_str()));
|
||||
char* content = cJSON_Print(root);
|
||||
f.write(content);
|
||||
|
||||
@@ -81,7 +81,7 @@ void JsonObject::setBool(const char *catergory, const char *stringName, bool val
|
||||
bool JsonObject::getBool(const char* catergory, const char* stringName)
|
||||
{
|
||||
if (!loadcfg())
|
||||
return nullptr;
|
||||
return false;
|
||||
|
||||
cJSON* first = cJSON_GetObjectItem((cJSON*)json_root, catergory);
|
||||
if (!first) return false;
|
||||
|
||||
@@ -111,7 +111,7 @@ private:
|
||||
char* getJsonString(const char* catergory, const char* stringName);
|
||||
|
||||
void setBool(const char* catergory, const char* stringName,bool val, bool save = true);
|
||||
bool JsonObject::getBool(const char* catergory, const char* stringName);
|
||||
bool getBool(const char* catergory, const char* stringName);
|
||||
|
||||
char* getArrayNode(const char* catergory, const char* stringName, int index, const char* id);
|
||||
void setArrayNode(const char* catergory, const char* stringName, int index, const char* id, const char* stringValue);
|
||||
|
||||
Reference in New Issue
Block a user