From ea0c892b822aef2000a52079c5359b5830635cfd Mon Sep 17 00:00:00 2001 From: 13038267101 Date: Wed, 28 Dec 2022 12:04:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=B8=E5=8F=98=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/HGProductionTool/ui_helper.h | 14 +++++++------- code/base/test_base.cpp | 21 ++++++++++++++++++--- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/app/HGProductionTool/ui_helper.h b/app/HGProductionTool/ui_helper.h index 8c5b530..fe253e2 100644 --- a/app/HGProductionTool/ui_helper.h +++ b/app/HGProductionTool/ui_helper.h @@ -80,13 +80,13 @@ public: enum test_event { - TEST_EVENT_TIPS = 0, // messages in testing process, data is (wchar_t*), flag is unused - TEST_EVENT_xxx, // should be complemented ... - TEST_EVENT_NOT_FIND_TEST, // dll. not find test ,data is (wchar_t*)description, flag is (false) - TEST_EVENT_IO_FAIL, // IO. err flag is SCANNER_ERR_DEVICE_NOT_SUPPORT or io err,data is null - TEST_EVENT_MANUAL_CONFIRMATION, // After send cmd 锛宯eed manual confirmation. - TEST_EVENT_RESULT, // test result, data is (wchar_t*)description, flag is (bool)result, true - test pass - TEST_EVENT_HAVE_IMAGE // have image. + TEST_EVENT_TIPS = 0, // messages in testing process, data is (wchar_t*), flag is unused + TEST_EVENT_NOT_FIND_TEST, // dll. not find test ,data is (wchar_t*)description, flag is (false) + TEST_EVENT_IO_FAIL, // IO. err flag is SCANNER_ERR_DEVICE_NOT_SUPPORT or io err,data is null + TEST_EVENT_MANUAL_CONFIRMATION, // After send cmd 锛宯eed manual confirmation. + TEST_EVENT_RESULT, // test result, data is (wchar_t*)description, flag is (bool)result, true - test pass + TEST_EVENT_HAVE_IMAGE, // have image. + TEST_EVENT_DISTORTION, // user set a single page,flag is int }; virtual void test_callback(const wchar_t* name/*test name*/, test_event ev, void* data, size_t flag)=0 ; diff --git a/code/base/test_base.cpp b/code/base/test_base.cpp index 7890cfa..37595cc 100644 --- a/code/base/test_base.cpp +++ b/code/base/test_base.cpp @@ -98,7 +98,7 @@ public: else if (wcscmp(set_test_name_.c_str(), HGPDTTOOLDB_NAME_DISTORTION) == 0) { int ret = h->io_control(IO_CTRL_CODE_GET_DPI_COLOR_CHECK_VAL, &io_type, &io_len); - if (strcmp((char*)data, STATU_DESC_SCAN_STOPPED)) + if (strcmp((char*)data, STATU_DESC_SCAN_STOPPED) == 0) { h->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_DISTORTION, (void*)L"畸变修正完成,是否进行单页扫描测试", type); return 0; @@ -265,10 +265,15 @@ public: SANE_Bool type = true; unsigned int len = sizeof(SANE_Bool); int num = 0; - parameter * ptr = helper_->get_user_input(ui_helper::DATA_FROM_USER, ui_helper::VAL_TYPE_INT, NAME,L"请设置阈值:1-5。默认:1"); + + parameter * ptr = helper_->get_user_input(ui_helper::DATA_FROM_USER, ui_helper::VAL_TYPE_INT, NAME,L"请歪斜放纸...设置阈值:1 - 5,值越小越容易检测"); if (ptr) num = *((int*)ptr->get_data()); - + if (num == -1) + { + helper_->test_callback((wchar_t*)data, ui_helper::TEST_EVENT_RESULT, (void*)L"已退出歪斜检测流程", false); + return -1; + } if (num == 0) num = 1; @@ -295,6 +300,16 @@ public: /* cis原图初检 */ int test_cis__original_image(void *data) { + bool status = 0; + parameter* ptr = helper_->get_user_input(ui_helper::DATA_FROM_USER, ui_helper::VAL_TYPE_BOOL, set_test_name_.c_str(), L"请放纸,CIS原图检测,默认走纸一张"); + if (ptr) + status = *((bool*)ptr->get_data()); + if (status) + { + helper_->test_callback((wchar_t*)data, ui_helper::TEST_EVENT_RESULT, (void*)L"已退出歪斜检测流程", false); + return -1; + } + const wchar_t* NAME = (wchar_t*)data; SANE_Bool type = true; unsigned int len = sizeof(SANE_Bool);