Preview error handle.7

This commit is contained in:
Krad
2022-06-02 16:32:01 +08:00
parent a44f4b7263
commit 4ee8aa0f17

View File

@@ -43,7 +43,7 @@ void ErrorCallback(const char* msg)
}
void DeviceManager::emitErrorCallback(const char *msg) {
this->setErrorOccurred(true);
errorOccurred=true;
printf("Error Callback , message:%s\r\n", msg);
QString m(msg);
emit raiseGlobalError( m);
@@ -132,7 +132,7 @@ void DeviceManager::initDevice() {
if (!ScanControl(PREVIEW_SCAN))
{
qDebug() << "Preview success!";
lastStatus = SCANNING;
// lastStatus = SCANNING;
previewing = true;
// timerID = startTimer(500);
TRIGGER_EVENT(GUIEvents::ResponsePreview, nullptr, nullptr);
@@ -180,7 +180,7 @@ void DeviceManager::initDevice() {
qDebug() << "Preview data response event end!";
}
else{
lastStatus = READY;
// lastStatus = READY;
previewing = false;
AppGlobalValues::setInProcessing(false);
QThread::sleep(3);
@@ -226,7 +226,7 @@ void DeviceManager::timerEvent(QTimerEvent* event) {
return;
} else {
//未发生错误并且,之前状态是扫描,代表正常扫描完成
if (lastStatus == SCANNING ) {
if (lastStatus == SCANNING && ! errorOccurred) {
prepareFinishScan();
}
//一般不会出现其他情况