double check state for stop

This commit is contained in:
krad
2022-02-25 15:59:22 +08:00
parent e62b1fbe66
commit aae9d8da2f

View File

@@ -84,9 +84,14 @@ void DeviceManager::initDevice() {
// check device status=========================================
//device is ready return
if (inf.status != SCANNING) {
//double check
QThread::msleep(100);
inf = GetStatus();
if (inf.status != SCANNING){
TRIGGER_EVENT(GUIEvents::ResponseStop, nullptr, nullptr);
return;
}
}
// if (inf.status == BUSY) {
// QString msg("Device is busy, Stop operation fail!");
@@ -293,7 +298,7 @@ void DeviceManager::processScan(const char* json, bool empty) {
lastStatus = SCANNING;
previewing = false;
qDebug() << "Start progress timer";
timerID = startTimer(300);
timerID = startTimer(500);
return;
}
QString errmsg("ScanControl start fail!");