diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index cb058dc..58646ca 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -1362,6 +1362,29 @@ int hg_scanner::set_color_change(void) return SCANNER_ERR_OK; } +bool hg_scanner::jsn_reorganize() +{ + bool enble = false; + if (!is_kernelsnap_239_220830_ && pid_ == 0x239) + { + erase_option(SANE_STD_OPT_NAME_WAIT_TO_SCAN); + erase_option(SANE_STD_OPT_NAME_IS_AUTO_FEED_STRENGTH); + erase_option(SANE_STD_OPT_NAME_FEED_STRENGTH); + enble = true; + } + if (!is_kernelsnap_239_220429_ && pid_ == 0x239) + { + erase_option(SANE_STD_OPT_NAME_IS_FILL_COLOR); + enble = true; + } + if (pid_ == 0x239 || pid_ == 0x439) + { + erase_option(SANE_STD_OPT_NAME_RID_GRID); + erase_option(SANE_STD_OPT_NAME_RID_MORR); + enble = true; + } + return enble; +} int hg_scanner::hgpaper_to_devspaper(Paper_Map papermap[], int len, int& paper, bool* exact, TwSS* type) { int ind = 0; @@ -2915,20 +2938,7 @@ void hg_scanner::init_settings(const char* json_setting_text) jsn_children_.clear(); setting_jsn_ = jsonconfig::load_json_from_text(json_setting_text, &jsn_children_); } - if (!is_kernelsnap_239_220830_ && pid_ == 0x239) - { - //setting_jsn_.erase(SANE_STD_OPT_NAME_WAIT_TO_SCAN); - //setting_jsn_.erase(SANE_STD_OPT_NAME_IS_AUTO_FEED_STRENGTH); - //setting_jsn_.erase(SANE_STD_OPT_NAME_FEED_STRENGTH); - erase_option(SANE_STD_OPT_NAME_WAIT_TO_SCAN); - erase_option(SANE_STD_OPT_NAME_IS_AUTO_FEED_STRENGTH); - erase_option(SANE_STD_OPT_NAME_FEED_STRENGTH); - } - if (!is_kernelsnap_239_220429_ && pid_ == 0x239) - { - //setting_jsn_.erase(SANE_STD_OPT_NAME_IS_FILL_COLOR); - erase_option(SANE_STD_OPT_NAME_IS_FILL_COLOR); - } + jsn_reorganize(); VLOG_MINI_1(LOG_LEVEL_ALL, "Initialize %d settings ...\n", jsn_children_.size() - 1); notify_setting_result_ = false; diff --git a/hgdriver/hgdev/hg_scanner.h b/hgdriver/hgdev/hg_scanner.h index 20e52f6..95be7cf 100644 --- a/hgdriver/hgdev/hg_scanner.h +++ b/hgdriver/hgdev/hg_scanner.h @@ -130,6 +130,7 @@ class hg_scanner void reset_custom_area_range(int paper); float reset_custom_area_jsn_value(const char* name, double& var, float range_l, float range_u, float value_l, float value_u); // return cur value int set_color_change(void); + bool jsn_reorganize(); // 固件版本不同 初始化json要做出相对应的删除 public: