From 531c0e8ee38fc67367fb4e395b8aeec6616dce86 Mon Sep 17 00:00:00 2001 From: 13038267101 Date: Sat, 31 Dec 2022 11:13:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=95=B8=E5=8F=98=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/HGProductionTool/ui_helper.h | 2 +- code/base/test_base.cpp | 29 +++++++++++++++++++---------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/app/HGProductionTool/ui_helper.h b/app/HGProductionTool/ui_helper.h index 321a44c..9890f21 100644 --- a/app/HGProductionTool/ui_helper.h +++ b/app/HGProductionTool/ui_helper.h @@ -92,7 +92,7 @@ public: TEST_EVENT_MANUAL_CONFIRMATION, // After send cmd ,need 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 + TEST_EVENT_DISTORTION, // TEST_EVENT_FALT_INFO, // }; 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 a976ed8..3bd60fe 100644 --- a/code/base/test_base.cpp +++ b/code/base/test_base.cpp @@ -125,15 +125,6 @@ public: io_type = false; h->io_control(IO_CTRL_CODE_SET_CIS_IMAGE, &io_type, &io_len); } - 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) == 0) - { - h->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_DISTORTION, (void*)L"畸变修正完成,是否进行单页扫描测试", type); - return 0; - } - } else if(wcscmp(set_test_name_.c_str(), HGPDTTOOLDB_NAME_ULTRASONIC_MODULE) == 0) { if (strcmp((char*)data, STATU_DESC_SCANNER_ERR_DEVICE_DOUBLE_FEEDING) != 0) @@ -182,6 +173,24 @@ public: else type = true; } + else if (wcscmp(set_test_name_.c_str(), HGPDTTOOLDB_NAME_DISTORTION) == 0) + { + wchar_t buf[128]=L""; + if (strcmp((char*)data, STATU_DESC_SCAN_STOPPED) != 0 || strcmp((char*)data, STATU_DESC_SCANNER_ERR_DEVICE_DISTORTION) == 0) + { + type = false; + wcscpy(buf, L"畸变修正失败,原因--->"); + } + else + { + type = true; + wcscpy(buf, L"畸变修正完成:"); + } + wcscat(buf, wstr.c_str()); + int len = sizeof(buf) / sizeof(buf[0]); + wstr.resize(len); + wstr = buf; + } h->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)wstr.c_str(), type); } @@ -204,7 +213,7 @@ public: { if ( wcscmp(set_test_name_.c_str(), HGPDTTOOLDB_NAME_CIS_ORIGINAL_IMAGE) == 0 ||wcscmp(set_test_name_.c_str(), HGPDTTOOLDB_NAME_IMAGE_QUALITY) == 0 - ||wcscmp(set_test_name_.c_str(), HGPDTTOOLDB_NAME_DISTORTION) == 0 + //||wcscmp(set_test_name_.c_str(), HGPDTTOOLDB_NAME_DISTORTION) == 0 || wcscmp(set_test_name_.c_str(), HGPDTTOOLDB_NAME_SCANNING_SENSOR) == 0) { h->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_HAVE_IMAGE, data, true);