From 0d2f75d0706f5bb72b284861698c9d6ef3e16234 Mon Sep 17 00:00:00 2001 From: 13038267101 Date: Mon, 27 Nov 2023 16:53:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=99=AE=E4=B8=96=20?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E9=80=80=E5=87=BA=20=E7=AD=89=E5=BE=85?= =?UTF-8?q?=E5=A4=AA=E4=B9=85=E7=9A=84=E6=97=B6=E9=97=B4=200439=E8=AE=BE?= =?UTF-8?q?=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/hg_scanner_239.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) 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");