微调日志

This commit is contained in:
13038267101 2023-05-17 14:46:47 +08:00
parent 69f9249692
commit 4232d30a74
2 changed files with 29 additions and 22 deletions

View File

@ -1086,7 +1086,7 @@ void hg_scanner::working_begin(void*)
final_img_index_ = 0;
status_ = SCANNER_ERR_OK;
notify_ui_working_status(hg_log::lang_load(ID_STATU_DESC_SCAN_WORKING), SANE_EVENT_WORKING, SCANNER_ERR_OK);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "[%s] scanning ...\n", hg_log::current_time().c_str());
LOG_INFO(LOG_LEVEL_DEBUG_INFO, "scanning ...\n");
}
void hg_scanner::working_done(void*)
{
@ -1185,7 +1185,7 @@ void hg_scanner::working_done(void*)
}
else
{
VLOG_MINI_3(LOG_LEVEL_DEBUG_INFO, "[%s] EXIT All Thread--->Total picture: [%d] and scanner status [%s].\n", hg_log::current_time().c_str(), final_img_index_, hg_scanner_err_description(status_));
VLOG_MINI_2(LOG_LEVEL_DEBUG_INFO, "EXIT All Thread--->Total picture: [%d] and scanner status [%s].\n", final_img_index_, hg_scanner_err_description(status_));
}
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "----------Main End scan status----------%s:\n", hg_scanner_err_description(status_));
@ -1902,8 +1902,13 @@ int hg_scanner::setting_is_permeate_lv(void* data, long* len)
}
int hg_scanner::setting_remove_morr(void* data, long* len)
{
image_prc_param_.bits.remove_morr = *((bool*)data);
if (resolution_ > 300 )
{
image_prc_param_.bits.remove_txtture = image_prc_param_.bits.remove_morr = *((bool*)data) = false;
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
}
image_prc_param_.bits.remove_morr = *((bool*)data);
return SCANNER_ERR_OK;
}
int hg_scanner::setting_error_extention(void* data, long* len)

View File

