From f00878af6acdb0e88c344b0c1c619775300bae02 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Sat, 13 Aug 2022 15:06:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E5=BC=A0=E5=8F=8C?= =?UTF-8?q?=E5=BC=A0=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87=EF=BC=9B=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0G302=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/hg_scanner_239.cpp | 15 ++++++++++++++- hgdriver/hgdev/hg_scanner_402.cpp | 10 +++++++--- hgdriver/hgdev/hg_scanner_402.h | 3 ++- hgdriver/hgdev/scanner_manager.cpp | 3 ++- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/hgdriver/hgdev/hg_scanner_239.cpp b/hgdriver/hgdev/hg_scanner_239.cpp index 433b3ea..b584049 100644 --- a/hgdriver/hgdev/hg_scanner_239.cpp +++ b/hgdriver/hgdev/hg_scanner_239.cpp @@ -1569,12 +1569,25 @@ void hg_scanner_239::thread_handle_usb_read(void) if (status_ != SCANNER_ERR_OK && status_ != SCANNER_ERR_TIMEOUT && status_ != SCANNER_ERR_DEVICE_STOPPED) { - if (!is_dev_image_process_done()) + if (!is_dev_image_process_done() || (double_paper_handle_ & DOUBLE_PAPER_SAVE_IMG)) { int st = status_, count = 0, statu = last_usb_image_statu(st); while (!is_dev_image_process_done()) std::this_thread::sleep_for(std::chrono::milliseconds(30)); + StopWatch delay; + if((double_paper_handle_ & DOUBLE_PAPER_SAVE_IMG) && + st == SCANNER_ERR_DEVICE_DOUBLE_FEEDING) + { + int wait = 3000 + (img_conf_.resolution_dst / 200 * 10000); + while (get_image_count() == 0) + { + std::this_thread::sleep_for(std::chrono::milliseconds(30)); + if (delay.elapsed_ms() > wait) + break; + } + } + while ((count = get_image_count()) > 0) { int s = SANE_Image_Statu_OK; diff --git a/hgdriver/hgdev/hg_scanner_402.cpp b/hgdriver/hgdev/hg_scanner_402.cpp index 79602e0..18d830d 100644 --- a/hgdriver/hgdev/hg_scanner_402.cpp +++ b/hgdriver/hgdev/hg_scanner_402.cpp @@ -1809,7 +1809,7 @@ std::string hg_scanner_402::get_ip(void) } int hg_scanner_402::get_roller_num(void) { - /*int val = 0, + int val = 0, ret = read_register(SR_GET_ROLLER_NUM, &val); if (ret == SCANNER_ERR_OK) @@ -1817,8 +1817,12 @@ int hg_scanner_402::get_roller_num(void) else { VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "get_roller_num = %s\n", hg_scanner_err_name(ret)); - return -1; - }*/ + return -2; + } + // return -2; +} +int hg_scanner_402::get_history_count(void) +{ return -2; } int hg_scanner_402::clear_roller_num(void) diff --git a/hgdriver/hgdev/hg_scanner_402.h b/hgdriver/hgdev/hg_scanner_402.h index 1656479..d9defcf 100644 --- a/hgdriver/hgdev/hg_scanner_402.h +++ b/hgdriver/hgdev/hg_scanner_402.h @@ -95,7 +95,8 @@ public: virtual int get_compression_format(void);//获取支持的压缩格式 ***功能不支持 virtual int get_roller_num(void); //获取滚轮张数 ***完成 - virtual int clear_roller_num(void); // 清除滚轴计数 ***完成 + virtual int get_history_count(void);//获取历史扫描张数 -2:设备不支持该功能;-1:与设备通信失败;其它大于等于0的为正常 + virtual int clear_roller_num(void); // 清除滚轴计数 ***完成 virtual int set_compression_format(void);//设置图像数据最终输出的压缩格式 ***功能不支持 virtual int set_auto_color_type(void);// 设置自动匹配颜色模式 (基类实现) ***完成 diff --git a/hgdriver/hgdev/scanner_manager.cpp b/hgdriver/hgdev/scanner_manager.cpp index 25a61f8..25be681 100644 --- a/hgdriver/hgdev/scanner_manager.cpp +++ b/hgdriver/hgdev/scanner_manager.cpp @@ -41,7 +41,7 @@ g_supporting_devices[] = { {0x2903, 0x7000, SCANNER_NAME_HW_7000, "HW-74x0WA", "", &hg_scanner_mgr::create_scanner_g400} , {0x2903, 0x7002, SCANNER_NAME_HW_7002, "HW-7002", "", &hg_scanner_mgr::create_scanner_g402} , {0x2903, 0x1000, SCANNER_NAME_HW_1060A, "HW-1060A", "", &hg_scanner_mgr::create_scanner_g300} - , {0x2903, 0x1002, SCANNER_NAME_HW_1060A, "HW-1060A", "", &hg_scanner_mgr::create_scanner_g300} + , {0x2903, 0x1002, SCANNER_NAME_HW_1060A, "HW-1060A", "", &hg_scanner_mgr::create_scanner_g402} , {0x2903, 0x8000, SCANNER_NAME_HW_8090F, "HW-8090F", "", &hg_scanner_mgr::create_scanner_g239} , {0x2903, 0x9000, SCANNER_NAME_HW_9110F, "HW-9110F", "", &hg_scanner_mgr::create_scanner_g239} , {0x2903, 0x7039, SCANNER_NAME_HW_7039F, "HW-7039F", "", &hg_scanner_mgr::create_scanner_g239} @@ -55,6 +55,7 @@ g_supporting_devices[] = { , {0x3072, 0x339, SCANNER_NAME_HG_G339, "GScanO1003399", "", &hg_scanner_mgr::create_scanner_empty} , {0x3072, 0x439, SCANNER_NAME_HG_G439, "GScanO1003399", "", &hg_scanner_mgr::create_scanner_g239} , {0x064B, 0x7823, SCANNER_NAME_HG_G200, "GScanO200", "", &hg_scanner_mgr::create_scanner_empty} + , {0x3072, 0x302, SCANNER_NAME_HG_G300, "GScanO400", "", &hg_scanner_mgr::create_scanner_g402} , {0x3072, 0x402, SCANNER_NAME_HG_G402, "GScanO4003399", "", &hg_scanner_mgr::create_scanner_g402} #endif };