解决待纸扫描到了时间未退出的问题

This commit is contained in:
yangjiaxuan 2023-11-08 15:46:33 +08:00
parent 142e957507
commit ebaace74a1
1 changed files with 5 additions and 2 deletions

View File

@ -1341,6 +1341,8 @@ void hg_scanner_239::thread_get_dves_image(void)
svdevs_err_.clear();
StopWatch sw;
bool is_quit_wait_paper_scan = false;
while (run_)//&& !user_cancel_
{
size = sizeof(buf);
@ -1365,6 +1367,7 @@ void hg_scanner_239::thread_get_dves_image(void)
if (is_auto_paper_scan && sw.elapsed_s() >= is_auto_paper_scan_exit_time && is_auto_paper_scan_exit_time != 0)
{
is_quit_wait_paper_scan = true;//标记待纸扫描时间到了自动结束
do_stop();
notify_ui_working_status(from_default_language(STATU_DESC_SCANNER_ERR_DEVICE_EXIT_WAIT_SCAN), SANE_EVENT_ERROR, status_);
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "auto paper scan exit :%s\n", from_default_language(STATU_DESC_SCANNER_ERR_DEVICE_EXIT_WAIT_SCAN));
@ -1376,7 +1379,7 @@ void hg_scanner_239::thread_get_dves_image(void)
//break;
}
if (user_cancel_ && is_auto_paper_scan) //其他直接跳过当此循坏
if (user_cancel_ && is_auto_paper_scan || is_quit_wait_paper_scan) //其他直接跳过当此循坏
{
size = sizeof(buf);
memset(buf, 0, size);
@ -1503,7 +1506,7 @@ void hg_scanner_239::thread_get_dves_image(void)
string str = hg_log::lang_load(ID_STATU_DESC_SCANNER_ERR_DEVICE_ROUND_SACN_OVER);
str += ":" + to_string(++auoto_paper_indx);
if (!user_cancel_ && is_auto_paper_scan && svdevs_err_.empty())
if (!user_cancel_ && is_auto_paper_scan && svdevs_err_.empty() && !is_quit_wait_paper_scan)
notify_ui_working_status(str.c_str(), SANE_EVENT_ERROR, status_);
else
break;