double check state for stop

This commit is contained in:
krad
2022-02-25 15:59:22 +08:00
committed by Krad
parent 50738a31b8
commit 7c8e4ffea8

View File

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