@ -109,11 +109,15 @@ void hg_scanner_300::thread_handle_usb_read(void)
SANE_Image_Statu statu = SANE_Image_Statu_OK;
int img_num = 0;
savestatus_.clear();
VLOG_MINI_1(LOG_LEVEL_WARNING, "thread_handle_usb_read run is:%d\n", run_);
while (run_)
{
USBCB usb={0};
ret = get_scanner_status(usb);
if (ret && ret != SCANNER_ERR_NO_DATA)
{
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "status from bulk point is '%s'\n", hg_scanner_err_description(ret));
}
//printf("usb.u32_Data = %d ret = %d\r\n",usb.u32_Data,ret);
//如果设备出现卡纸 或者双张等设备信息问题需要等到设备进行发送stop才能停止。 所以始终以 "停止" 消息为结束信号
//如果有图的情况下,并且卡纸或双张等,设备会先发送卡纸双张信息。所以接受到错误信息之后,仍需要把图像取出来。
@ -127,9 +131,9 @@ void hg_scanner_300::thread_handle_usb_read(void)
ret = status_;
else
status_ = ret = SCANNER_ERR_USER_CANCELED;
VLOG_MINI_2(LOG_LEVEL_DEBUG_INFO, "%s:%s\n", hg_log::lang_load(ID_STATU_DESC_SCANNER_ERR_DEVICE_GET_USER_CANCEL_SCAN), hg_scanner_err_name(status_));
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "%s\n", hg_scanner_err_description(status_));
}
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "'STOPSCAN' message in usb thread:%s\n" , hg_scanner_err_name(status_));
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "'STOPSCAN' message in usb thread:%s\n" , hg_scanner_err_description(status_));
break;
}
@ -190,7 +194,7 @@ void hg_scanner_300::thread_handle_usb_read(void)
else if (ret == SCANNER_ERR_IO)
{
status_ = ret;
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "%s\n", hg_scanner_err_name(status_));
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "%s\n", hg_scanner_err_description(status_));
break;
}
if (sw.elapsed_ms() > 30000 && img_conf_.resolution_dst != 600)//防止状态信息一直取不上来导致卡死
@ -260,6 +264,7 @@ void hg_scanner_300::thread_handle_usb_read(void)
}
this_thread::sleep_for(chrono::milliseconds(10));
}
VLOG_MINI_2(LOG_LEVEL_DEBUG_INFO, "USB thread exit with code: %s, status = %s\n", hg_scanner_err_name(ret), hg_scanner_err_description(status_));
}
int hg_scanner_300::discard_all_images(void)
{
@ -330,7 +335,6 @@ int hg_scanner_300::start(void)
{
status_ = SCANNER_ERR_DEVICE_SLEEPING;
VLOG_MINI_1(LOG_LEVEL_WARNING, "device start status is(%s)\n", hg_log::lang_load(ID_STATU_DESC_SCANNER_ERR_DEVICE_SLEEPING));
return status_;
}
ret = get_scanner_paperon(val);
@ -338,7 +342,6 @@ int hg_scanner_300::start(void)
{
status_ = SCANNER_ERR_DEVICE_NO_PAPER;
VLOG_MINI_1(LOG_LEVEL_WARNING, "device start status is(%s)\n", STATU_DESC_SCANNER_ERR_DEVICE_NO_PAPER);
return status_;
}
if (ret != SCANNER_ERR_OK)
@ -362,7 +365,7 @@ int hg_scanner_300::start(void)
status_ = ret;
return ret;
}
//printf_devconfig();
printf_devconfig();
USBCB usb = { setting3288dsp::START_COMMAND, img_conf_.scannum, 0};
ret = writeusb(usb);
@ -374,8 +377,7 @@ int hg_scanner_300::start(void)
}
else
status_ = ret;
VLOG_MINI_1(LOG_LEVEL_WARNING, "start result: %s\n", hg_scanner_err_name(ret));
VLOG_MINI_1(LOG_LEVEL_WARNING, "----------Main start scan status : %s----------\n", hg_scanner_err_description(ret));
return ret;
}
int hg_scanner_300::stop(void)
@ -799,7 +801,7 @@ void hg_scanner_300::printf_devconfig(setting_hardware::HGSCANCONF_3288 *d)
if (!d)
d = &dsp_config;
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"\r\ndsp_config.params_3288.doubleFeeded:%d\r\n",d->params_3288.doubleFeeded);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.doubleFeeded:%d\r\n",d->params_3288.doubleFeeded);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.dpi:%d\r\n",d->params_3288.dpi);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.dstHeight:%d\r\n",d->params_3288.dstHeight);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO,"dsp_config.params_3288.enableLed:%d\r\n",d->params_3288.enableLed);
@ -922,7 +924,7 @@ int hg_scanner_300::get_scanner_paperon(SANE_Bool& type)
// ret = SCANNER_ERR_DEVICE_NO_PAPER;
//else
// ret = SCANNER_ERR_OK;
VLOG_MINI_1(LOG_LEVEL_WARNING, "get_scanner_paperon is(%s)\n", !type ? hg_scanner_err_name(SCANNER_ERR_DEVICE_NO_PAPER) : hg_scanner_err_name(SCANNER_ERR_OK));
VLOG_MINI_1(LOG_LEVEL_WARNING, "get_scanner_paperon is(%s)\n", !type ? hg_scanner_err_description(SCANNER_ERR_DEVICE_NO_PAPER) : hg_scanner_err_description(SCANNER_ERR_OK));
return ret;
}
@ -950,7 +952,7 @@ int hg_scanner_300::get_scan_is_sleep(SANE_Bool& type)
type = false;
//return SCANNER_ERR_DEVICE_SLEEPING;
}
VLOG_MINI_1(LOG_LEVEL_WARNING, "get_scan_is_sleep is(%s)\n", !type ? hg_scanner_err_name(SCANNER_ERR_DEVICE_SLEEPING) : hg_scanner_err_name(SCANNER_ERR_OK));
VLOG_MINI_1(LOG_LEVEL_WARNING, "get_scan_is_sleep is(%s)\n", !type ? hg_scanner_err_description(SCANNER_ERR_DEVICE_SLEEPING) : hg_scanner_err_description(SCANNER_ERR_OK));
return ret;
}
///此款设备无此功能