调整test_go函数传参

This commit is contained in:
yangjiaxuan 2023-01-04 17:27:24 +08:00
parent 669fa9a7a5
commit e44091cb26
4 changed files with 30 additions and 9 deletions

View File

@ -17,9 +17,9 @@
<property name="geometry">
<rect>
<x>50</x>
<y>50</y>
<width>54</width>
<height>12</height>
<y>40</y>
<width>71</width>
<height>31</height>
</rect>
</property>
<property name="text">

View File

@ -227,10 +227,25 @@ void DeviceManager::setSn(QString sn)
{
LPWRITECFG p = new WRITECFG;
std::wstring sn2 = sn.toStdWString();
p->cat = WRITE_CAT_SERIALNUM;
p->val = (void*)&sn;
p->val = (void*)sn2.c_str();
func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg);
m_mainwnd->addTestingRef();
delete p;
}
void Form_BurnMode::on_tableWidget_itemDoubleClicked(QTableWidgetItem *item)
{
int row = item->row();
QTableWidgetItem *item2 = ui->tableWidget->item(row, 1);
if (item2->checkState() == Qt::Checked)
{
item2->setCheckState(Qt::Unchecked);
}
else
{
item2->setCheckState(Qt::Checked);
}
}

View File

@ -2,6 +2,7 @@
#define FORM_BURNMODE_H
#include <QWidget>
#include <QTableWidgetItem>
#include "sane/sane_ex.h"
#include "hgscanner.h"
@ -55,6 +56,8 @@ private slots:
void on_pbtn_setSn_clicked();
void on_tableWidget_itemDoubleClicked(QTableWidgetItem *item);
private:
void initTableWidget();

View File

@ -318,7 +318,6 @@ void Form_mainInterface::initTableWidgetUi()
ui->tableWidget->setItem(i, 0, new QTableWidgetItem(QString::number(i+1)));
ui->tableWidget->item(i, 0)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
ui->tableWidget->setItem(i, 1, new QTableWidgetItem(node.title));
ui->tableWidget->item(i, 1)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
@ -400,23 +399,27 @@ void Form_mainInterface::setGlobalCfg(AnalysisJson analysisJson)
VIDPID vidpid;
vidpid.VID = jsonGlobal.vid_to;
vidpid.PID = jsonGlobal.pid_to;
int vidpidValue = vidpid.Value;
p->cat = WRITE_CAT_VID_PID;
p->val = (void *) & vidpid.Value;
p->val = (void*)&vidpidValue;
func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg);
m_mainwnd->addTestingRef();
int speedMode = jsonGlobal.speed_mode ;
p->cat = WRITE_CAT_SPEED;
p->val = (void*)&jsonGlobal.speed_mode;
p->val = (void*)&speedMode;
func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg);
m_mainwnd->addTestingRef();
int sleepTime = jsonGlobal.sleep_time;
p->cat = WRITE_CAT_SLEEP;
p->val = (void*)&jsonGlobal.sleep_time;
p->val = (void*)&sleepTime;
func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg);
m_mainwnd->addTestingRef();
const wchar_t* sn = m_serialNum.toStdWString().c_str();
p->cat = WRITE_CAT_SERIALNUM;
p->val = (void*)&m_serialNum;
p->val = (void*)sn;
func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg);
m_mainwnd->addTestingRef();