From 4ce9daba9ec614d43c1d01cbec16d73230aad1e1 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Mon, 6 Jun 2022 18:29:09 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug-159;=20=E4=BF=AE=E6=94=B9OEM=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/hg_scanner.cpp | 20 +++++++++++++++++++- hgdriver/wrapper/hg_log.cpp | 4 ++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index c054fc0..e454207 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -92,6 +92,7 @@ hg_scanner::hg_scanner(ScannerSerial serial , fractate_level_(50), ui_ev_cb_(ui_default_callback), scan_life_(NULL) , notify_setting_result_(false), user_cancel_(false), cb_mem_(true), test_1_paper_(false) , setting_count_(0),img_type_(""), online_(false),is_quality_(-1),is_color_fill(false),is_multiout(false),save_multiout(OPTION_VALUE_DLSC_CS_HD_HB) + , final_img_index_(0) { final_path_ = hg_log::ini_get("paths", "final_img"); if(final_path_.empty()) @@ -1666,7 +1667,24 @@ int hg_scanner::try_third_app_handle_start(bool& handled) std::this_thread::sleep_for(std::chrono::milliseconds(3)); if (!wait_img_.is_waiting() || !wait_usb_.is_waiting() || final_imgs_.size()) - ret = SCANNER_ERR_OK; + { + while (final_imgs_.size() == 0) + { + if (wait_img_.is_waiting() && wait_usb_.is_waiting()) + break; + + std::this_thread::sleep_for(std::chrono::milliseconds(3)); + } + if (final_imgs_.size() == 0) + { + final_img_index_ = 0; + + if (user_cancel_) + handled = false; + else + ret = SCANNER_ERR_DEVICE_NO_PAPER; + } + } else if (final_img_index_) { final_img_index_ = 0; diff --git a/hgdriver/wrapper/hg_log.cpp b/hgdriver/wrapper/hg_log.cpp index 52faf37..db4ab0a 100644 --- a/hgdriver/wrapper/hg_log.cpp +++ b/hgdriver/wrapper/hg_log.cpp @@ -513,9 +513,9 @@ extern "C" home += PATH_SEPARATOR + lead; #ifdef OEM_HANWANG - home += "HwScanner"; + home += "HanvonScan"; #elif defined(OEM_LISICHENG) - home += "LscScanner"; + home += "LanxumScan"; #else home += "HuaGoScan"; #endif;