调整速度睡眠设置序列号

This commit is contained in:
13038267101 2023-01-03 19:15:58 +08:00
parent a6139f2adc
commit 12b5d0385a
2 changed files with 15 additions and 13 deletions

View File

@ -398,19 +398,20 @@ void Form_mainInterface::setGlobalCfg(AnalysisJson analysisJson)
vidpid.VID = jsonGlobal.vid_to; vidpid.VID = jsonGlobal.vid_to;
vidpid.PID = jsonGlobal.pid_to; vidpid.PID = jsonGlobal.pid_to;
p->cat = WRITE_CAT_VID_PID; p->cat = WRITE_CAT_VID_PID;
p->val = &vidpid.Value; p->val = (void *) & vidpid.Value;
int t = *(int*)p->val;
func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg); func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg);
p->cat = WRITE_CAT_SPEED; p->cat = WRITE_CAT_SPEED;
p->val = &jsonGlobal.speed_mode; p->val = (void*)&jsonGlobal.speed_mode;
func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg); func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg);
p->cat = WRITE_CAT_SLEEP; p->cat = WRITE_CAT_SLEEP;
p->val = &jsonGlobal.sleep_time; p->val = (void*)&jsonGlobal.sleep_time;
func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg); func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg);
p->cat = WRITE_CAT_SERIALNUM; p->cat = WRITE_CAT_SERIALNUM;
p->val = &m_serialNum; p->val = (void*)&m_serialNum;
func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg); func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg);
delete p; delete p;

View File

@ -529,28 +529,28 @@ public:
test_map_[HGPDTTOOLDB_NAME_PRESSUER_TEST_RGB_300DPI] = &test::test_pressuer_test_rgb_300dpi; test_map_[HGPDTTOOLDB_NAME_PRESSUER_TEST_RGB_300DPI] = &test::test_pressuer_test_rgb_300dpi;
test_map_[HGPDTTOOLDB_NAME_PRESSUER_TEST_GRAY_300DPI] = &test::test_pressuer_test_gray_300dpi; test_map_[HGPDTTOOLDB_NAME_PRESSUER_TEST_GRAY_300DPI] = &test::test_pressuer_test_gray_300dpi;
} }
int set_test(const wchar_t* str) int set_test(const wchar_t* name,const wchar_t* oper)
{ {
if (!str) if (!name)
return SCANNER_ERR_NO_DATA; return SCANNER_ERR_NO_DATA;
set_test_name_ = str; set_test_name_ = name;
int ret = SCANNER_ERR_OK; int ret = SCANNER_ERR_OK;
auto it = test_map_.find(str); auto it = test_map_.find(name);
if (it != test_map_.end()) if (it != test_map_.end())
{ {
ret = (this->*test_map_[str])((void *)str); ret = (this->*test_map_[name])((void *)oper);
} }
else else
{ {
helper_->test_callback(str, ui_helper::TEST_EVENT_NOT_FIND_TEST, NULL, false); helper_->test_callback(name, ui_helper::TEST_EVENT_NOT_FIND_TEST, NULL, false);
return ret; return ret;
} }
if (ret != SCANNER_ERR_OK && ret != -1) if (ret != SCANNER_ERR_OK && ret != -1)
{ {
helper_->test_callback(str, ui_helper::TEST_EVENT_IO_FAIL, NULL, ret); helper_->test_callback(name, ui_helper::TEST_EVENT_IO_FAIL, NULL, ret);
} }
return ret; return ret;
} }
@ -558,7 +558,8 @@ public:
int set_init_cfg(void *data) int set_init_cfg(void *data)
{ {
LPWRITECFG cfg = (LPWRITECFG)data; const wchar_t* p = (const wchar_t*)data;
LPWRITECFG cfg = (LPWRITECFG)p;
unsigned int len = 0; unsigned int len = 0;
int ret = SCANNER_ERR_OK; int ret = SCANNER_ERR_OK;
switch (cfg->cat) switch (cfg->cat)
@ -903,7 +904,7 @@ DECL_API(int) func_test_go(const wchar_t* NAME, const wchar_t* oper, ui_helper*
SANE_Bool type = false; SANE_Bool type = false;
unsigned int len = sizeof(SANE_Bool); unsigned int len = sizeof(SANE_Bool);
test ts(helper); test ts(helper);
ret = ts.set_test(NAME); ret = ts.set_test(NAME, oper);
if (ret != SCANNER_ERR_OK) if (ret != SCANNER_ERR_OK)
{ {
return ret; return ret;