Compare commits
6 Commits
52de3e1a64
...
5b86b51d4b
Author | SHA1 | Date |
---|---|---|
yangjiaxuan | 5b86b51d4b | |
13038267101 | 46ae654ac6 | |
13038267101 | af2b076a81 | |
13038267101 | ca96accbbc | |
13038267101 | a93a8dffa4 | |
13038267101 | 7cc2cd6a7c |
|
@ -84,15 +84,15 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si
|
|||
if (data != nullptr)
|
||||
{
|
||||
info = QObject::tr("failed: ") + QString::fromStdWString((const wchar_t*)data);
|
||||
}
|
||||
|
||||
if (m_interface != nullptr)
|
||||
{
|
||||
emit m_interface->testResult(info);
|
||||
}
|
||||
else if (m_burnMode != nullptr)
|
||||
{
|
||||
emit m_burnMode->testResult(flag);
|
||||
if (m_interface != nullptr)
|
||||
{
|
||||
emit m_interface->testResult(info);
|
||||
}
|
||||
else if (m_burnMode != nullptr)
|
||||
{
|
||||
emit m_burnMode->testResult(flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ev == TEST_EVENT_MANUAL_CONFIRMATION)
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LocalDebuggerCommand>ProductionTool.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerWorkingDirectory>C:\Program Files (x86)\HGProductionTool\ProductionTool.exe</LocalDebuggerWorkingDirectory>
|
||||
<LocalDebuggerAttach>true</LocalDebuggerAttach>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerDebuggerType>NativeOnly</LocalDebuggerDebuggerType>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -120,7 +120,10 @@ int get_json_config_file()
|
|||
std::cout << buf << std::endl;
|
||||
}
|
||||
static std::wstring set_test_name_ =L"";
|
||||
bool is_distortion_get_image = false;
|
||||
//bool is_distortion_get_image = false;
|
||||
//bool is_distortion_get_image_abnormal = false;
|
||||
std::atomic<bool> is_distortion_get_image_abnormal(false);
|
||||
std::atomic<bool> is_distortion_get_image(false);
|
||||
class test
|
||||
{
|
||||
ui_helper* helper_;
|
||||
|
@ -372,6 +375,7 @@ public:
|
|||
{
|
||||
type = false;
|
||||
is_distortion_get_image = false;
|
||||
is_distortion_get_image_abnormal = true;
|
||||
wcscpy(buf, L"畸变修正值获取失败,原因--->");
|
||||
}
|
||||
else
|
||||
|
@ -379,9 +383,9 @@ public:
|
|||
is_distortion_get_image = true;
|
||||
//type = true;
|
||||
//wcscpy(buf, L"畸变修正值获取完成:");
|
||||
//break;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
//break;
|
||||
//ret = h->io_control(IO_CTRL_CODE_GET_DPI_COLOR_CHECK_VAL, &close, &closelen);//结束恢复默认
|
||||
}
|
||||
else if (wcscmp(set_test_name_.c_str(), HGPDTTOOLDB_NAME_IMAGE_COLOR_QUALITY) == 0
|
||||
|
@ -563,10 +567,11 @@ public:
|
|||
|
||||
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)
|
||||
|| wcscmp(name, HGPDTTOOLDB_NAME_CONFIGURE_SPEED_MODE) == 0
|
||||
|| wcscmp(name, WRITE_CFG_NAME) == 0)
|
||||
{
|
||||
std::string fw1(get_firmware_version());
|
||||
if (fw1.empty())
|
||||
if (!fw1.empty())
|
||||
{
|
||||
if ("G1" == fw1.substr(0, 2))
|
||||
fw_ = 1;
|
||||
|
@ -594,7 +599,11 @@ public:
|
|||
helper_->test_callback(name, ui_helper::TEST_EVENT_NOT_FIND_TEST, NULL, false);
|
||||
return ret;
|
||||
}
|
||||
if (ret != SCANNER_ERR_OK && ret != -1)
|
||||
if (ret == SCANNER_ERR_DEVICE_NOT_SUPPORT
|
||||
|| ret == SCANNER_ERR_IO
|
||||
|| ret == SCANNER_ERR_TIMEOUT
|
||||
|| ret == SCANNER_ERR_NO_DATA
|
||||
)
|
||||
{
|
||||
helper_->test_callback(name, ui_helper::TEST_EVENT_IO_FAIL, NULL, ret);
|
||||
}
|
||||
|
@ -1000,16 +1009,19 @@ public:
|
|||
else if (cnt == 30)
|
||||
break;
|
||||
|
||||
if (is_distortion_get_image_abnormal)
|
||||
return -1;
|
||||
|
||||
Sleep(1000);
|
||||
cnt++;
|
||||
}
|
||||
if (dis.h > 0 && dis.scaleXY < 10)
|
||||
if (dis.h > 0 && dis.scaleXY < 10)
|
||||
{
|
||||
helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_DISTORTION_VAL, (void *)&dis, 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;
|
||||
}
|
||||
|
@ -1267,6 +1279,8 @@ DECL_API(int) func_test_go(const wchar_t* NAME, const wchar_t* oper, ui_helper*
|
|||
//helper->add_ref(void *data);
|
||||
|
||||
is_distortion_get_image = false;
|
||||
is_distortion_get_image_abnormal = false;
|
||||
|
||||
int ret = 0;
|
||||
SANE_Bool type = false;
|
||||
unsigned int len = sizeof(SANE_Bool);
|
||||
|
|
Loading…
Reference in New Issue