From a268390851017f1e9e1e1eb12cd4ad0336dd7568 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Wed, 23 Aug 2023 14:00:43 +0800 Subject: [PATCH] =?UTF-8?q?G300=20d8=E8=AE=BE=E5=A4=87=20=E5=AF=B9G3XX2307?= =?UTF-8?q?24=E5=8F=8A=E4=BB=A5=E5=90=8E=E7=89=88=E6=9C=AC=E5=BC=80?= =?UTF-8?q?=E6=94=BE=E9=99=A4=E6=91=A9=E5=B0=94=E7=BA=B9=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/common_setting.h | 3 ++- hgdriver/hgdev/hg_scanner.cpp | 2 +- hgdriver/hgdev/hg_scanner_300.cpp | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/hgdriver/hgdev/common_setting.h b/hgdriver/hgdev/common_setting.h index 8f6bb52..6429794 100644 --- a/hgdriver/hgdev/common_setting.h +++ b/hgdriver/hgdev/common_setting.h @@ -691,7 +691,8 @@ namespace setting_hardware unsigned int enableLed : 1; unsigned int enableSizeDetect : 1; unsigned int lutmode : 1; // 设置文本和照片模式, 0 - 文本;1 - 照片。默认值为“0” - unsigned int reversed1 : 4; + unsigned int moire : 1; + unsigned int reversed1 : 3; unsigned int isCorrect : 1; //设置0 为原图,1为校正后的图 unsigned int dstHeight : 8; unsigned int reversed2 : 6; diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index 9de6f98..6f7e2d1 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -4950,7 +4950,7 @@ void hg_scanner::image_process(std::shared_ptr& buffer, uint32_t id (this->*dump_img_)(ImagePrc_pHandle_, "textureRemove"); } - if (img_conf_.removeMorr && (pid_ != 0x239 && pid_ != 0x439)) + if (img_conf_.removeMorr && (pid_ != 0x239 && pid_ != 0x439) && !firmware_sup_morr_) { hg_imgproc::remove_morr(ImagePrc_pHandle_); (this->*dump_img_)(ImagePrc_pHandle_, "remove_morr"); diff --git a/hgdriver/hgdev/hg_scanner_300.cpp b/hgdriver/hgdev/hg_scanner_300.cpp index bc85d00..7810911 100644 --- a/hgdriver/hgdev/hg_scanner_300.cpp +++ b/hgdriver/hgdev/hg_scanner_300.cpp @@ -88,6 +88,21 @@ hg_scanner_300::hg_scanner_300(const char* dev_name,int pid, usb_io* io) : dsp_config.params_3288.enableLed = 1; //默认值 dsp_config.params_3288.isCorrect = 1; initdevice(); + + std::string fv(get_firmware_version()), + sn(get_serial_num()); + if (fv.empty() || sn.empty()) + return; + + string dev = fv.substr(0, 2); + string ver = fv.substr(2, 3); + string date = fv.substr(5, 5); + string year = fv.substr(4, 2); + string devType; + string year_date = fv.substr(4, 6); + + firmware_sup_morr_ = year_date.compare("230724") >= 0 ? true : false; + #ifndef MAPPING_FUNCTION_IN_BASE init_setting_map(setting_map_, ARRAY_SIZE(setting_map_));//优先初始化 #endif @@ -660,6 +675,13 @@ int hg_scanner_300::writedown_device_configuration(bool type,setting_hardware::H VLOG_MINI_1(LOG_LEVEL_WARNING, "writedown_device_configuration is_quality_ is .(%d)\n", is_quality_) d->params_3288.dpi = 1; } + if (image_prc_param_.bits.remove_morr && firmware_sup_morr_) + { + d->params_3288.moire = true; + } + else + d->params_3288.moire = false; + if (image_prc_param_.bits.paper == PAPER_AUTO_MATCH || image_prc_param_.bits.paper == PAPER_MAX_SIZE || image_prc_param_.bits.paper == PAPER_MAX_SIZE_CLIP