设置序列号时,点击确定,再根据json设置一次休眠时间
This commit is contained in:
parent
0ff0e7c9b0
commit
7f1899e741
|
@ -76,10 +76,13 @@ void Dialog_InputSerialNum::Invalid(const QString &devName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dialog_InputSerialNum::setSpeedAndSleep()
|
void Dialog_InputSerialNum::setSpeedAndSleep(bool updateSleep)
|
||||||
{
|
{
|
||||||
if (m_hg != nullptr)
|
if (m_hg == nullptr)
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
HGChar cfgPath[512] = {0};
|
HGChar cfgPath[512] = {0};
|
||||||
HGBase_GetConfigPath(cfgPath, 512);
|
HGBase_GetConfigPath(cfgPath, 512);
|
||||||
HGBase_CreateDir(cfgPath);
|
HGBase_CreateDir(cfgPath);
|
||||||
|
@ -92,6 +95,18 @@ void Dialog_InputSerialNum::setSpeedAndSleep()
|
||||||
AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal();
|
AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal();
|
||||||
LPWRITECFG lp = new WRITECFG;
|
LPWRITECFG lp = new WRITECFG;
|
||||||
|
|
||||||
|
if (updateSleep)
|
||||||
|
{
|
||||||
|
int sleepTime = jsonGlobal.sleep_time;
|
||||||
|
lp->cat = WRITE_CAT_SLEEP;
|
||||||
|
lp->val = (void*)&sleepTime;
|
||||||
|
m_mainWnd->addTestingRef();
|
||||||
|
func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
|
||||||
|
|
||||||
|
delete lp;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
VIDPID vidpid;
|
VIDPID vidpid;
|
||||||
vidpid.VID = jsonGlobal.vid_to;
|
vidpid.VID = jsonGlobal.vid_to;
|
||||||
vidpid.PID = jsonGlobal.pid_to;
|
vidpid.PID = jsonGlobal.pid_to;
|
||||||
|
@ -101,19 +116,12 @@ void Dialog_InputSerialNum::setSpeedAndSleep()
|
||||||
m_mainWnd->addTestingRef();
|
m_mainWnd->addTestingRef();
|
||||||
func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
|
func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
|
||||||
|
|
||||||
|
|
||||||
int speedMode = jsonGlobal.speed_mode ;
|
int speedMode = jsonGlobal.speed_mode ;
|
||||||
lp->cat = WRITE_CAT_SPEED;
|
lp->cat = WRITE_CAT_SPEED;
|
||||||
lp->val = (void*)&speedMode;
|
lp->val = (void*)&speedMode;
|
||||||
m_mainWnd->addTestingRef();
|
m_mainWnd->addTestingRef();
|
||||||
func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
|
func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
|
||||||
|
|
||||||
int sleepTime = jsonGlobal.sleep_time;
|
|
||||||
lp->cat = WRITE_CAT_SLEEP;
|
|
||||||
lp->val = (void*)&sleepTime;
|
|
||||||
m_mainWnd->addTestingRef();
|
|
||||||
func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
|
|
||||||
|
|
||||||
QString device_model = jsonGlobal.device_model;
|
QString device_model = jsonGlobal.device_model;
|
||||||
if (!device_model.isEmpty())
|
if (!device_model.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -125,7 +133,6 @@ void Dialog_InputSerialNum::setSpeedAndSleep()
|
||||||
}
|
}
|
||||||
|
|
||||||
delete lp;
|
delete lp;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dialog_InputSerialNum::on_testResult()
|
void Dialog_InputSerialNum::on_testResult()
|
||||||
|
@ -163,6 +170,8 @@ void Dialog_InputSerialNum::on_pbtn_ok_clicked()
|
||||||
QMessageBox::information(this, tr("tips"), tr("The device is testing"));
|
QMessageBox::information(this, tr("tips"), tr("The device is testing"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setSpeedAndSleep(true);
|
||||||
accept();
|
accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,5 +194,5 @@ void Dialog_InputSerialNum::on_pbtn_setSn_clicked()
|
||||||
QMessageBox::information(this, tr("tips"), tr("set sn succeed"));
|
QMessageBox::information(this, tr("tips"), tr("set sn succeed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
setSpeedAndSleep();
|
setSpeedAndSleep(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ public:
|
||||||
QString GetSn();
|
QString GetSn();
|
||||||
QString GetDevType();
|
QString GetDevType();
|
||||||
void Invalid(const QString &devName);
|
void Invalid(const QString &devName);
|
||||||
void setSpeedAndSleep();
|
void setSpeedAndSleep(bool updateSleep);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void testResult();
|
void testResult();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include"test_base.h"
|
#include"test_base.h"
|
||||||
#include<string>
|
#include<string>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
Loading…
Reference in New Issue