From bbbdaf1c299855c0f0b419c2724bf0a99458220c Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Tue, 27 Feb 2024 16:22:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BD=E4=BA=A7=E7=B3=BB=E7=BB=9F=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E7=82=B9=E5=87=BB=E5=8F=96=E6=B6=88=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E4=BC=9A=E6=8A=A5io=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9BBUG-903?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/hg_scanner.cpp | 9 ++++++++- hgdriver/hgdev/hg_scanner.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index 95f6bea..0bfd0ed 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -183,6 +183,13 @@ hg_scanner::hg_scanner(ScannerSerial serial, const char* dev_name, usb_io* io, i if (hg_log::ini_get("func", "no-paper-chk") == "1") no_paper_check_ = true; + std::string CurExe_path(""); + std::string oem_name(PRODUCT_VENDOR); + hg_log::pe_path(&CurExe_path); + std::transform(CurExe_path.begin(), CurExe_path.end(), CurExe_path.begin(), ::toupper); + std::transform(oem_name.begin(), oem_name.end(), oem_name.begin(), ::toupper); + is_hg_app_ = CurExe_path.find(oem_name) != std::string::npos; + std::string mem = hg_log::ini_get("mem", "max_img"); if (!mem.empty()) { @@ -4324,7 +4331,7 @@ int hg_scanner::get_image_info(SANE_Parameters* ii, int len) this_thread::sleep_for(chrono::milliseconds(10)); if (final_imgs_.size() <= 0 - || user_cancel_) // for BUG-891 !!! + || (user_cancel_ && !is_hg_app_)) // for BUG-891 !!! //2024-02-07, add "is_hg_app_", for BUG-903 { ret = SCANNER_ERR_NO_DATA; if(user_cancel_ && final_imgs_.size()) diff --git a/hgdriver/hgdev/hg_scanner.h b/hgdriver/hgdev/hg_scanner.h index 0a3e902..4828303 100644 --- a/hgdriver/hgdev/hg_scanner.h +++ b/hgdriver/hgdev/hg_scanner.h @@ -290,6 +290,7 @@ protected: volatile bool run_; volatile bool is_read_int; volatile bool user_cancel_; + bool is_hg_app_ = true; platform_event wait_usb_; platform_event wait_img_; platform_event wait_usb_result_;