This commit is contained in:
13038267101 2023-05-17 11:23:29 +08:00
commit 69f9249692
2 changed files with 44 additions and 34 deletions

View File

@ -27,7 +27,7 @@
// #define BRAND_TITLE_URL "公司网址"
#define BRAND_TITLE_URL "\345\205\254\345\217\270\347\275\221\345\235\200"
#define BRAND_COMPANY_URL "www.hw99.com"
#define BRAND_URL_COMPANY_URL "https://www.hw99.com/"
#define BRAND_URL_COMPANY_URL "https://www.hw99.com"
// #define BRAND_TITLE_TEL "联系电话"
#define BRAND_TITLE_TEL "\350\201\224\347\263\273\347\224\265\350\257\235"
#define BRAND_COMPANY_TEL "(010)82786854"
@ -59,7 +59,7 @@
// #define BRAND_TITLE_URL "公司网址"
#define BRAND_TITLE_URL "\345\205\254\345\217\270\347\275\221\345\235\200"
#define BRAND_COMPANY_URL "www.lanxum.com"
#define BRAND_URL_COMPANY_URL "http://www.lanxum.com/"
#define BRAND_URL_COMPANY_URL "http://www.lanxum.com"
// #define BRAND_TITLE_TEL "联系电话"
#define BRAND_TITLE_TEL "\350\201\224\347\263\273\347\224\265\350\257\235"
#define BRAND_COMPANY_TEL "+86 010 82736600"
@ -90,7 +90,7 @@
// #define BRAND_TITLE_URL "公司网址"
#define BRAND_TITLE_URL "\345\205\254\345\217\270\347\275\221\345\235\200"
#define BRAND_COMPANY_URL "www.cumtenn.com"
#define BRAND_URL_COMPANY_URL "http://www.cumtenn.com/"
#define BRAND_URL_COMPANY_URL "http://www.cumtenn.com"
//#define BRAND_TITLE_TEL "联系电话"
#define BRAND_TITLE_TEL "\350\201\224\347\263\273\347\224\265\350\257\235"
#define BRAND_COMPANY_TEL "400-008-1300"
@ -183,7 +183,7 @@
// #define BRAND_TITLE_URL "公司网址"
#define BRAND_TITLE_URL "\345\205\254\345\217\270\347\275\221\345\235\200"
#define BRAND_COMPANY_URL "www.huagaochina.com"
#define BRAND_URL_COMPANY_URL "http://www.huagaochina.com/"
#define BRAND_URL_COMPANY_URL "http://www.huagaochina.com"
// #define BRAND_TITLE_TEL "联系电话"
#define BRAND_TITLE_TEL "\350\201\224\347\263\273\347\224\265\350\257\235"
#define BRAND_COMPANY_TEL "+86 0574 27974866"

View File

@ -357,35 +357,42 @@ namespace local_utility
//TRY_MATCH(DRIVER_LOG);
//TRY_MATCH(DEVICE_LOG);
}
static std::string un_json_option_name(int id)
static std::string un_json_option_name(int id, int *len)
{
#define FIX_ID_TO_NAME(fid) \
if(id == SANE_OPT_ID_##fid) \
return SANE_STD_OPT_NAME_##fid;
int tmp = sizeof(int);
if (!len)
len = &tmp;
FIX_ID_TO_NAME(HISTORY_COUNT);
FIX_ID_TO_NAME(DRIVER_VERSION);
FIX_ID_TO_NAME(MANUFACTURER);
FIX_ID_TO_NAME(COPYRIGHT);
FIX_ID_TO_NAME(CO_URL);
FIX_ID_TO_NAME(CO_TEL);
FIX_ID_TO_NAME(CO_ADDR);
FIX_ID_TO_NAME(CO_GPS);
FIX_ID_TO_NAME(VID);
FIX_ID_TO_NAME(PID);
FIX_ID_TO_NAME(DEV_NAME);
FIX_ID_TO_NAME(DEV_FAMILY);
FIX_ID_TO_NAME(ROLLER_COUNT);
FIX_ID_TO_NAME(HELP);
FIX_ID_TO_NAME(LOGIN);
FIX_ID_TO_NAME(LOGOUT);
FIX_ID_TO_NAME(DRIVER_LOG);
FIX_ID_TO_NAME(DEVICE_LOG);
#define FIX_ID_TO_NAME(fid, l) \
if(id == SANE_OPT_ID_##fid) \
{ \
*len = l; \
return SANE_STD_OPT_NAME_##fid; \
}
FIX_ID_TO_NAME(DEVICE_SERIAL_NO);
FIX_ID_TO_NAME(FIRMWARE_VERSION);
FIX_ID_TO_NAME(DEVICE_IP_ADDR);
FIX_ID_TO_NAME(DEVICE_MAC_ADDR);
FIX_ID_TO_NAME(HISTORY_COUNT, sizeof(int));
FIX_ID_TO_NAME(DRIVER_VERSION, 255);
FIX_ID_TO_NAME(MANUFACTURER, 255);
FIX_ID_TO_NAME(COPYRIGHT, 255);
FIX_ID_TO_NAME(CO_URL, 255);
FIX_ID_TO_NAME(CO_TEL, 255);
FIX_ID_TO_NAME(CO_ADDR, 255);
FIX_ID_TO_NAME(CO_GPS, 255);
FIX_ID_TO_NAME(VID, sizeof(int));
FIX_ID_TO_NAME(PID, sizeof(int));
FIX_ID_TO_NAME(DEV_NAME, 255);
FIX_ID_TO_NAME(DEV_FAMILY, 255);
FIX_ID_TO_NAME(ROLLER_COUNT, sizeof(int));
FIX_ID_TO_NAME(HELP, sizeof(int));
FIX_ID_TO_NAME(LOGIN, 255);
FIX_ID_TO_NAME(LOGOUT, 255);
FIX_ID_TO_NAME(DRIVER_LOG, 255);
FIX_ID_TO_NAME(DEVICE_LOG, 255);
FIX_ID_TO_NAME(DEVICE_SERIAL_NO, 255);
FIX_ID_TO_NAME(FIRMWARE_VERSION, 255);
FIX_ID_TO_NAME(DEVICE_IP_ADDR, 255);
FIX_ID_TO_NAME(DEVICE_MAC_ADDR, 255);
return "";
}
@ -1344,13 +1351,15 @@ bool hg_sane_middleware::get_current_value(scanner_handle handle, const void* op
{
if (IS_PTR_NUMBER(option))
{
int id = (int)(uint64_t)option;
std::string name(local_utility::un_json_option_name(id));
int id = (int)(uint64_t)option,
l = 0;
std::string name(local_utility::un_json_option_name(id, &l));
if(!name.empty())
{
char buf[256] = { 0 };
long len = sizeof(buf) - 1;
memcpy(buf, value, l);
if (hg_scanner_get_parameter(handle, name.c_str(), buf, &len) == SCANNER_ERR_OK)
{
setv(buf, len, value);
@ -1769,8 +1778,9 @@ SANE_Status hg_sane_middleware::set_option(SANE_Handle h, const void* option, SA
{
if (IS_PTR_NUMBER(option))
{
int id = (int)(uint64_t)option;
std::string name(local_utility::un_json_option_name(id));
int id = (int)(uint64_t)option,
l = 0;
std::string name(local_utility::un_json_option_name(id, &l));
if (!name.empty())
return local_utility::scanner_err_2_sane_statu(hg_scanner_set_parameter(handle, name.c_str(), value, 0));
}