diff --git a/hgdriver/hgdev/hg_scanner_239.cpp b/hgdriver/hgdev/hg_scanner_239.cpp index 868ee89..1553404 100644 --- a/hgdriver/hgdev/hg_scanner_239.cpp +++ b/hgdriver/hgdev/hg_scanner_239.cpp @@ -1442,15 +1442,21 @@ void hg_scanner_239::thread_get_dves_image(void) if (!svdevs_err_.empty()) { status_ = svdevs_err_.front(); + svdevs_err_.clear(); } LOG_INFO(LOG_LEVEL_DEBUG_INFO, "received 'STOPSCAN' message in usb thread, check remaining image and finish scanning ...\n"); // fetch all buffered images and exit ... //while(!is_dev_image_process_done()) - if (img_conf_.resolution_dst > 200 && is_quality_ == IMG_QUALITY && pid_ != 0x439) //鍒犻櫎杩欐浠g爜锛屼綘鍙兘闇€瑕佽€冭檻涓€涓嬪悗鏋? - std::this_thread::sleep_for(std::chrono::milliseconds(5000)); - else - std::this_thread::sleep_for(std::chrono::milliseconds(500)); + //普世 + if (pid_ != 0x439) + { + if (img_conf_.resolution_dst > 200 && is_quality_ == IMG_QUALITY) //鍒犻櫎杩欐浠g爜锛屼綘鍙兘闇€瑕佽€冭檻涓€涓嬪悗鏋? + std::this_thread::sleep_for(std::chrono::milliseconds(5000)); + else + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + } + int rest = 0; while (get_image_count() > 0) @@ -1481,14 +1487,6 @@ void hg_scanner_239::thread_get_dves_image(void) } if (count == 0) { - //std::lock_guard lock(io_lock_); - - //LOG_INFO(LOG_LEVEL_DEBUG_INFO, "First message received from USB is 'STOPSCAN'\n"); - // notify_ui_working_status(STATU_DESC_DEVICE_RESET); - // reset_ = true; - // ret = io_->reset(); - // status_ = SCANNER_ERR_IO; - if (status_ == SCANNER_ERR_DEVICE_STOPPED) status_ = SCANNER_ERR_OK; } @@ -1497,7 +1495,7 @@ void hg_scanner_239::thread_get_dves_image(void) int s = get_status(); - if (count == 0 || (s & 3) == 0) + if ((count == 0 || (s & 3) == 0) || pid_ == 0x439) { LOG_INFO(LOG_LEVEL_DEBUG_INFO, "Really stopped ^_^\n");