确认畸变值改为仅从设备获取
This commit is contained in:
parent
2e5dd36607
commit
fedc708206
|
@ -1,4 +1,4 @@
|
|||
#include"test_base.h"
|
||||
#include"test_base.h"
|
||||
#include<string>
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
|
@ -1165,9 +1165,8 @@ public:
|
|||
|
||||
int ret = SCANNER_ERR_OK,
|
||||
dpi = 0;
|
||||
SANE_Bool type = true;
|
||||
unsigned int len = sizeof(SANE_Bool),
|
||||
llen = sizeof(int);
|
||||
float distortion = 0;
|
||||
unsigned int len = sizeof(int);
|
||||
size_t strl = 0;
|
||||
ret = wchar_to_char(str, p, &strl);
|
||||
if (ret == ERROR_INSUFFICIENT_BUFFER)
|
||||
|
@ -1182,39 +1181,20 @@ public:
|
|||
}
|
||||
if (dpi > 0)
|
||||
{
|
||||
ret = helper_->io_control(IO_CTRL_CODE_SET_DPI, &dpi, &llen);
|
||||
ret = helper_->io_control(IO_CTRL_CODE_SET_DPI, &dpi, &len);
|
||||
}
|
||||
|
||||
ret = helper_->io_control(IO_CTRL_CODE_SET_DISTORTION_IMAGE, &type, &len);
|
||||
if (ret != SCANNER_ERR_OK)
|
||||
ret = helper_->io_control(IO_CTRL_CODE_GET_DISTORTION_DEVS_CHECK_VAL, &distortion, &len);
|
||||
if (ret == SCANNER_ERR_OK)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
int cnt = 0;
|
||||
SANE_DISTORTION_VAL dis = { 0 };
|
||||
while (ret == SCANNER_ERR_OK)
|
||||
{
|
||||
if (is_distortion_get_image)
|
||||
{
|
||||
ret = helper_->io_control(IO_CTRL_CODE_GET_PC_DISTORTION_CHECK_VAL, &dis, &llen);
|
||||
break;
|
||||
}
|
||||
else if (cnt == 30)
|
||||
break;
|
||||
|
||||
if (is_distortion_get_image_abnormal)
|
||||
return -1;
|
||||
|
||||
Sleep(1000);
|
||||
cnt++;
|
||||
}
|
||||
if (dis.h > 0 && dis.scaleXY < 10)
|
||||
{
|
||||
helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_DISTORTION_VAL, (void *)&dis, true);
|
||||
wchar_t buf[64];
|
||||
swprintf(buf, 64, L"设备畸变值为:%.4f", distortion);
|
||||
|
||||
helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)buf, 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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue