调整畸变流程

This commit is contained in:
13038267101 2022-12-31 11:13:04 +08:00
parent 9cd6ee5d15
commit 531c0e8ee3
2 changed files with 20 additions and 11 deletions

View File

@ -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 ;

View File

@ -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);