|
|
@ -26,7 +26,7 @@ static struct Test_Map
|
|
|
|
{HGPDTTOOLDB_NAME_SCANNING_SENSOR ,HGPDTTOOLDB_TITLE_SCANNING_SENSOR},
|
|
|
|
{HGPDTTOOLDB_NAME_SCANNING_SENSOR ,HGPDTTOOLDB_TITLE_SCANNING_SENSOR},
|
|
|
|
{HGPDTTOOLDB_NAME_PLACE_CORRECTION_PAPER ,HGPDTTOOLDB_TITLE_PLACE_CORRECTION_PAPER},
|
|
|
|
{HGPDTTOOLDB_NAME_PLACE_CORRECTION_PAPER ,HGPDTTOOLDB_TITLE_PLACE_CORRECTION_PAPER},
|
|
|
|
{HGPDTTOOLDB_NAME_AUTO_FLAT_FIELD ,HGPDTTOOLDB_TITLE_AUTO_FLAT_FIELD},
|
|
|
|
{HGPDTTOOLDB_NAME_AUTO_FLAT_FIELD ,HGPDTTOOLDB_TITLE_AUTO_FLAT_FIELD},
|
|
|
|
{HGPDTTOOLDB_NAME_IMAGE_COLOR_QUALITY ,HGPDTTOOLDB_TITLE_IMAGE_QUALITY},
|
|
|
|
{HGPDTTOOLDB_NAME_IMAGE_COLOR_QUALITY ,HGPDTTOOLDB_TITLE_IMAGE_QUALITY},
|
|
|
|
{HGPDTTOOLDB_NAME_COLORCARD_IMAGEING_QUALITY ,HGPDTTOOLDB_TITLE_COLORCARD_IMAGEING_QUALITY},
|
|
|
|
{HGPDTTOOLDB_NAME_COLORCARD_IMAGEING_QUALITY ,HGPDTTOOLDB_TITLE_COLORCARD_IMAGEING_QUALITY},
|
|
|
|
{HGPDTTOOLDB_NAME_COLORCARD_BIAS_IMAGEING_QUALITY ,HGPDTTOOLDB_TITLE_COLORCARD_BIAS_IMAGEING_QUALITY},
|
|
|
|
{HGPDTTOOLDB_NAME_COLORCARD_BIAS_IMAGEING_QUALITY ,HGPDTTOOLDB_TITLE_COLORCARD_BIAS_IMAGEING_QUALITY},
|
|
|
|
{HGPDTTOOLDB_NAME_CLARITY_QUALITY ,HGPDTTOOLDB_TITLE_CLARITY_QUALITY},
|
|
|
|
{HGPDTTOOLDB_NAME_CLARITY_QUALITY ,HGPDTTOOLDB_TITLE_CLARITY_QUALITY},
|
|
|
@ -39,10 +39,11 @@ static struct Test_Map
|
|
|
|
{HGPDTTOOLDB_NAME_REBOOT_DEVICE ,HGPDTTOOLDB_TITLE_REBOOT_DEVICE},
|
|
|
|
{HGPDTTOOLDB_NAME_REBOOT_DEVICE ,HGPDTTOOLDB_TITLE_REBOOT_DEVICE},
|
|
|
|
{HGPDTTOOLDB_NAME_MECH_PAPER_FEEDING_INCLINATION ,HGPDTTOOLDB_TITLE_MECH_PAPER_FEEDING_INCLINATION},
|
|
|
|
{HGPDTTOOLDB_NAME_MECH_PAPER_FEEDING_INCLINATION ,HGPDTTOOLDB_TITLE_MECH_PAPER_FEEDING_INCLINATION},
|
|
|
|
{HGPDTTOOLDB_NAME_CLEAR_ROLLER_COUNT ,HGPDTTOOLDB_TITLE_CLEAR_ROLLER_COUNT},
|
|
|
|
{HGPDTTOOLDB_NAME_CLEAR_ROLLER_COUNT ,HGPDTTOOLDB_TITLE_CLEAR_ROLLER_COUNT},
|
|
|
|
{HGPDTTOOLDB_NAME_CLEAR_ROLLER_COUNT ,HGPDTTOOLDB_TITLE_CLEAR_ROLLER_COUNT},
|
|
|
|
{HGPDTTOOLDB_NAME_CLEAR_HISTORY_COUNT ,HGPDTTOOLDB_TITLE_CLEAR_HISTORY_COUNT},
|
|
|
|
{HGPDTTOOLDB_NAME_PAPER_SEPARATION_STRENGTH ,HGPDTTOOLDB_TITLE_PAPER_SEPARATION_STRENGTH},
|
|
|
|
{HGPDTTOOLDB_NAME_PAPER_SEPARATION_STRENGTH ,HGPDTTOOLDB_TITLE_PAPER_SEPARATION_STRENGTH},
|
|
|
|
{HGPDTTOOLDB_NAME_CONFIGURE_SPEED_MODE ,HGPDTTOOLDB_TITLE_CONFIGURE_SPEED_MODE},
|
|
|
|
{HGPDTTOOLDB_NAME_CONFIGURE_SPEED_MODE ,HGPDTTOOLDB_TITLE_CONFIGURE_SPEED_MODE},
|
|
|
|
{HGPDTTOOLDB_NAME_DORMANCY ,HGPDTTOOLDB_TITLE_DORMANCY},
|
|
|
|
{HGPDTTOOLDB_NAME_DORMANCY ,HGPDTTOOLDB_TITLE_DORMANCY},
|
|
|
|
|
|
|
|
{HGPDTTOOLDB_NAME_GET_DEVICE_CONFIG ,HGPDTTOOLDB_TITLE_GET_DEVICE_CONFIG}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static std::string StringToUtf(std::string strValue)
|
|
|
|
static std::string StringToUtf(std::string strValue)
|
|
|
@ -867,7 +868,28 @@ public:
|
|
|
|
/* 自动平场校正 */
|
|
|
|
/* 自动平场校正 */
|
|
|
|
int test_auto_flat_field(void *data)
|
|
|
|
int test_auto_flat_field(void *data)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return helper_->io_control(IO_CTRL_CODE_SET_AUTO_FALT, NULL, NULL);;
|
|
|
|
if (!data)
|
|
|
|
|
|
|
|
return SCANNER_ERR_DATA_DAMAGED;
|
|
|
|
|
|
|
|
unsigned int len = sizeof(int);
|
|
|
|
|
|
|
|
wchar_t* p = (wchar_t*)data;
|
|
|
|
|
|
|
|
std::string str;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int ret = SCANNER_ERR_OK,
|
|
|
|
|
|
|
|
dpi_type = 0;
|
|
|
|
|
|
|
|
unsigned int llen = sizeof(int);
|
|
|
|
|
|
|
|
size_t strl = 0;
|
|
|
|
|
|
|
|
ret = wchar_to_char(str, p, &strl);
|
|
|
|
|
|
|
|
if (ret == ERROR_INSUFFICIENT_BUFFER)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
str.resize(strl);
|
|
|
|
|
|
|
|
ret = wchar_to_char(str, p, &strl);
|
|
|
|
|
|
|
|
if (str.empty())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return SCANNER_ERR_DATA_DAMAGED;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
dpi_type = atoi(str.c_str());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return helper_->io_control(IO_CTRL_CODE_SET_AUTO_FALT, &dpi_type, &len);;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* 重启设备 */
|
|
|
|
/* 重启设备 */
|
|
|
|
int test_reboot_device(void *data)
|
|
|
|
int test_reboot_device(void *data)
|
|
|
@ -1075,6 +1097,11 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int setdistortion = *(int*)&distortion;
|
|
|
|
int setdistortion = *(int*)&distortion;
|
|
|
|
int getdistortion = 0;
|
|
|
|
int getdistortion = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//先默认设置1
|
|
|
|
|
|
|
|
int in = 1;
|
|
|
|
|
|
|
|
ret = helper_->io_control(IO_CTRL_CODE_SET_DISTORTION_CHECK_VAL, &in, &len);
|
|
|
|
|
|
|
|
|
|
|
|
ret = helper_->io_control(IO_CTRL_CODE_SET_DISTORTION_CHECK_VAL, &setdistortion, &len);
|
|
|
|
ret = helper_->io_control(IO_CTRL_CODE_SET_DISTORTION_CHECK_VAL, &setdistortion, &len);
|
|
|
|
if (ret != SCANNER_ERR_OK)
|
|
|
|
if (ret != SCANNER_ERR_OK)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1128,6 +1155,30 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 清除历史计数 */
|
|
|
|
|
|
|
|
int test_clear_history_count(void* data)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SANE_Int num = -1;
|
|
|
|
|
|
|
|
const wchar_t* info = NULL;
|
|
|
|
|
|
|
|
bool type = false;
|
|
|
|
|
|
|
|
unsigned int len = sizeof(SANE_Int);
|
|
|
|
|
|
|
|
int ret = helper_->io_control(IO_CTRL_CODE_SET_CLEAR_HISTORY_COUNT, NULL, NULL);
|
|
|
|
|
|
|
|
ret = helper_->io_control(IO_CTRL_CODE_GET_HISTORY_SCAN_NUM, &num, &len);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((num == 0 && num != -1))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
type = true;
|
|
|
|
|
|
|
|
info = L"清除历史计数成功";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
type = false;
|
|
|
|
|
|
|
|
info = L"清除历史计数成功";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)info, type);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
}
|
|
|
|
/* 单张测试 */
|
|
|
|
/* 单张测试 */
|
|
|
|
int test_single_page_test(void* data)
|
|
|
|
int test_single_page_test(void* data)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1250,6 +1301,22 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVEB_GET_DEVICE_CONFIG_SP, (void*)&save_num, true);
|
|
|
|
helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVEB_GET_DEVICE_CONFIG_SP, (void*)&save_num, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string fw(get_firmware_version());
|
|
|
|
|
|
|
|
size_t fwlen= 0;
|
|
|
|
|
|
|
|
wstr.clear();
|
|
|
|
|
|
|
|
ret = str_to_wchar(fw.c_str(), (wchar_t*)wstr.c_str(), &fwlen);
|
|
|
|
|
|
|
|
if (ret == ERROR_INSUFFICIENT_BUFFER)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
wstr.resize(fwlen);
|
|
|
|
|
|
|
|
ret = str_to_wchar(fw.c_str(), (wchar_t*)wstr.c_str(), &fwlen);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (wstr.empty())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVEB_GET_DEVICE_CONFIG_FW, (void*)L"获取固件号失败", false);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVEB_GET_DEVICE_CONFIG_FW, (void*)wstr.c_str(), true);
|
|
|
|
|
|
|
|
|
|
|
|
helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)(L"配置获取完成"), true);
|
|
|
|
helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)(L"配置获取完成"), true);
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|