对 初始化的时候在一些固件版本上删除json配置文件
This commit is contained in:
parent
1b774d39bb
commit
718e796879
|
@ -1362,6 +1362,29 @@ int hg_scanner::set_color_change(void)
|
||||||
|
|
||||||
return SCANNER_ERR_OK;
|
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 hg_scanner::hgpaper_to_devspaper(Paper_Map papermap[], int len, int& paper, bool* exact, TwSS* type)
|
||||||
{
|
{
|
||||||
int ind = 0;
|
int ind = 0;
|
||||||
|
@ -2915,20 +2938,7 @@ void hg_scanner::init_settings(const char* json_setting_text)
|
||||||
jsn_children_.clear();
|
jsn_children_.clear();
|
||||||
setting_jsn_ = jsonconfig::load_json_from_text(json_setting_text, &jsn_children_);
|
setting_jsn_ = jsonconfig::load_json_from_text(json_setting_text, &jsn_children_);
|
||||||
}
|
}
|
||||||
if (!is_kernelsnap_239_220830_ && pid_ == 0x239)
|
jsn_reorganize();
|
||||||
{
|
|
||||||
//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);
|
|
||||||
}
|
|
||||||
|
|
||||||
VLOG_MINI_1(LOG_LEVEL_ALL, "Initialize %d settings ...\n", jsn_children_.size() - 1);
|
VLOG_MINI_1(LOG_LEVEL_ALL, "Initialize %d settings ...\n", jsn_children_.size() - 1);
|
||||||
notify_setting_result_ = false;
|
notify_setting_result_ = false;
|
||||||
|
|
|
@ -130,6 +130,7 @@ class hg_scanner
|
||||||
void reset_custom_area_range(int paper);
|
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
|
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);
|
int set_color_change(void);
|
||||||
|
bool jsn_reorganize(); // 固件版本不同 初始化json要做出相对应的删除
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue