From 4a94b460dd3ed43248ba4215af6fafcb186c4c5c Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Mon, 6 Nov 2023 15:28:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=A1=E6=AD=A3=E7=BB=93=E6=9D=9F=E6=97=B6?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E5=9B=BA=E4=BB=B6=E6=9C=AA=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E4=BF=A1=E5=8F=B7=EF=BC=8C=E5=88=99=E9=80=9A=E8=BF=87=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=88=A4=E6=96=AD=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E7=BB=93=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/hgdev/hg_scanner_239.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hgdriver/hgdev/hg_scanner_239.cpp b/hgdriver/hgdev/hg_scanner_239.cpp index 748c818..23c66b5 100644 --- a/hgdriver/hgdev/hg_scanner_239.cpp +++ b/hgdriver/hgdev/hg_scanner_239.cpp @@ -1148,6 +1148,7 @@ void hg_scanner_239::thread_correction(void) int size = sizeof(buf), ret = SCANNER_ERR_OK; + bool autoFaltFinish = false; while (run_) { size = sizeof(buf); @@ -1158,12 +1159,13 @@ void hg_scanner_239::thread_correction(void) io_->set_timeout(1000); printf("size:%d\r\n",size); } + if (ret == SCANNER_ERR_TIMEOUT) { - if (sw.elapsed_s() > 10) + if (sw.elapsed_s() > 30 || autoFaltFinish) { is_auto_falt = false; - status_ = SCANNER_ERR_TIMEOUT; + status_ = SCANNER_ERR_DEVICE_AUTO_FAIL_OVER; //notify_ui_working_status(hg_log::lang_load(ID_STATU_DESC_SCANNER_ERR_DEVICE_FAIL_OUTTIME), SANE_EVENT_ERROR, ret); // 通信超时 VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "设备校正超时 '%s'\n", hg_scanner_err_name(status_)); break; @@ -1188,6 +1190,11 @@ void hg_scanner_239::thread_correction(void) notify_ui_working_status(buf, SANE_EVENT_STATUS, status_); printf("%s\r\n", sinfo.c_str()); + if (NULL != strstr(sinfo.c_str(), "******Correct Done******")) + { + autoFaltFinish = true; + } + if (info->Code == 4) { is_auto_falt = false;