In processing state logic
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
|
#include <src/appvals/AppGlobalValues.h>
|
||||||
|
|
||||||
#define TRIGGER_EVENT EventCenter::Default()->triggerEvent
|
#define TRIGGER_EVENT EventCenter::Default()->triggerEvent
|
||||||
|
|
||||||
@@ -90,6 +91,7 @@ void DeviceManager::initDevice() {
|
|||||||
// THROW_ERROR(msg);
|
// THROW_ERROR(msg);
|
||||||
// return;
|
// return;
|
||||||
// };
|
// };
|
||||||
|
AppGlobalValues::setInProcessing(true);
|
||||||
TRIGGER_EVENT(GUIEvents::InvokeOperationStart, nullptr, nullptr);
|
TRIGGER_EVENT(GUIEvents::InvokeOperationStart, nullptr, nullptr);
|
||||||
//ScanControl fail
|
//ScanControl fail
|
||||||
qDebug() << "Request stop!";
|
qDebug() << "Request stop!";
|
||||||
@@ -113,6 +115,7 @@ void DeviceManager::initDevice() {
|
|||||||
TRIGGER_EVENT(GUIEvents::GlobalBannerMessage, nullptr, (QObject *) &s);
|
TRIGGER_EVENT(GUIEvents::GlobalBannerMessage, nullptr, (QObject *) &s);
|
||||||
TRIGGER_EVENT(GUIEvents::InvokeOperationEnd, nullptr, nullptr);
|
TRIGGER_EVENT(GUIEvents::InvokeOperationEnd, nullptr, nullptr);
|
||||||
TRIGGER_EVENT(GUIEvents::ResponseStop, nullptr, nullptr);
|
TRIGGER_EVENT(GUIEvents::ResponseStop, nullptr, nullptr);
|
||||||
|
AppGlobalValues::setInProcessing(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
// preview
|
// preview
|
||||||
@@ -123,6 +126,7 @@ void DeviceManager::initDevice() {
|
|||||||
qDebug() << "PreviewScan request status, status:" << getStatusString(inf.status);
|
qDebug() << "PreviewScan request status, status:" << getStatusString(inf.status);
|
||||||
if (inf.status==READY)
|
if (inf.status==READY)
|
||||||
{
|
{
|
||||||
|
AppGlobalValues::setInProcessing(true);
|
||||||
TRIGGER_EVENT(GUIEvents::InvokeOperationStart, nullptr, nullptr);
|
TRIGGER_EVENT(GUIEvents::InvokeOperationStart, nullptr, nullptr);
|
||||||
//ScanControl
|
//ScanControl
|
||||||
qDebug()<<"Request preview!";
|
qDebug()<<"Request preview!";
|
||||||
@@ -217,7 +221,9 @@ void DeviceManager::timerEvent(QTimerEvent *event) {
|
|||||||
qDebug() << "Scan finished";
|
qDebug() << "Scan finished";
|
||||||
QVariant var(true);
|
QVariant var(true);
|
||||||
qDebug() << "InvokeOperationEnd";
|
qDebug() << "InvokeOperationEnd";
|
||||||
|
|
||||||
TRIGGER_EVENT(GUIEvents::InvokeOperationEnd, nullptr, (QObject *) &var);
|
TRIGGER_EVENT(GUIEvents::InvokeOperationEnd, nullptr, (QObject *) &var);
|
||||||
|
AppGlobalValues::setInProcessing(false);
|
||||||
lastStatus = -1;
|
lastStatus = -1;
|
||||||
previewing = false;
|
previewing = false;
|
||||||
QString s("%1 %2");
|
QString s("%1 %2");
|
||||||
@@ -258,6 +264,7 @@ void DeviceManager::processScan(const char *json, bool empty) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
static QString msg = "Start scan...";
|
static QString msg = "Start scan...";
|
||||||
|
AppGlobalValues::setInProcessing(true);
|
||||||
TRIGGER_EVENT(GUIEvents::InvokeOperationStart, nullptr, (QObject *) &msg);
|
TRIGGER_EVENT(GUIEvents::InvokeOperationStart, nullptr, (QObject *) &msg);
|
||||||
qDebug() << "SetScanInfo>>>>>>>>>>>>>>>>>>>>";
|
qDebug() << "SetScanInfo>>>>>>>>>>>>>>>>>>>>";
|
||||||
int ret = SetScanInfo(json, empty ? 1 : 0);
|
int ret = SetScanInfo(json, empty ? 1 : 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user