From ca96accbbc609e8f28953d5dd2f5ff2c9e121f4b Mon Sep 17 00:00:00 2001 From: 13038267101 Date: Wed, 1 Mar 2023 15:36:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=8E=B7=E5=8F=96=E7=95=B8?= =?UTF-8?q?=E5=8F=98=E6=97=B6=EF=BC=8C=E5=87=BA=E7=8E=B0=E8=B5=B0=E7=BA=B8?= =?UTF-8?q?=E7=AD=89=E9=94=99=E8=AF=AF=EF=BC=8C=E8=BF=94=E5=9B=9E=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=BF=87=E6=85=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/base/test_base.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/code/base/test_base.cpp b/code/base/test_base.cpp index 248da08..774f892 100644 --- a/code/base/test_base.cpp +++ b/code/base/test_base.cpp @@ -121,6 +121,7 @@ int get_json_config_file() } static std::wstring set_test_name_ =L""; bool is_distortion_get_image = false; +bool is_distortion_get_image_abnormal = false; class test { ui_helper* helper_; @@ -372,6 +373,7 @@ public: { type = false; is_distortion_get_image = false; + is_distortion_get_image_abnormal = true; wcscpy(buf, L"畸变修正值获取失败,原因--->"); } else @@ -595,7 +597,11 @@ public: helper_->test_callback(name, ui_helper::TEST_EVENT_NOT_FIND_TEST, NULL, false); return ret; } - if (ret != SCANNER_ERR_OK && ret != -1) + if (ret == SCANNER_ERR_DEVICE_NOT_SUPPORT + || ret == SCANNER_ERR_IO + || ret == SCANNER_ERR_TIMEOUT + || ret == SCANNER_ERR_NO_DATA + ) { helper_->test_callback(name, ui_helper::TEST_EVENT_IO_FAIL, NULL, ret); } @@ -1001,16 +1007,19 @@ public: else if (cnt == 30) break; + if (is_distortion_get_image_abnormal) + return; + Sleep(1000); cnt++; } - if (dis.h > 0 && dis.scaleXY < 10) + if (dis.h > 0 && dis.scaleXY < 10) { helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_DISTORTION_VAL, (void *)&dis, true); } else { - helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT,(void*)L"自动计算畸变值获取失败", false); + helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT,(void*)L"自动计算畸变值获取失败", false); } return ret; } @@ -1268,6 +1277,8 @@ DECL_API(int) func_test_go(const wchar_t* NAME, const wchar_t* oper, ui_helper* //helper->add_ref(void *data); is_distortion_get_image = false; + is_distortion_get_image_abnormal = false; + int ret = 0; SANE_Bool type = false; unsigned int len = sizeof(SANE_Bool);