生产工具增加日志,解决速度模式显示异常的问题
This commit is contained in:
parent
20e8a2279f
commit
5f009ccd27
|
@ -301,7 +301,7 @@ int DeviceManager::getSpeedMode()
|
|||
|
||||
const wchar_t G100[6] = { 70,80,90,110 };
|
||||
const wchar_t G200[6] = { 100,110,120,130 };
|
||||
const wchar_t G300[6] = { 40,50,60,70 };
|
||||
const wchar_t G300[6] = { 40,50,60,70,80 };
|
||||
const wchar_t G400[6] = { 40,50,60,70,80 };
|
||||
|
||||
QString devType = getDevType();
|
||||
|
|
|
@ -687,13 +687,13 @@ QString Form_mainInterface::getSpeedMode()
|
|||
|
||||
const wchar_t G100[6] = { 60,70,80,90,110 };
|
||||
const wchar_t G200[6] = { 90,100,110,120,130 };
|
||||
const wchar_t G300[6] = { 40,50,60,70,80,90 };
|
||||
const wchar_t G300[6] = { 40,50,60,70,80 };
|
||||
const wchar_t G306[6] = { 30,40,50,60,70 };
|
||||
const wchar_t G400[6] = { 40,50,60,70,80 };
|
||||
|
||||
int speed = 0;
|
||||
QString devType = m_devType;
|
||||
if (m_devFwNum.mid(3, 1) == "Z"); //306
|
||||
if (m_devFwNum.mid(3, 1) == "Z") //306
|
||||
{
|
||||
devType = "G306";
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#include "log/log.h"
|
||||
HLOG g_hLog = nullptr;
|
||||
|
||||
const char* oem = "HuaGoScan";
|
||||
|
||||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
g_hLog = EnableLog(nullptr, oem, "app");
|
||||
break;
|
||||
case DLL_THREAD_ATTACH:
|
||||
break;
|
||||
case DLL_THREAD_DETACH:
|
||||
break;
|
||||
case DLL_PROCESS_DETACH:
|
||||
DisableLog(g_hLog);
|
||||
g_hLog = nullptr;
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
|
@ -72,19 +72,23 @@
|
|||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<IncludePath>..\..\..\sdk\include;..\..\app\HGProductionTool\;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)..\..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao\;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);..\..\..\sdk\include;..\..\app\HGProductionTool\;$(IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)x86\$(Configuration)\</OutDir>
|
||||
<IntDir>x86\$(Configuration)\</IntDir>
|
||||
<LibraryPath>$(SolutionDir)..\..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao\;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);..\..\..\sdk\include;..\..\app\HGProductionTool\;</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)..\..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao\;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);..\..\..\sdk\include;..\..\app\HGProductionTool\;</IncludePath>
|
||||
<OutDir>$(SolutionDir)x86\$(Configuration)\</OutDir>
|
||||
<IntDir>x86\$(Configuration)\</IntDir>
|
||||
<LibraryPath>$(SolutionDir)..\..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao\;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
@ -96,6 +100,7 @@
|
|||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>commonlog.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy $(OutDir)test.dll $(SolutionDir)..\..\..\code_app\build2\build\windows\huagao\x86\Debug\</Command>
|
||||
|
@ -115,6 +120,7 @@
|
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>commonlog.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy $(OutDir)test.dll $(SolutionDir)..\..\..\release\win\x86\Release\
|
||||
|
@ -131,6 +137,7 @@ copy $(OutDir)test.dll $(SolutionDir)..\..\..\code_app\build2\build\windows\huag
|
|||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>commonlog.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
@ -147,12 +154,14 @@ copy $(OutDir)test.dll $(SolutionDir)..\..\..\code_app\build2\build\windows\huag
|
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>commonlog.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy $(OutDir)test.dll $(SolutionDir)..\..\..\release\win\x64\Release\</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp" />
|
||||
<ClCompile Include="test_base.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
<ClCompile Include="test_base.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="dllmain.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="test_base.h">
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#include <iostream>
|
||||
#include "huagao/hgscanner_error.h"
|
||||
#include "sane/sane_option_definitions.h";
|
||||
#include "log/log.h"
|
||||
extern HLOG g_hLog;
|
||||
|
||||
test *test_ = nullptr;
|
||||
|
||||
|
@ -144,6 +146,17 @@ std::atomic<bool> is_distortion_get_image(false);
|
|||
int g_currentCorrectType = 0;
|
||||
int g_dynamicCorrectStatus = SCANNER_ERR_OK;
|
||||
|
||||
std::string test::get_serial_num()
|
||||
{
|
||||
std::string sn = "";
|
||||
unsigned int len = 0;
|
||||
int ret = helper_->io_control(IO_CTRL_CODE_GET_SERIAL, &sn[0], &len);
|
||||
sn.resize(len);
|
||||
ret = helper_->io_control(IO_CTRL_CODE_GET_SERIAL, &sn[0], &len);
|
||||
|
||||
return sn;
|
||||
}
|
||||
|
||||
/*设置vid pid*/
|
||||
int test::test_set_vidpid(void* data)
|
||||
{
|
||||
|
@ -246,7 +259,7 @@ int test::test_configure_speed_mode(void* data)
|
|||
bool type = false;
|
||||
const char G139[6] = { 60,70,80,90,110 };
|
||||
const char G239[6] = { 90,100,110,120,130 };
|
||||
const char G300[6] = { 40,50,60,70,80,90 };
|
||||
const char G300[6] = { 40,50,60,70,80 };
|
||||
const char G306[6] = { 30,40,50,60,70 };
|
||||
const char G400[6] = { 40,50,60,70,80 };
|
||||
|
||||
|
@ -583,6 +596,8 @@ test::test(ui_helper* helper)
|
|||
helper_ = helper;
|
||||
helper_->register_sane_callback(sane_ex_callback, NULL);
|
||||
init_test_map_();
|
||||
|
||||
m_sn = get_serial_num();
|
||||
}
|
||||
test::~test()
|
||||
{
|
||||
|
@ -1267,6 +1282,8 @@ int test::test_set_auto_distortion(void* data)
|
|||
if (setdistortion == getdistortion)
|
||||
{
|
||||
helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)L"设置畸变值成功", true);
|
||||
|
||||
InfoLog(g_hLog, "Serial Number: %s, set distortion value: %f", m_sn.c_str(), setdistortion);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1514,7 +1531,7 @@ int test::test_get_device_config(void* data)
|
|||
|
||||
const wchar_t G139[6] = { 60,70,80,90,110 };
|
||||
const wchar_t G239[6] = { 90,100,110,120,130 };
|
||||
const wchar_t G300[6] = { 40,50,60,70,80,90 };
|
||||
const wchar_t G300[6] = { 40,50,60,70,80 };
|
||||
const wchar_t G306[6] = { 30,40,50,60,70 };
|
||||
const wchar_t G400[6] = { 40,50,60,70,80 };
|
||||
SANE_Int num = 0;
|
||||
|
|
|
@ -299,6 +299,7 @@ public:
|
|||
std::mutex m_lock;
|
||||
ui_helper* helper_;
|
||||
int fw_;
|
||||
std::string m_sn;
|
||||
std::mutex mutex_;
|
||||
std::condition_variable cv_;
|
||||
|
||||
|
@ -327,6 +328,8 @@ private:
|
|||
};
|
||||
|
||||
private:
|
||||
std::string get_serial_num();
|
||||
|
||||
/*设置vid pid*/
|
||||
int test_set_vidpid(void* data);
|
||||
/*设置序列号*/
|
||||
|
|
Loading…
Reference in New Issue