From 948063dd41100e0e9354e41663b61195780e75a9 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Mon, 30 May 2022 11:10:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=97=A5=E5=BF=97=EF=BC=8C?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=88=B0=E8=AE=BE=E5=A4=87=E5=B1=82=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=EF=BC=8C=E5=B9=B6=E5=B0=86=E8=B7=AF=E5=BE=84=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E4=B8=BA=E8=AE=BE=E5=A4=87=E5=B1=82=E7=BB=84=E4=BC=AF?= =?UTF-8?q?=E6=89=80=E5=9C=A8=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- device/device.def | 7 ++++++- device/hgscanner.vcxproj | 9 +++++++-- device/hgscanner.vcxproj.filters | 9 +++++++++ device/win_usb/win_usb.cpp | 4 ++-- huagaotwain/huagaotwain.cpp | 11 +---------- protocol/hgsane.vcxproj | 5 +---- protocol/hgsane.vcxproj.filters | 15 +++------------ protocol/sane.def | 3 +-- 8 files changed, 30 insertions(+), 33 deletions(-) diff --git a/device/device.def b/device/device.def index c62a1b4..5dc1d1e 100644 --- a/device/device.def +++ b/device/device.def @@ -14,4 +14,9 @@ EXPORTS hg_scanner_read_img_data hg_scanner_get_status hg_scanner_reset - hg_scanner_control \ No newline at end of file + hg_scanner_control + hg_scanner_set_sane_info + hg_scanner_err_name + hg_scanner_err_description + hg_scanner_log_is_enable + hg_scanner_log \ No newline at end of file diff --git a/device/hgscanner.vcxproj b/device/hgscanner.vcxproj index bcd6456..0743560 100644 --- a/device/hgscanner.vcxproj +++ b/device/hgscanner.vcxproj @@ -102,7 +102,7 @@ Level3 true - WIN32;HGSCANNER_EXPORT;CUSTOM_USBVIEW;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;HGSCANNER_EXPORT;CUSTOM_USBVIEW;BACKEND_NAME=hgdriver;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true 4996 MultiThreadedDebugDLL @@ -132,7 +132,7 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "$(SolutionDir)..\..\sdk\lib\win\$ true true true - WIN32;HGSCANNER_EXPORT;CUSTOM_USBVIEW;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;HGSCANNER_EXPORT;CUSTOM_USBVIEW;BACKEND_NAME=hgdriver;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true 4996 stdcpp17 @@ -251,6 +251,7 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "$(SolutionDir)..\..\sdk\lib\win\$ + @@ -310,6 +311,7 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "$(SolutionDir)..\..\sdk\lib\win\$ + @@ -327,6 +329,9 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "$(SolutionDir)..\..\sdk\lib\win\$ + + + diff --git a/device/hgscanner.vcxproj.filters b/device/hgscanner.vcxproj.filters index cc0c932..7ffcac6 100644 --- a/device/hgscanner.vcxproj.filters +++ b/device/hgscanner.vcxproj.filters @@ -177,6 +177,9 @@ image + + 源文件 + @@ -380,10 +383,16 @@ image + + 头文件 + 源文件 + + + \ No newline at end of file diff --git a/device/win_usb/win_usb.cpp b/device/win_usb/win_usb.cpp index 33aea75..617953a 100644 --- a/device/win_usb/win_usb.cpp +++ b/device/win_usb/win_usb.cpp @@ -16,7 +16,7 @@ #pragma comment(lib, "winusb.lib") #pragma comment(lib, "rpcrt4.lib") -#include "hginclude/hg_log.h" +#include "../wrapper/hg_log.h" #include "scanner_manager.h" // for hg_scanner_mgr::ui_default_callback #include "usbview/enum.h" @@ -189,7 +189,7 @@ std::string usb_device::parent_hub_path_name(int vid, int pid, int *addr) } if (addr) *addr = port; - HG_VLOG_MINI_4(LOG_LEVEL_DEBUG_INFO, "Parent hub for %04X:%04X is: %s (+%d)\r\n", vid, pid, ret.c_str(), port); + VLOG_MINI_4(LOG_LEVEL_DEBUG_INFO, "Parent hub for %04X:%04X is: %s (+%d)\r\n", vid, pid, ret.c_str(), port); return ret; } diff --git a/huagaotwain/huagaotwain.cpp b/huagaotwain/huagaotwain.cpp index b9d3c5c..2be9a65 100644 --- a/huagaotwain/huagaotwain.cpp +++ b/huagaotwain/huagaotwain.cpp @@ -815,16 +815,7 @@ void scanner::load_options(void) op.ind = i; op.desc = desc; - if (desc->name == KNOWN_OPT_NAME_CUSTOM_GAMMA) - { - SANE_Int afterdo = 0; - SANE_Int *v = new SANE_Int[3 * 256]; - - sane_invoker::invoke_sane_control_option(hdev_, i, SANE_ACTION_GET_VALUE, v, &afterdo); - op.val.iv = 0; - delete[] v; - } - else if (desc->type == SANE_Value_Type::SANE_TYPE_BOOL) + if (desc->type == SANE_Value_Type::SANE_TYPE_BOOL) op.val.bv = get_boolean(i); else if (desc->type == SANE_Value_Type::SANE_TYPE_FIXED) op.val.dv = get_double(i); diff --git a/protocol/hgsane.vcxproj b/protocol/hgsane.vcxproj index 5d216f3..6c8578a 100644 --- a/protocol/hgsane.vcxproj +++ b/protocol/hgsane.vcxproj @@ -192,9 +192,7 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "$(SolutionDir)..\..\sdk\lib\win\$ - - @@ -202,18 +200,17 @@ move /Y "$(OutDirFullPath)$(ProjectName).pdb" "$(SolutionDir)..\..\sdk\lib\win\$ - - + diff --git a/protocol/hgsane.vcxproj.filters b/protocol/hgsane.vcxproj.filters index 6fa9b39..9800114 100644 --- a/protocol/hgsane.vcxproj.filters +++ b/protocol/hgsane.vcxproj.filters @@ -18,9 +18,6 @@ 源文件 - - 源文件 - 源文件 @@ -30,9 +27,6 @@ 源文件 - - 源文件 - 源文件 @@ -41,9 +35,6 @@ 头文件 - - 头文件 - 头文件 @@ -65,9 +56,6 @@ 头文件 - - 头文件 - 头文件 @@ -77,6 +65,9 @@ 头文件 + + 头文件 + diff --git a/protocol/sane.def b/protocol/sane.def index afbaa6e..669ddba 100644 --- a/protocol/sane.def +++ b/protocol/sane.def @@ -15,5 +15,4 @@ EXPORTS sane_hgsane_get_select_fd sane_hgsane_strstatus sane_hgsane_init_ex - sane_hgsane_io_control - hg_debug_log \ No newline at end of file + sane_hgsane_io_control \ No newline at end of file