为属性添加用户权限字段

This commit is contained in:
gb 2023-11-13 10:29:02 +08:00
parent 4d98cda06f
commit c1d3c35dbc
9 changed files with 227 additions and 53 deletions

View File

@ -6,6 +6,7 @@
"desc": "恢复默认设置",
"type": "button",
"fix-id": 34921,
"auth": 0,
"size": 4
},
"help": {
@ -15,6 +16,7 @@
"desc": "显示软件帮助文档",
"type": "button",
"fix-id": 34897,
"auth": 0,
"size": 4
},
"is-multiout": {
@ -24,6 +26,7 @@
"desc": "同时输出多种颜色模式的图像",
"type": "bool",
"fix-id": 34817,
"auth": 0,
"size": 4,
"cur": false,
"default": false
@ -35,6 +38,7 @@
"desc": "选择多流输出的类型",
"type": "string",
"fix-id": 34818,
"auth": 0,
"enabled": false,
"size": 66,
"cur": "彩色+灰度+黑白",
@ -49,6 +53,7 @@
"desc": "选择色彩模式",
"type": "string",
"fix-id": 34819,
"auth": 0,
"size": 24,
"cur": "24位彩色",
"default": "24位彩色",
@ -62,6 +67,7 @@
"desc": "高于该阈值为1低于该阈值为0",
"type": "int",
"fix-id": 34870,
"auth": 0,
"size": 4,
"cur": 127,
"default": 127,
@ -79,6 +85,7 @@
"desc": "输出的黑白图像以“1”代表黑色“0”代表白色",
"type": "bool",
"fix-id": 34878,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -91,6 +98,7 @@
"desc": "消除或增强指定色彩",
"type": "string",
"fix-id": 34820,
"auth": 0,
"enabled": false,
"size": 42,
"cur": "不除色",
@ -105,6 +113,7 @@
"desc": "同时输出彩色图像和灰度除红图像",
"type": "bool",
"fix-id": 34821,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -117,6 +126,7 @@
"desc": "输出除红彩色图像",
"type": "bool",
"fix-id": 34822,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -129,6 +139,7 @@
"desc": "移除文稿背景底色",
"type": "bool",
"fix-id": 34823,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -141,6 +152,7 @@
"desc": "与背景底色偏差在该值范围内的颜色,都将被移除",
"type": "int",
"fix-id": 34824,
"auth": 0,
"enabled": false,
"size": 4,
"cur": 20,
@ -159,6 +171,7 @@
"desc": "选择锐化效果或模糊效果",
"type": "string",
"fix-id": 34825,
"auth": 0,
"size": 20,
"cur": "无",
"default": "无",
@ -172,6 +185,7 @@
"desc": "去除图像中的摩尔纹",
"type": "bool",
"fix-id": 34826,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -184,6 +198,7 @@
"desc": "去除图像中的网纹",
"type": "bool",
"fix-id": 34827,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -196,6 +211,7 @@
"desc": "以点阵形式构建图像",
"type": "bool",
"fix-id": 34828,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -208,6 +224,7 @@
"desc": "去除图像中的孤立黑点",
"type": "bool",
"fix-id": 34829,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -220,6 +237,7 @@
"desc": "设置需要去除的黑色孤立点的连通个数",
"type": "int",
"fix-id": 34830,
"auth": 0,
"size": 4,
"cur": 10,
"default": 10,
@ -237,6 +255,7 @@
"desc": "设置出图大小",
"type": "string",
"fix-id": 34831,
"auth": 0,
"size": 44,
"cur": "匹配原始尺寸",
"default": "匹配原始尺寸",
@ -255,6 +274,7 @@
"desc": "以毫米为单位的纸张宽",
"type": "float",
"fix-id": 34922,
"auth": 0,
"unit": "mm",
"readonly": true,
"visible": 1,
@ -270,6 +290,7 @@
"desc": "以毫米为单位的纸张高",
"type": "float",
"fix-id": 34923,
"auth": 0,
"unit": "mm",
"readonly": true,
"visible": 1,
@ -285,6 +306,7 @@
"desc": "横向放置纸张",
"type": "bool",
"fix-id": 34924,
"auth": 0,
"affect": 6,
"visible": 0,
"size": 4,
@ -299,6 +321,7 @@
"desc": "自定义扫描区域",
"type": "bool",
"fix-id": 34832,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -311,6 +334,7 @@
"desc": "自定义扫描区域左上角x坐标",
"type": "float",
"fix-id": 34833,
"auth": 0,
"unit": "mm",
"size": 8,
"cur": 0.000000,
@ -329,6 +353,7 @@
"desc": "自定义扫描区域右下角x坐标",
"type": "float",
"fix-id": 34834,
"auth": 0,
"unit": "mm",
"size": 8,
"cur": 210.000000,
@ -347,6 +372,7 @@
"desc": "自定义扫描区域左上角y坐标",
"type": "float",
"fix-id": 34835,
"auth": 0,
"unit": "mm",
"size": 8,
"cur": 0.000000,
@ -365,6 +391,7 @@
"desc": "自定义扫描区域右下角y坐标",
"type": "float",
"fix-id": 34836,
"auth": 0,
"unit": "mm",
"size": 8,
"cur": 297.000000,
@ -383,6 +410,7 @@
"desc": "检测纸张实际尺寸与设置是否匹配",
"type": "bool",
"fix-id": 34837,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -395,6 +423,7 @@
"desc": "设置页面扫描方式",
"type": "string",
"fix-id": 34838,
"auth": 0,
"size": 12,
"cur": "双面",
"default": "双面",
@ -407,6 +436,7 @@
"desc": "",
"type": "bool",
"fix-id": 34919,
"auth": 0,
"size": 4,
"cur": false,
"default": false
@ -418,6 +448,7 @@
"desc": "数值越大,则越容易跳过",
"type": "int",
"fix-id": 34839,
"auth": 0,
"size": 4,
"cur": 30,
"default": 30,
@ -435,6 +466,7 @@
"desc": "",
"type": "string",
"fix-id": 34887,
"auth": 0,
"size": 16,
"cur": "左右对折",
"default": "左右对折",
@ -448,6 +480,7 @@
"desc": "设置扫描图像的分辨率",
"type": "int",
"fix-id": 34840,
"auth": 0,
"size": 4,
"cur": 200,
"default": 200,
@ -467,6 +500,7 @@
"desc": "选择扫描仪的画质模式",
"type": "string",
"fix-id": 34841,
"auth": 0,
"size": 16,
"cur": "画质优先",
"default": "画质优先",
@ -480,6 +514,7 @@
"desc": "交换每张文稿的正反面出图顺序",
"type": "bool",
"fix-id": 34842,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -492,6 +527,7 @@
"desc": "自定义图像色调效果",
"type": "bool",
"fix-id": 34845,
"auth": 0,
"size": 4,
"cur": false,
"default": false
@ -503,6 +539,7 @@
"desc": "调整图像亮度",
"type": "int",
"fix-id": 34846,
"auth": 0,
"size": 4,
"cur": 128,
"default": 128,
@ -520,6 +557,7 @@
"desc": "调整图像对比度",
"type": "int",
"fix-id": 34847,
"auth": 0,
"size": 4,
"cur": 4,
"default": 4,
@ -537,6 +575,7 @@
"desc": "调整图像伽玛值",
"type": "float",
"fix-id": 34848,
"auth": 0,
"size": 8,
"cur": 1.000000,
"default": 1.000000,
@ -554,6 +593,7 @@
"desc": "色彩还原度矫正功能",
"type": "bool",
"fix-id": 34888,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -566,6 +606,7 @@
"desc": "自动纠正歪斜送入的文稿图像",
"type": "bool",
"fix-id": 34844,
"auth": 0,
"size": 4,
"cur": true,
"default": true,
@ -578,6 +619,7 @@
"desc": "自动拆分图像",
"type": "bool",
"fix-id": 34843,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -590,6 +632,7 @@
"desc": "消除文稿范围外的黑色背景",
"type": "bool",
"fix-id": 34849,
"auth": 0,
"size": 4,
"cur": true,
"default": true
@ -601,6 +644,7 @@
"desc": "选择背景填充方式",
"type": "string",
"fix-id": 34854,
"auth": 0,
"size": 16,
"cur": "凸多边形",
"default": "凸多边形",
@ -614,6 +658,7 @@
"desc": "启用后黑框部分将填充为文稿底色",
"type": "bool",
"fix-id": 34859,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -626,6 +671,7 @@
"desc": "文稿底色与黑色背景灰度值的差值大于该值,才会被识别为文稿",
"type": "int",
"fix-id": 34851,
"auth": 0,
"size": 4,
"cur": 40,
"default": 40,
@ -643,6 +689,7 @@
"desc": "能够容忍的背景杂色条纹的宽度",
"type": "int",
"fix-id": 34852,
"auth": 0,
"size": 4,
"cur": 8,
"default": 8,
@ -660,6 +707,7 @@
"desc": "寻找文稿边缘时对边缘的侵入程度",
"type": "int",
"fix-id": 34853,
"auth": 0,
"size": 4,
"cur": 5,
"default": 5,
@ -677,6 +725,7 @@
"desc": "启用该模式防止深色底色的文稿图像被误处理",
"type": "bool",
"fix-id": 34850,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -689,6 +738,7 @@
"desc": "防止背面图案渗透",
"type": "bool",
"fix-id": 34855,
"auth": 0,
"size": 4,
"cur": false,
"default": false
@ -700,6 +750,7 @@
"desc": "选择防止渗透的等级",
"type": "string",
"fix-id": 34856,
"auth": 0,
"size": 12,
"cur": "较弱",
"default": "较弱",
@ -713,6 +764,7 @@
"desc": "启用后,文稿放入扫描仪时将自动启动扫描",
"type": "bool",
"fix-id": 34873,
"auth": 0,
"size": 4,
"cur": false,
"default": false
@ -724,6 +776,7 @@
"desc": "设置结束待纸扫描的时间",
"type": "string",
"fix-id": 34920,
"auth": 0,
"size": 16,
"cur": "60s",
"default": "60s",
@ -737,6 +790,7 @@
"desc": "选择指定数量扫描或连续扫描",
"type": "string",
"fix-id": 34862,
"auth": 0,
"size": 24,
"cur": "连续扫描",
"default": "连续扫描",
@ -750,6 +804,7 @@
"desc": "扫描指定数量",
"type": "int",
"fix-id": 34863,
"auth": 0,
"size": 4,
"cur": 1,
"default": 1,
@ -762,6 +817,7 @@
"desc": "设置图像的方向",
"type": "string",
"fix-id": 34864,
"auth": 0,
"size": 32,
"cur": "0°",
"default": "0°",
@ -774,6 +830,7 @@
"desc": "背面扫描的图像旋转180°",
"type": "bool",
"fix-id": 34865,
"auth": 0,
"size": 4,
"cur": false,
"default": false,
@ -786,6 +843,7 @@
"desc": "检测是否出现双张送入",
"type": "bool",
"fix-id": 34860,
"auth": 0,
"size": 4,
"cur": true,
"default": true
@ -797,6 +855,7 @@
"desc": "检测到双张进纸后的处理方式",
"type": "string",
"fix-id": 34872,
"auth": 0,
"size": 32,
"cur": "丢弃图像并停止扫描",
"default": "丢弃图像并停止扫描",
@ -810,6 +869,7 @@
"desc": "检测是否出现粘连送入",
"type": "bool",
"fix-id": 34861,
"auth": 0,
"size": 4,
"cur": false,
"default": false
@ -821,6 +881,7 @@
"desc": "检测是否出现歪斜送入",
"type": "bool",
"fix-id": 34868,
"auth": 0,
"size": 4,
"cur": true,
"default": true
@ -832,6 +893,7 @@
"desc": "值越小,能容忍得送入文稿歪斜角度越小",
"type": "int",
"fix-id": 34869,
"auth": 0,
"size": 4,
"cur": 3,
"default": 3,
@ -849,6 +911,7 @@
"desc": "检测文稿是否存在折角",
"type": "bool",
"fix-id": 34866,
"auth": 0,
"size": 4,
"cur": false,
"default": false
@ -860,6 +923,7 @@
"desc": "值越小,能检测到的折角越小",
"type": "int",
"fix-id": 34867,
"auth": 0,
"size": 4,
"cur": 70,
"default": 70,
@ -877,6 +941,7 @@
"desc": "扫描仪自动修正分纸力度",
"type": "bool",
"fix-id": 34876,
"auth": 0,
"size": 4,
"cur": false,
"default": false
@ -888,6 +953,7 @@
"desc": "高于该值时扫描仪将调整分纸力度",
"type": "float",
"fix-id": 34877,
"auth": 0,
"size": 8,
"cur": 0.100000,
"default": 0.100000,
@ -905,6 +971,7 @@
"desc": "设置扫描仪的分纸力度",
"type": "string",
"fix-id": 34874,
"auth": 0,
"size": 12,
"cur": "一般",
"default": "一般",
@ -918,6 +985,7 @@
"desc": "设置扫描仪的休眠时间",
"type": "string",
"fix-id": 34875,
"auth": 0,
"size": 16,
"cur": "不休眠",
"default": "不休眠",
@ -930,6 +998,7 @@
"desc": "扫描仪使用以来扫描纸张总数",
"type": "int",
"fix-id": 34889,
"auth": 0,
"readonly": true,
"size": 4,
"auto": false,
@ -944,6 +1013,7 @@
"desc": "设备制造商在USB组织的ID",
"type": "int",
"fix-id": 34898,
"auth": 0,
"readonly": true,
"size": 4,
"auto": false,
@ -957,6 +1027,7 @@
"desc": "设备在USB组织中的产品ID",
"type": "int",
"fix-id": 34899,
"auth": 0,
"readonly": true,
"size": 4,
"auto": false,
@ -970,6 +1041,7 @@
"desc": "设备名称",
"type": "string",
"fix-id": 34900,
"auth": 0,
"readonly": true,
"size": 96,
"auto": false,
@ -983,6 +1055,7 @@
"desc": "设备所属产品系列名称",
"type": "string",
"fix-id": 34901,
"auth": 0,
"readonly": true,
"size": 96,
"auto": false,
@ -996,6 +1069,7 @@
"desc": "设备序列号",
"type": "string",
"fix-id": 34902,
"auth": 0,
"readonly": true,
"size": 96,
"auto": false,
@ -1010,6 +1084,7 @@
"desc": "设备固件版本号",
"type": "string",
"fix-id": 34903,
"auth": 0,
"readonly": true,
"size": 96,
"auto": false,
@ -1024,6 +1099,7 @@
"desc": "设备联网时所分配的IP地址",
"type": "string",
"fix-id": 34904,
"auth": 0,
"readonly": true,
"size": 96,
"auto": false,
@ -1038,6 +1114,7 @@
"desc": "设备网卡地址",
"type": "string",
"fix-id": 34905,
"auth": 0,
"readonly": true,
"size": 96,
"auto": false,
@ -1052,6 +1129,7 @@
"desc": "该设备滚轴过纸的最大张数",
"type": "int",
"fix-id": 34907,
"auth": 0,
"readonly": true,
"size": 4,
"auto": false,
@ -1065,6 +1143,7 @@
"desc": "设备上是否有纸",
"type": "bool",
"fix-id": 34912,
"auth": 0,
"readonly": true,
"size": 4,
"auto": false,
@ -1079,6 +1158,7 @@
"desc": "当前滚轴已经过纸张数",
"type": "int",
"fix-id": 39170,
"auth": 0,
"readonly": true,
"size": 4,
"auto": false,
@ -1093,6 +1173,7 @@
"desc": "设备工作日志",
"type": "string",
"fix-id": 39172,
"auth": 0,
"visible": 1,
"size": 256,
"auto": false,

View File

@ -7,7 +7,7 @@
#include "afxdialogex.h"
#include "resource.h"
#include "../../../../code_device/hgdriver/hgdev/user-opt/simple_logic.h"
#include "../../../../code_device/sdk/sane_opt_json/simple_logic.h"
#include "opt_ui/DlgPage.h" // for u2a
// CDlgCondition 对话框

View File

@ -26,7 +26,7 @@ static std::string device_opt_json[] = {
#include "../../../../code_device/sdk/hginclude/huagaoxxx_warraper_ex.h"
#include "opt_ui/DlgSetting.h"
#include "../../../../code_device/hgsane/sane_opt/sane_opts.h"
#include "../../../../code_device/hgdriver/hgdev/user-opt/device_opt.h"
#include "../../../../code_device/sdk/sane_opt_json/device_opt.h"
namespace known_name
{
@ -275,6 +275,38 @@ namespace known_name
{
return str[0] >= L'a' && str[0] <= L'z' && str.length() == lstrlenW(str.c_str());
}
// 普通权限;管理员;技术支持;开发者;
struct
{
std::wstring title;
int auth;
}
g_auth[] = { {L"\u666E\u901A\u6743\u9650", USER_PRIVILEGE_COMMON}
, {L"\u7BA1\u7406\u5458", USER_PRIVILEGE_LOCAL_MGR}
, {L"\u6280\u672F\u652F\u6301", USER_PRIVILEGE_TECH_SUPPORTING}
, {L"\u5F00\u53D1\u8005", USER_PRIVILEGE_DEVLOPER}
};
static std::wstring auth_to_title(int auth)
{
for (auto& v : g_auth)
{
if (v.auth == auth)
return v.title;
}
return g_auth[0].title;
}
static int auth_from_title(const wchar_t* title)
{
for (auto& v : g_auth)
{
if (v.title == title)
return v.auth;
}
return g_auth[0].auth;
}
};
@ -315,6 +347,7 @@ known_file_util::IJsonW* CDlgOptJson::SANEOPT::to_json(void)
jsn->set_value(L"pos", pos);
if(fix_id > SANE_OPT_ID_BASE)
jsn->set_value(L"fix-id", fix_id);
jsn->set_value(L"auth", auth);
SANEOPT::affect_str(nv, affect, false);
if(nv)
jsn->set_value(L"affect", nv);
@ -719,6 +752,9 @@ bool CDlgOptJson::SANEOPT::from_json(known_file_util::IJsonW* jsn)
jsn->get_value(L"size", size);
if (!jsn->get_value(L"auth", auth))
auth = USER_PRIVILEGE_COMMON;
if (type == L"bool")
{
bool v = false;
@ -1227,6 +1263,7 @@ void CDlgOptJson::SANEOPT::init(struct _sane_opt_json* opt)
opt->type = L"int";
opt->ver = 1;
opt->fix_id = 0;
opt->auth = USER_PRIVILEGE_COMMON;
opt->pos = -1;
opt->readonly = false;
opt->visible.clear();
@ -1321,6 +1358,7 @@ void CDlgOptJson::from_ui(SANEOPT& sop)
sop.visible.push_back(*pcv);
}
sop.range_type = get_item_text(IDC_COMBO_RANGE);
sop.auth = known_name::auth_from_title(get_item_text(IDC_COMBO_AUTH).c_str());
if (GetDlgItem(IDC_EDIT_DEFAULT)->IsWindowVisible())
val = get_item_text(IDC_EDIT_DEFAULT);
@ -1329,7 +1367,16 @@ void CDlgOptJson::from_ui(SANEOPT& sop)
sop.size = GetDlgItemInt(IDC_EDIT_SIZE);
sop.def_val.clear(); // FIXED me to support multi-value!!!
if (sop.type == L"bool")
if (val.find(L"=") == 0)
{
// consitant with another option
CONDVAL cv;
cv.cond = "";
cv.val = std::string((const char*)val.c_str(), val.length() * 2 + 2);
sop.def_val.push_back(cv);
}
else if (sop.type == L"bool")
{
bool v = val == L"true";
CONDVAL cv;
@ -1411,6 +1458,10 @@ void CDlgOptJson::to_ui(const SANEOPT& sop)
n = type_.FindStringExact(-1, sop.type.c_str());
type_.SetCurSel(n);
CComboBox* auth = (CComboBox*)GetDlgItem(IDC_COMBO_AUTH);
n = auth->FindStringExact(-1, known_name::auth_to_title(sop.auth).c_str());
auth->SetCurSel(n);
SetDlgItemInt(IDC_EDIT_POSITION, sop.pos);
//SetDlgItemInt(IDC_EDIT_FIXED_ID, sop.fix_id);
fix_id_edit_.set_value(sop.fix_id);
@ -1466,30 +1517,46 @@ void CDlgOptJson::to_ui(const SANEOPT& sop)
OnCbnDependSelchange();
// default value ...
std::wstring def(L"");
if (sop.type == L"bool")
{
bool bv = false;
for (auto& v : sop.def_val)
{
bv = *(bool*)v.val.c_str();
if (v.cond == "default")
break;
}
GetDlgItem(IDC_EDIT_DEFAULT)->ShowWindow(SW_HIDE);
def_val_.ShowWindow(SW_SHOW);
def_val_.ResetContent();
def_val_.AddString(L"false");
def_val_.AddString(L"true");
def_val_.SetCurSel(def_val_.FindStringExact(-1, bv ? L"true" : L"false"));
for (auto& v : sop.def_val)
{
if (v.val.length() > sizeof(bool) && v.val[0] == '=')
{
std::wstring t((const wchar_t*)v.val.c_str());
def_val_.AddString(t.c_str());
if (v.cond == "default")
def = t;
}
else if (v.cond == "default")
def = *(bool*)v.val.c_str() ? L"true" : L"false";
}
GetDlgItem(IDC_EDIT_DEFAULT)->ShowWindow(SW_HIDE);
def_val_.ShowWindow(SW_SHOW);
def_val_.SetCurSel(def_val_.FindStringExact(-1, def.c_str()));
}
else if (sop.type == L"int")
{
int nv = 0;
for (auto& v : sop.def_val)
{
nv = *(int*)v.val.c_str();
if (v.cond == "default")
{
if (v.val.length() > sizeof(nv) && v.val[0] == '=')
{
def = (const wchar_t*)v.val.c_str();
}
else
{
nv = *(int*)v.val.c_str();
def = std::to_wstring(nv);
}
break;
}
}
if (sop.range_type == L"list")
{
@ -1498,14 +1565,21 @@ void CDlgOptJson::to_ui(const SANEOPT& sop)
def_val_.ResetContent();
for (auto& v : sop.range)
{
def_val_.AddString(std::to_wstring(*(int*)v.val.c_str()).c_str());
if (v.val.length() > sizeof(nv) && v.val[0] == '=')
{
def_val_.AddString((const wchar_t*)v.val.c_str());
}
else
{
def_val_.AddString(std::to_wstring(*(int*)v.val.c_str()).c_str());
}
}
def_val_.SetCurSel(def_val_.FindStringExact(-1, std::to_wstring(nv).c_str()));
def_val_.SetCurSel(def_val_.FindStringExact(-1, def.c_str()));
}
else
{
GetDlgItem(IDC_EDIT_DEFAULT)->ShowWindow(SW_SHOW);
SetDlgItemInt(IDC_EDIT_DEFAULT, nv);
SetDlgItemText(IDC_EDIT_DEFAULT, def.c_str());
def_val_.ShowWindow(SW_HIDE);
}
}
@ -1514,9 +1588,19 @@ void CDlgOptJson::to_ui(const SANEOPT& sop)
double dbv = 0;
for (auto& v : sop.def_val)
{
dbv = *(double*)v.val.c_str();
if (v.cond == "default")
{
if (v.val[0] == '=' && lstrlenW((const wchar_t*)v.val.c_str()) == v.val.length() - 2)
{
def = (const wchar_t*)v.val.c_str();
}
else
{
dbv = *(double*)v.val.c_str();
def = std::to_wstring(dbv);
}
break;
}
}
if (sop.range_type == L"list")
{
@ -1525,7 +1609,14 @@ void CDlgOptJson::to_ui(const SANEOPT& sop)
def_val_.ResetContent();
for (auto& v : sop.range)
{
def_val_.AddString(std::to_wstring(*(double*)v.val.c_str()).c_str());
if (v.val[0] == '=' && lstrlenW((const wchar_t*)v.val.c_str()) == v.val.length() - 2)
{
def_val_.AddString((const wchar_t*)v.val.c_str());
}
else
{
def_val_.AddString(std::to_wstring(*(double*)v.val.c_str()).c_str());
}
}
def_val_.SetCurSel(def_val_.FindStringExact(-1, std::to_wstring(dbv).c_str()));
}
@ -1899,6 +1990,7 @@ BOOL CDlgOptJson::OnInitDialog()
tooltips_->add_tool_tip_for_ctrl(::GetDlgItem(m_hWnd, IDC_COMBO_AFFECT), L"\u8BE5\u5C5E\u6027\u503C\u53D1\u751F\u6539\u53D8\u540E\uFF0C\u662F\u5426\u5F71\u54CD\u5176\u5B83\u5C5E\u6027\u6216\u8005\u56FE\u50CF\u53C2\u6570\uFF1F");
tooltips_->add_tool_tip_for_ctrl(::GetDlgItem(m_hWnd, IDC_COMBO_CATEGORY), L"\u5C5E\u6027\u5206\u7C7B\u3002\u5982\u679C\u4E3A\u56FE\u50CF\u5206\u7C7B\uFF0C\u4F1A\u6309\u7167\u201Cposition\u201D\u503C\u6392\u5E8F\uFF0C\u4EE5\u786E\u5B9A\u6267\u884C\u7684\u5148\u540E\u987A\u5E8F");
tooltips_->add_tool_tip_for_ctrl(::GetDlgItem(m_hWnd, IDC_COMBO_GROUP), L"\u8BE5\u5C5E\u6027\u5728\u754C\u9762\u4E0A\u663E\u793A\u65F6\uFF0C\u6240\u5F52\u5C5E\u7684\u5206\u7EC4\u540D\u79F0");
tooltips_->add_tool_tip_for_ctrl(::GetDlgItem(m_hWnd, IDC_COMBO_AUTH), L"\u64CD\u4F5C\u8BE5\u5C5E\u6027\u6240\u9700\u8981\u7684\u6700\u4F4E\u6743\u9650");
tooltips_->add_tool_tip_for_ctrl(::GetDlgItem(m_hWnd, IDC_EDIT_FIXED_ID), L"\u63D0\u4F9B\u8BE5\u503C\uFF0C\u8BE5\u5C5E\u6027\u5373\u53EF\u88ABTWAIN\u534F\u8BAE\u4FA6\u6D4B\u5230");
tooltips_->add_tool_tip_for_ctrl(::GetDlgItem(m_hWnd, IDC_EDIT_POSITION), L"\u76F8\u540C\u5206\u7C7B\u201CCategory\u201D\u4E2D\u5C5E\u6027\u7684\u6267\u884C\u987A\u5E8F\uFF0C\u6570\u5B57\u8D8A\u5C0F\u6392\u5728\u8D8A\u524D\u9762\u6267\u884C\u3002\u5982\u679C\u5C5E\u6027ID\u76F8\u540C\uFF0C\u5219\u6309\u8BE5\u503C\u987A\u5E8F\u6267\u884C\uFF1B\u5982\u679C\u8BE5\u503C\u4E5F\u76F8\u540C\uFF0C\u5219\u6309\u6700\u8FD1\u6DFB\u52A0\u7684\u5C5E\u6027\u66FF\u6362\u4E4B\u524D\u7684\u6267\u884C\u3002");
@ -3462,7 +3554,7 @@ void CDlgOptJson::OnBnClickedButtonSetVisible()
}
#include "../../../../code_device/sdk/hginclude/base_opt.h"
#include "../../../../code_device/sdk/sane_opt_json/base_opt.h"
namespace test_sane_ui
{
static struct paper_size

View File

@ -95,6 +95,7 @@ public:
int ver;
int pos;
int fix_id;
int auth; // 用户权限
bool readonly;
bool enable;
bool auto_restore_default;

Binary file not shown.

View File

@ -116,14 +116,14 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\code_device\hgdriver\hgdev\scanner_setting.h" />
<ClInclude Include="..\..\..\..\code_device\hgdriver\hgdev\user-opt\device_opt.h" />
<ClInclude Include="..\..\..\..\code_device\hgdriver\hgdev\user-opt\simple_logic.h" />
<ClInclude Include="..\..\..\..\code_device\hgsane\sane_opt\sane_opts.h" />
<ClInclude Include="..\..\..\..\code_device\sdk\hginclude\base_opt.h" />
<ClInclude Include="..\..\..\..\code_device\sdk\hginclude\ini_file.h" />
<ClInclude Include="..\..\..\..\code_device\sdk\hginclude\utils.h" />
<ClInclude Include="..\..\..\..\code_device\sdk\json\cJSON.h" />
<ClInclude Include="..\..\..\..\code_device\sdk\json\gb_json.h" />
<ClInclude Include="..\..\..\..\code_device\sdk\sane_opt_json\base_opt.h" />
<ClInclude Include="..\..\..\..\code_device\sdk\sane_opt_json\device_opt.h" />
<ClInclude Include="..\..\..\..\code_device\sdk\sane_opt_json\simple_logic.h" />
<ClInclude Include="CDlgLang.h" />
<ClInclude Include="CDlgMain.h" />
<ClInclude Include="DlgAddWords.h" />
@ -147,22 +147,10 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\hgdriver\hgdev\user-opt\device_opt.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\hgdriver\hgdev\user-opt\simple_logic.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\hgsane\sane_opt\sane_opts.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\sdk\hginclude\base_opt.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\sdk\hginclude\ini_file.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
@ -179,6 +167,18 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\sdk\sane_opt_json\base_opt.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\sdk\sane_opt_json\device_opt.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\sdk\sane_opt_json\simple_logic.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="CDlgLang.cpp" />
<ClCompile Include="CDlgMain.cpp" />
<ClCompile Include="DlgAddWords.cpp" />

View File

@ -87,15 +87,6 @@
<ClInclude Include="DlgCondition.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\code_device\hgdriver\hgdev\user-opt\device_opt.h">
<Filter>sane_opt</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\code_device\hgdriver\hgdev\user-opt\simple_logic.h">
<Filter>sane_opt</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\code_device\sdk\hginclude\base_opt.h">
<Filter>sane_opt</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\code_device\sdk\hginclude\utils.h">
<Filter>sane_opt</Filter>
</ClInclude>
@ -105,6 +96,15 @@
<ClInclude Include="DlgManualUSB.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\code_device\sdk\sane_opt_json\base_opt.h">
<Filter>sane_opt</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\code_device\sdk\sane_opt_json\device_opt.h">
<Filter>sane_opt</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\code_device\sdk\sane_opt_json\simple_logic.h">
<Filter>sane_opt</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="hgjson.cpp">
@ -161,15 +161,6 @@
<ClCompile Include="DlgCondition.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\hgdriver\hgdev\user-opt\device_opt.cpp">
<Filter>sane_opt</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\hgdriver\hgdev\user-opt\simple_logic.cpp">
<Filter>sane_opt</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\sdk\hginclude\base_opt.cpp">
<Filter>sane_opt</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\sdk\hginclude\utils.cpp">
<Filter>sane_opt</Filter>
</ClCompile>
@ -179,6 +170,15 @@
<ClCompile Include="DlgManualUSB.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\sdk\sane_opt_json\base_opt.cpp">
<Filter>sane_opt</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\sdk\sane_opt_json\device_opt.cpp">
<Filter>sane_opt</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\code_device\sdk\sane_opt_json\simple_logic.cpp">
<Filter>sane_opt</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="hgjson.rc">

Binary file not shown.

Binary file not shown.