调整3288和3399设备匹配原始尺寸,尺寸检测仍然生效的问题,300设备支持导出设备日志

This commit is contained in:
yangjiaxuan 2023-09-07 10:03:23 +08:00
parent 2e7f7bee1b
commit c09d6eeba8
4 changed files with 87 additions and 1 deletions

View File

@ -480,6 +480,11 @@ int hg_scanner_200::writedown_device_configuration(bool type,setting_hardware::H
d->params_dsp.color = 1; d->params_dsp.color = 1;
} }
if (paper_size_ == TwSS::None || paper_size_ == TwSS::USStatement || paper_size_ == TwSS::MaxSize || paper_size_ == TwSS::Trigeminy)
{
d->params_dsp.enable_sizecheck = false;
}
{ {
std::lock_guard<std::mutex> lock(io_lock_); std::lock_guard<std::mutex> lock(io_lock_);

View File

@ -602,6 +602,19 @@ int hg_scanner_239::writedown_image_configuration(void)
} }
ic.contrast = (contrast_ - 4) * 333.0; ic.contrast = (contrast_ - 4) * 333.0;
ic.brightness = (bright_ - 128) * (2000.0 / 254.0); ic.brightness = (bright_ - 128) * (2000.0 / 254.0);
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
|| image_prc_param_.bits.paper == PAPER_16K
|| image_prc_param_.bits.paper == PAPER_8K
|| image_prc_param_.bits.paper == PAPER_16K_LATERAL
)
{
ic.en_sizecheck = false;
}
image_configuration(ic); image_configuration(ic);
{ {

View File

@ -1122,7 +1122,62 @@ int hg_scanner_300::on_get_feedmode(int &feedmode)
} }
int hg_scanner_300::get_device_log(string &log) int hg_scanner_300::get_device_log(string &log)
{ {
return SCANNER_ERR_DEVICE_NOT_SUPPORT; int ret = SCANNER_ERR_OK,
len = 0;
string save_path = hg_log::temporary_path() + PATH_SEPARATOR + "device.log";
string str;
string str2;
USBCB usbcb = { setting3288dsp::GET_LOG_FILES_INFO, 0, 0 };
len = sizeof(USBCB);
{
std::lock_guard<std::mutex> lock(io_lock_);
ret = writeusb(usbcb);
if (ret == SCANNER_ERR_OK)
{
ret = readusb(usbcb);
}
int block = usbcb.u32_Count,
total = usbcb.u32_Count,
index = 0;
if (total == 0)
{
return SCANNER_ERR_NO_DATA;
}
str.resize(total);
str2.resize(total);
ret = io_->read_bulk(&str[index], &block);
//while (ret == SCANNER_ERR_TIMEOUT) ///设备代码是进行了第二次 write 条件是len > 0 如果出现问题这个地方需要打开
//{
// block = 1024 * 1024;
// if (total < block)
// {
// block = total;
// }
// ret = io_->read_bulk(&str2[index], &block);
// //if (ret != SCANNER_ERR_OK)
// //return ret;
// index += block;
// total -= block;
//}
}
if (ret != SCANNER_ERR_OK)
return ret;
ofstream f;
f.open(save_path, ios::out | ios::trunc);
if (!f.is_open())
return SCANNER_ERR_CREATE_FILE_FAILED;
f << str << endl;
f.close();
log = save_path;
return SCANNER_ERR_OK;
} }
int hg_scanner_300::set_devreboot(int data) int hg_scanner_300::set_devreboot(int data)
{ {

View File

@ -519,6 +519,19 @@ int hg_scanner_302::writedown_image_configuration(void)
} }
ic.contrast = contrast_;//(contrast_ - 4) * 333.0; ic.contrast = contrast_;//(contrast_ - 4) * 333.0;
ic.brightness = bright_;// (bright_ - 128)* (2000.0 / 254.0); ic.brightness = bright_;// (bright_ - 128)* (2000.0 / 254.0);
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
|| image_prc_param_.bits.paper == PAPER_16K
|| image_prc_param_.bits.paper == PAPER_8K
|| image_prc_param_.bits.paper == PAPER_16K_LATERAL
)
{
ic.en_sizecheck = false;
}
image_configuration(ic); image_configuration(ic);
{ {