尺寸检测切换

This commit is contained in:
mo1027728827@qq.com 2022-06-08 18:33:49 +08:00
parent 2c5183b5b8
commit f4985cffc6
3 changed files with 22 additions and 1 deletions

View File

@ -92,7 +92,7 @@ hg_scanner::hg_scanner(ScannerSerial serial
, fractate_level_(50), ui_ev_cb_(ui_default_callback), scan_life_(NULL)
, notify_setting_result_(false), user_cancel_(false), cb_mem_(true), test_1_paper_(false)
, setting_count_(0),img_type_(""), online_(false),is_quality_(-1),is_color_fill(false),is_multiout(false),save_multiout(OPTION_VALUE_DLSC_CS_HD_HB)
, final_img_index_(0), custom_area_(false)
, final_img_index_(0), custom_area_(false),save_sizecheck(false)
{
final_path_ = hg_log::ini_get("paths", "final_img");
if(final_path_.empty())
@ -1066,6 +1066,11 @@ int hg_scanner::setting_paper(void* data)
else if (!exact)
ret = SCANNER_ERR_NOT_EXACT;
if (save_sizecheck)
{
setting_paper_check(&save_sizecheck);
}
VLOG_MINI_3(LOG_LEVEL_DEBUG_INFO, "Change paper from %s to %s = %s\n", paper_string(old).c_str(), (char*)data, hg_scanner_err_name(ret));
if(ret == SCANNER_ERR_NOT_EXACT)
@ -1078,11 +1083,14 @@ int hg_scanner::setting_paper(void* data)
int hg_scanner::setting_paper_check(void* data)
{
bool use = *((bool*)data);
int ret = on_paper_check_changed(use);
VLOG_MINI_2(LOG_LEVEL_DEBUG_INFO, "Change paper size-checking %s = %s\n", *((bool*)data) ? "enabled" : "disabled", hg_scanner_err_name(ret));
*((bool*)data) = use;
save_sizecheck = use;
return ret;
}
int hg_scanner::setting_page(void* data)

View File

@ -101,6 +101,7 @@ class hg_scanner
bool notify_setting_result_;
std::string name_;
std::string save_multiout; //保存多留输出类型
bool save_sizecheck;
sane_callback ui_ev_cb_;
do_when_born_and_dead<hg_scanner>* scan_life_;

View File

@ -1293,12 +1293,24 @@ int hg_scanner_239::on_paper_check_changed(bool& check)
{
dev_conf_.g200params.enable_sizecheck = check;
ret = writedown_device_configuration();
if (ret)
{
dev_conf_.g200params.enable_sizecheck = !check;
check = dev_conf_.g200params.enable_sizecheck;
}
}
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
||image_prc_param_.bits.paper ==PAPER_TRIGEMINY
)
{
HGSCANCONF *d = &dev_conf_;
d->g200params.enable_sizecheck = false;
ret = writedown_device_configuration(d);
}
return ret;
}