调整600dpi畸变值获取失败问题

This commit is contained in:
13038267101 2023-02-28 14:23:30 +08:00
parent cb34238531
commit b596bcdb43
1 changed files with 21 additions and 17 deletions

View File

@ -510,19 +510,6 @@ public:
{
helper->register_sane_callback(sane_ex_callback, NULL);
init_test_map_();
std::string fw1(get_firmware_version());
if (fw1.size() > 5)
{
if ("G1" == fw1.substr(0, 2))
fw_ = 1;
else if ("G2" == fw1.substr(0, 2))
fw_ = 2;
else if ("G3" == fw1.substr(0, 2))
fw_ = 3;
else if ("G4" == fw1.substr(0, 2))
fw_ = 4;
}
int a = 0;
}
~test()
{}
@ -574,6 +561,23 @@ public:
int set_test(const wchar_t* name,const wchar_t* oper)
{
if (wcscmp(name, HGPDTTOOLDB_NAME_SET_JSON_SN) == 0
|| wcscmp(name, HGPDTTOOLDB_NAME_GET_DEVICE_CONFIG) == 0
|| wcscmp(name, HGPDTTOOLDB_NAME_CONFIGURE_SPEED_MODE) == 0)
{
std::string fw1(get_firmware_version());
if (fw1.empty())
{
if ("G1" == fw1.substr(0, 2))
fw_ = 1;
else if ("G2" == fw1.substr(0, 2))
fw_ = 2;
else if ("G3" == fw1.substr(0, 2))
fw_ = 3;
else if ("G4" == fw1.substr(0, 2))
fw_ = 4;
}
}
if (!name)
return SCANNER_ERR_NO_DATA;
set_test_name_ = name;
@ -988,18 +992,18 @@ public:
SANE_DISTORTION_VAL dis = { 0 };
while (ret == SCANNER_ERR_OK)
{
if (is_distortion_get_image )
if (is_distortion_get_image)
{
ret = helper_->io_control(IO_CTRL_CODE_GET_DISTORTION_CHECK_VAL, &dis, &llen);
break;
}
else if (cnt == 10)
else if (cnt == 30)
break;
Sleep(1000);
cnt++;
}
if (dis.h > 0)
if (dis.h > 0 && dis.h < 10)
{
helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_DISTORTION_VAL, (void *)&dis, true);
}