diff --git a/app/HGProductionTool/form_burnmode.cpp b/app/HGProductionTool/form_burnmode.cpp index 0fad821..36c017d 100644 --- a/app/HGProductionTool/form_burnmode.cpp +++ b/app/HGProductionTool/form_burnmode.cpp @@ -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(); diff --git a/app/HGProductionTool/form_maininterface.cpp b/app/HGProductionTool/form_maininterface.cpp index 64d8a54..2f1f5ca 100644 --- a/app/HGProductionTool/form_maininterface.cpp +++ b/app/HGProductionTool/form_maininterface.cpp @@ -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"; } diff --git a/code/base/dllmain.cpp b/code/base/dllmain.cpp new file mode 100644 index 0000000..361d6e7 --- /dev/null +++ b/code/base/dllmain.cpp @@ -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; +} diff --git a/code/base/test.vcxproj b/code/base/test.vcxproj index f94b013..b551617 100644 --- a/code/base/test.vcxproj +++ b/code/base/test.vcxproj @@ -72,19 +72,23 @@ ..\..\..\sdk\include;..\..\app\HGProductionTool\;$(IncludePath) + $(SolutionDir)..\..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao\;$(LibraryPath) $(VC_IncludePath);$(WindowsSDK_IncludePath);..\..\..\sdk\include;..\..\app\HGProductionTool\;$(IncludePath) $(SolutionDir)x86\$(Configuration)\ x86\$(Configuration)\ + $(SolutionDir)..\..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao\;$(LibraryPath) $(VC_IncludePath);$(WindowsSDK_IncludePath);..\..\..\sdk\include;..\..\app\HGProductionTool\; + $(SolutionDir)..\..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao\;$(LibraryPath) $(VC_IncludePath);$(WindowsSDK_IncludePath);..\..\..\sdk\include;..\..\app\HGProductionTool\; $(SolutionDir)x86\$(Configuration)\ x86\$(Configuration)\ + $(SolutionDir)..\..\..\sdk\lib\win\$(PlatformTarget)\$(Configuration);$(ProjectDir)..\..\..\sdk\lib\win\$(PlatformTarget)\oem\huagao\;$(LibraryPath) @@ -96,6 +100,7 @@ Console true + commonlog.lib;%(AdditionalDependencies) copy $(OutDir)test.dll $(SolutionDir)..\..\..\code_app\build2\build\windows\huagao\x86\Debug\ @@ -115,6 +120,7 @@ true true true + commonlog.lib;%(AdditionalDependencies) copy $(OutDir)test.dll $(SolutionDir)..\..\..\release\win\x86\Release\ @@ -131,6 +137,7 @@ copy $(OutDir)test.dll $(SolutionDir)..\..\..\code_app\build2\build\windows\huag Console true + commonlog.lib;%(AdditionalDependencies) @@ -147,12 +154,14 @@ copy $(OutDir)test.dll $(SolutionDir)..\..\..\code_app\build2\build\windows\huag true true true + commonlog.lib;%(AdditionalDependencies) copy $(OutDir)test.dll $(SolutionDir)..\..\..\release\win\x64\Release\ + diff --git a/code/base/test.vcxproj.filters b/code/base/test.vcxproj.filters index 0356207..cb715ea 100644 --- a/code/base/test.vcxproj.filters +++ b/code/base/test.vcxproj.filters @@ -18,6 +18,9 @@ 源文件 + + 源文件 + diff --git a/code/base/test_base.cpp b/code/base/test_base.cpp index 5196caf..aa24b5b 100644 --- a/code/base/test_base.cpp +++ b/code/base/test_base.cpp @@ -5,6 +5,8 @@ #include #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 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; diff --git a/code/base/test_base.h b/code/base/test_base.h index d888274..23b2bb4 100644 --- a/code/base/test_base.h +++ b/code/base/test_base.h @@ -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); /*设置序列号*/