From 29753d6a79431f1965a0b1afe20f1e10e91e2876 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Wed, 4 Jan 2023 14:28:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=83=A7=E5=BD=95=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/HGProductionTool/HGProductionTool.pro | 6 + app/HGProductionTool/ProductionTool_zh_CN.qm | Bin 9652 -> 10833 bytes app/HGProductionTool/ProductionTool_zh_CN.ts | 220 ++++++++++++----- app/HGProductionTool/dialog_login.cpp | 17 +- app/HGProductionTool/dialog_login.h | 10 + app/HGProductionTool/dialog_login.ui | 73 +++++- app/HGProductionTool/dialog_setburnsn.cpp | 39 +++ app/HGProductionTool/dialog_setburnsn.h | 30 +++ app/HGProductionTool/dialog_setburnsn.ui | 68 ++++++ app/HGProductionTool/form_burnmode.cpp | 236 +++++++++++++++++++ app/HGProductionTool/form_burnmode.h | 68 ++++++ app/HGProductionTool/form_burnmode.ui | 80 +++++++ app/HGProductionTool/form_maininterface.cpp | 9 +- app/HGProductionTool/hgscanner.cpp | 43 +++- app/HGProductionTool/hgscanner.h | 4 +- app/HGProductionTool/main.cpp | 2 +- app/HGProductionTool/mainwindow.cpp | 203 ++++++++++------ app/HGProductionTool/mainwindow.h | 13 +- 18 files changed, 961 insertions(+), 160 deletions(-) create mode 100644 app/HGProductionTool/dialog_setburnsn.cpp create mode 100644 app/HGProductionTool/dialog_setburnsn.h create mode 100644 app/HGProductionTool/dialog_setburnsn.ui create mode 100644 app/HGProductionTool/form_burnmode.cpp create mode 100644 app/HGProductionTool/form_burnmode.h create mode 100644 app/HGProductionTool/form_burnmode.ui diff --git a/app/HGProductionTool/HGProductionTool.pro b/app/HGProductionTool/HGProductionTool.pro index bb705ff..9355e0b 100644 --- a/app/HGProductionTool/HGProductionTool.pro +++ b/app/HGProductionTool/HGProductionTool.pro @@ -65,8 +65,10 @@ SOURCES += \ dialog_inputserialnum.cpp \ dialog_login.cpp \ dialog_rootfuntion.cpp \ + dialog_setburnsn.cpp \ dialog_uploadcfgfile.cpp \ dialog_userinput.cpp \ + form_burnmode.cpp \ form_maininterface.cpp \ form_texttips.cpp \ hgscanner.cpp \ @@ -85,8 +87,10 @@ HEADERS += \ dialog_inputserialnum.h \ dialog_login.h \ dialog_rootfuntion.h \ + dialog_setburnsn.h \ dialog_uploadcfgfile.h \ dialog_userinput.h \ + form_burnmode.h \ form_maininterface.h \ form_texttips.h \ hgscanner.h \ @@ -100,8 +104,10 @@ FORMS += \ dialog_inputserialnum.ui \ dialog_login.ui \ dialog_rootfuntion.ui \ + dialog_setburnsn.ui \ dialog_uploadcfgfile.ui \ dialog_userinput.ui \ + form_burnmode.ui \ form_maininterface.ui \ form_texttips.ui \ mainwindow.ui diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index 975f9613cbd147a35ef7a8a065c1d2ae57ac4377..8148e2ede5923398c0b0f00d1bb72c0574880058 100644 GIT binary patch delta 2263 zcmZ{kdr(w$6vxl*-o1D4y}R7q1$pnXJWR<_%14dqSQaFb3M>jf5#hQlE-b??K2TfD zGIKG_#YPJ)6LA7F1$wAy5|V-y+2CW6WK@(eEm9{y8|++u4Gao@?0oJ$_dLGmoZoM& z;?5?yCVZXYU;kI}wjV=-zg@Wd*l&{olqmpIBfyYE!hi*68->rukS_qhB0~9aLJCci zow`BDv4q+p0A>b&s*X?yCJcUpFgypqmADUp{sSN-5FoGtVE!Hqo`fH20N6-Ep_tHc zlrSO;sN#14_~nE?{{U4I1t7~M)ZGGVuk^l)P#=J70tk=;RVvwkAk@czi`pj{?n4jt z4xsk8U}AhfzX>N0K^QQa(9j0Tn01(_6O`|~2oUr%FqtUWFdUfewE*EBVD^;(c<%=0 zpaVdWMX3CWP}NDu#}Nt+7kTi$Na#0_&`?Miegs&04NhVMOdYokh3$p-m}me^ESTqZ z1E{}%l=V)WTo)|3r$j+Du%pJyEL-M_>x-Bo`zZyq)Dj3SghPpCLU zNNpvgs|eZignR>`)RQ)2)^Cny_uY&@)4*~|?^yN|LfdIcs(p(7XJfONU^vlH{t?|pi76ZR2m zr7iZmIKcI^rTiZ9E}gHsh6A2Q?{C0G_*T%>_D1x3z{nDO0Q}mS=-X>i*xQU{=^7Vy zdXy=1*Wl4eW=@TD0{E~@8}^ zp>4s=k8<^g@gmZzxL-_ov%|0Ox|TQb1gz#~*vc?Z1)p>t>u3(~$#&_zmEYrPQsaoG z@?}>PI5H1kb1?!hQvqLF(2h!n@%81nD<*`mKZb!O8-MjM-gtGh8ZK|dm9(qra!K$h zHQV?JHn2=R;xml*y{t~?M7#c$y3mMzyiVOZ1mpe3YR1)|P$o$;XKo%gazx`w+lc|p zRn6kl=;&wB6yBt81rsz6*G6N)C@)b;z+E8Jb_;w$626ZS{0|&Jq1S}4x*|NwPYNR5 zF$nlh*dXOmj1;zptwO^lLZyyS^S4l)TYz;+g)`EBrtywOXqZ=m1y@>eam}7d-iFE! zszecB7M+vx^K#5NGMo!=?&GeU1)CH7%pIOGRWRH8)gxm9r)XcXrrGS4)Lv^(jJhx8 zVW0|=0F6J!Av#Ttobe1kKN{y*sQ2--D|yd#*1NJ))kgcNa$8ep&c8lmT5mihsq)0@ z{X9&t#2sODoT;`ko>ukQX;k5y34eeLUVa>7F z#K#K`QisCvvAwc6vuG33ou-#;HU|F@2b!Q(QXuKtzJi>?-e4M!9iFJc3Q4o-^Cbfr x%y$dBs7++*O~1WXj`uIn{0D#kP%Que delta 1232 zcmXApe@xVM7{}jt_x*AA{oeP!$1ers?tn03C6XomQOs6hi&6n`Tqvy&yd)h=A`GX(J3X_l}mt`7h6O?5vrVV1#T)Jhw&(9yX*FB%l^E{vDc|Xs- z=L)-@pZ&xaW%1#^_U-v0CFz@&_xD|X3Xo3nHw?tR2*~pQ+pXPmX9j&V9tRwBh|mO} zE(PpXL1Twte2SoN4N%YyC~1H{5ttDMN)9sdCLlP#xKcrvT`-|nFxdmCH50H@3A+7| z4$%%;J`#W2+sIKM_FqVC5yvxv?qiVJBlaCZ_ZXy4#{pe|bfJ;mWC$jVLta!z`v&B< zp9E$;0QFTCmT(``y@P5N$v`vVq-K++z^Zv^cOoEU48B8e@Xd&j==L7xeYO zp=@EN{m9MQ187H)ws26%R>)6 z3V0rq&+4q+dr2PCX7k*XZ|A&0f4`Dm$~MhWWqx)I{dOyljItU}nG&eHfgs{*l|biB z>M^C%*ng)^MM{6=Fdc5Gmi$;C=1(qSctAwR!~=GueNbbgx9sLV@#xkwS$99oLHcJ?!5yT zhXu_x?U;L<4fSf_V+4Ae8}n1iz*`r%k+-l zY*e60AKX06f>QNxC#6>Wdbp2%Ndf)p@r9JW-ia$*1naa@>5LTktYG%HL!zmPk!&P*L@p>*$=<=k+@^_e>&@wN=JIrU8*Gzv<&g3c1NziKn{ z?>E1XE8xSE=Gm34d}o4RkK{{i6`^QHN@%U(>N+Gh*+MVqdY7zSQ$h{*yF%$vRn5^; OU2|e`)UL}()yDs#`!S0E diff --git a/app/HGProductionTool/ProductionTool_zh_CN.ts b/app/HGProductionTool/ProductionTool_zh_CN.ts index fbe89c4..c526987 100644 --- a/app/HGProductionTool/ProductionTool_zh_CN.ts +++ b/app/HGProductionTool/ProductionTool_zh_CN.ts @@ -101,6 +101,29 @@ 该设备正在进行测试 + + Dialog_SetBurnSn + + + Dialog + 设置序列号 + + + + set sn: + 设置序列号: + + + + OK + 确定 + + + + Cancel + 取消 + + Dialog_UserInput @@ -315,6 +338,26 @@ ftpPort: FTP端口: + + + Burn + 烧录工位 + + + + InitTest + 初检工位 + + + + ImageTest + 图像检测工位 + + + + PressureTest + 压力测试工位 + host: IP地址: @@ -334,42 +377,42 @@ 退出 - + Set host and port 设置IP与端口 - + Minimize 最小化 - + Close 关闭 - + LogIn 登录 - + tips 提示 - + Login failed, sure to enter offline mode? 登录失败,是否进入单机测试模式? - + yes 确定 - + no 取消 @@ -505,6 +548,65 @@ 上传失败: + + Form_BurnMode + + + Form + 烧录模式 + + + + Select All + 全选 + + + + Burn + 全部烧录 + + + + Set sn + 设置勾选项序列号 + + + + ID + 序号 + + + + selected + 选择 + + + + device + 设备 + + + + serialNum + 序列号 + + + + + tips + 提示 + + + + Please check single devices to set sn + 请只勾选一台设备再进行设置序列号 + + + + Please check a devices to set sn at least + 请至少勾选一台设备再设置序列号 + + Form_mainInterface @@ -568,94 +670,94 @@ 下一步 - + Device has connected 设备已连接 - + Device hasnot connected 设备未连接 - + Device type: 设备型号: - + SerialNum: 序列号: - - + + connect status: 设备连接状态: - + load last image which uploaded last time 加载上一次上传的图片 - + Device has disconnected 设备已断开 - - + + tips 提示 - + yes 确定 - + no 取消 - + ID 序号 - + Test items 测试项 - + status 测试状态 - + not test 未测试 - + not pass 不通过 - + not support 不支持 - + pass 通过 - + no image 无图 @@ -721,7 +823,7 @@ 上传配置文件 - + Account login elsewhere 账户在其他地方登录 @@ -730,54 +832,54 @@ 网络连接断开 - + You have been forced offline by the administrator account 你已被管理员账户强制下线 - + Data base error 数据库错误 - - - - - - - - - - + + + + + + + + + + tips 提示 - - - + + + Is testing, do not close! 测试中,请勿关闭! - + Are you sure to connect the new device 检测到设备连接,是否启动测试? - + yes 确定 - + no 取消 - - + + cannot create more table 不能创建更多项目 @@ -786,52 +888,52 @@ 设备已断开连接 - + Open device failed 打开设备失败 - + save 保存 - + xls(*.xls) xls表格(*.xls) - + export succeed 导出成功 - + export failed 导出失败 - + Illegal user 非法的用户 - + Wrong password 密码错误 - + Database error 数据库错误 - + connect error 连接错误 - + Failed 错误 diff --git a/app/HGProductionTool/dialog_login.cpp b/app/HGProductionTool/dialog_login.cpp index d93d563..19f20f2 100644 --- a/app/HGProductionTool/dialog_login.cpp +++ b/app/HGProductionTool/dialog_login.cpp @@ -1,7 +1,8 @@ #include "dialog_login.h" #include "ui_dialog_login.h" #include -#include "mainwindow.h" +#include +#include #include "base/HGUtility.h" #include "base/HGIni.h" #include "HGUIGlobal.h" @@ -68,6 +69,11 @@ unsigned short Dialog_logIn::GetFtpPort() return ui->lineEdit_ftpPort->text().toUShort(); } +Dialog_logIn::LogInType Dialog_logIn::GetLogInType() +{ + return m_loginType; +} + void Dialog_logIn::mousePressEvent(QMouseEvent *event) { if(event->button()==Qt::LeftButton) @@ -109,6 +115,15 @@ void Dialog_logIn::on_pbtn_login_clicked() saveCfgValue("login", "ftpHost", ftpHost); saveCfgValue("login", "ftpPort", ftpPort); + if (ui->radioButton_burn->isChecked()) + m_loginType = LogInType_Burn; + else if (ui->radioButton_initTest->isChecked()) + m_loginType = LogInType_InitTest; + else if (ui->radioButton_imageTest->isChecked()) + m_loginType = LogInType_ImageTest; + else if (ui->radioButton_pressureTest->isChecked()) + m_loginType = LogInType_PressureTest; + HGPdtToolDbUserMgr pdtToolDbuserMgr = nullptr; HGPdtToolDb_CreateUserMgr(dbHost.toStdString().c_str(), dbPort.toInt(), account.toStdString().c_str(), password.toStdString().c_str(), &pdtToolDbuserMgr); diff --git a/app/HGProductionTool/dialog_login.h b/app/HGProductionTool/dialog_login.h index 2018589..3863a38 100644 --- a/app/HGProductionTool/dialog_login.h +++ b/app/HGProductionTool/dialog_login.h @@ -16,9 +16,18 @@ public: explicit Dialog_logIn(QWidget *parent = nullptr); ~Dialog_logIn(); + enum LogInType + { + LogInType_Burn = 0, + LogInType_InitTest = 1, + LogInType_ImageTest = 2, + LogInType_PressureTest = 3 + }; + HGPdtToolDbUserMgr GetUserMgr(); QString GetFtpHost(); unsigned short GetFtpPort(); + LogInType GetLogInType(); void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); @@ -45,6 +54,7 @@ private: QPoint m_startPos; QPoint m_endPos; bool m_leftMousePressed; + LogInType m_loginType; }; #endif // DIALOG_LOGIN_H diff --git a/app/HGProductionTool/dialog_login.ui b/app/HGProductionTool/dialog_login.ui index e86a8ac..e7d82df 100644 --- a/app/HGProductionTool/dialog_login.ui +++ b/app/HGProductionTool/dialog_login.ui @@ -6,8 +6,8 @@ 0 0 - 473 - 278 + 479 + 329 @@ -18,7 +18,7 @@ 0 0 - 451 + 481 30 @@ -151,7 +151,7 @@ QPushButton#pbtn_close::hover - 1 + 0 @@ -172,7 +172,7 @@ QPushButton#pbtn_close::hover 140 30 - 151 + 161 22 @@ -195,7 +195,7 @@ QPushButton#pbtn_close::hover 140 90 - 151 + 161 22 @@ -299,8 +299,8 @@ QPushButton#pbtn_close::hover - 260 - 210 + 270 + 280 75 31 @@ -313,7 +313,7 @@ QPushButton#pbtn_close::hover 140 - 210 + 280 75 31 @@ -328,6 +328,61 @@ QPushButton#pbtn_close::hover true + + + + 90 + 186 + 131 + 20 + + + + Burn + + + true + + + + + + 270 + 185 + 141 + 21 + + + + InitTest + + + + + + 90 + 230 + 151 + 21 + + + + ImageTest + + + + + + 270 + 230 + 151 + 21 + + + + PressureTest + + diff --git a/app/HGProductionTool/dialog_setburnsn.cpp b/app/HGProductionTool/dialog_setburnsn.cpp new file mode 100644 index 0000000..595f357 --- /dev/null +++ b/app/HGProductionTool/dialog_setburnsn.cpp @@ -0,0 +1,39 @@ +#include "dialog_setburnsn.h" +#include "ui_dialog_setburnsn.h" +#include + +Dialog_SetBurnSn::Dialog_SetBurnSn(const QString &originSn, QWidget *parent) : + QDialog(parent), + m_originSn(originSn), + ui(new Ui::Dialog_SetBurnSn) +{ + ui->setupUi(this); + + ui->lineEdit->setValidator(new QRegExpValidator(QRegExp("[a-zA-Z0-9]+$"))); + if (!m_originSn.isEmpty()) + { + ui->lineEdit->setText(m_originSn); + ui->lineEdit->selectAll(); + } + +} + +Dialog_SetBurnSn::~Dialog_SetBurnSn() +{ + delete ui; +} + +QString Dialog_SetBurnSn::getSn() +{ + return ui->lineEdit->text(); +} + +void Dialog_SetBurnSn::on_pbtn_ok_clicked() +{ + accept(); +} + +void Dialog_SetBurnSn::on_pbtn_cancel_clicked() +{ + reject(); +} diff --git a/app/HGProductionTool/dialog_setburnsn.h b/app/HGProductionTool/dialog_setburnsn.h new file mode 100644 index 0000000..d3eae50 --- /dev/null +++ b/app/HGProductionTool/dialog_setburnsn.h @@ -0,0 +1,30 @@ +#ifndef DIALOG_SETBURNSN_H +#define DIALOG_SETBURNSN_H + +#include + +namespace Ui { +class Dialog_SetBurnSn; +} + +class Dialog_SetBurnSn : public QDialog +{ + Q_OBJECT + +public: + explicit Dialog_SetBurnSn(const QString &originSn, QWidget *parent = nullptr); + ~Dialog_SetBurnSn(); + + QString getSn(); + +private slots: + void on_pbtn_ok_clicked(); + + void on_pbtn_cancel_clicked(); + +private: + Ui::Dialog_SetBurnSn *ui; + QString m_originSn; +}; + +#endif // DIALOG_SETBURNSN_H diff --git a/app/HGProductionTool/dialog_setburnsn.ui b/app/HGProductionTool/dialog_setburnsn.ui new file mode 100644 index 0000000..5891b7d --- /dev/null +++ b/app/HGProductionTool/dialog_setburnsn.ui @@ -0,0 +1,68 @@ + + + Dialog_SetBurnSn + + + + 0 + 0 + 415 + 190 + + + + Dialog + + + + + 50 + 50 + 54 + 12 + + + + set sn: + + + + + + 130 + 40 + 231 + 31 + + + + + + + 190 + 120 + 75 + 31 + + + + OK + + + + + + 310 + 120 + 75 + 31 + + + + Cancel + + + + + + diff --git a/app/HGProductionTool/form_burnmode.cpp b/app/HGProductionTool/form_burnmode.cpp new file mode 100644 index 0000000..18eb070 --- /dev/null +++ b/app/HGProductionTool/form_burnmode.cpp @@ -0,0 +1,236 @@ +#include "form_burnmode.h" +#include "ui_form_burnmode.h" +#include "dialog_setburnsn.h" +#include "hgscanner.h" +#include "mainwindow.h" +#include +#include +#include + +Form_BurnMode::Form_BurnMode(class MainWindow *mainwnd, QWidget *parent) : + QWidget(parent), + m_curIndex(0), + m_mainwnd(mainwnd), + ui(new Ui::Form_BurnMode) +{ + ui->setupUi(this); + + connect(this, SIGNAL(testResult(QString)), this, SLOT(on_testResult(QString)), Qt::QueuedConnection); + + initTableWidget(); +} + +Form_BurnMode::~Form_BurnMode() +{ + delete ui; +} + +void Form_BurnMode::addDevice(DeviceManager *devManager) +{ + ui->tableWidget->setRowCount(m_curIndex + 1); + ui->tableWidget->setItem(m_curIndex, 0, new QTableWidgetItem(QString::number(m_curIndex + 1))); + ui->tableWidget->item(m_curIndex, 0)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); + + QTableWidgetItem *check = new QTableWidgetItem(); + check->setCheckState(Qt::Unchecked); + ui->tableWidget->setItem(m_curIndex, 1, check); + ui->tableWidget->item(m_curIndex, 1)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); + ui->tableWidget->setItem(m_curIndex, 2, new QTableWidgetItem(devManager->getDevName())); + ui->tableWidget->item(m_curIndex, 2)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); + ui->tableWidget->setItem(m_curIndex, 3, new QTableWidgetItem(devManager->getSn())); + ui->tableWidget->item(m_curIndex, 3)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); + + QTableWidgetItem *item = ui->tableWidget->item(m_curIndex, 1); + QVariant var = QVariant::fromValue((void*)devManager); + item->setData(Qt::UserRole, var); + +// for(int i = 0; i < ui->tableWidget->rowCount(); i++) +// { +// QTableWidgetItem *item = ui->tableWidget->item(i, 3); +// if (item != nullptr) +// item->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled); +// } + + m_curIndex++; +} + +void Form_BurnMode::deleteDevice(QString devName) +{ + for(int i = 0; i < ui->tableWidget->columnCount(); i++) + { + QTableWidgetItem *item = ui->tableWidget->item(i, 1); + QTableWidgetItem *item2 = ui->tableWidget->item(i, 2); + if (devName!= nullptr && item != nullptr) + { + if (devName == item2->text()) + { + DeviceManager *devManager = (DeviceManager*)item->data(Qt::UserRole).value(); + delete devManager; + + ui->tableWidget->removeRow(i); + m_curIndex--; + break; + } + } + } +} + +void Form_BurnMode::on_testResult(QString text) +{ + if (!text.isEmpty()) + QMessageBox::information(this, tr("tips"), text); + + m_mainwnd->releaseTesting(); +} + +void Form_BurnMode::initTableWidget() +{ + ui->tableWidget->resizeRowsToContents(); + ui->tableWidget->setColumnCount(4); + ui->tableWidget->horizontalHeader()->setDefaultSectionSize(200); +// ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); + ui->tableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents); + ui->tableWidget->horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents); + + QStringList header; + header<< tr("ID") << tr("selected") << tr("device") << tr("serialNum"); + ui->tableWidget->setHorizontalHeaderLabels(header); + + QFont font = ui->tableWidget->horizontalHeader()->font(); + font.setBold(true); + ui->tableWidget->horizontalHeader()->setFont(font); + + ui->tableWidget->horizontalHeader()->setStretchLastSection(true); + ui->tableWidget->verticalHeader()->setDefaultSectionSize(10); + ui->tableWidget->setFrameShape(QFrame::NoFrame); + ui->tableWidget->setShowGrid(true); + ui->tableWidget->verticalHeader()->setVisible(false); +// ui->tableWidget->setSelectionMode(QAbstractItemView::SingleSelection); + ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows); + ui->tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); + ui->tableWidget->horizontalHeader()->setFixedHeight(30); + ui->tableWidget->clearContents(); +} + +void Form_BurnMode::on_cbox_selectAll_stateChanged(int arg1) +{ + (void)arg1; + bool check = ui->cbox_selectAll->isChecked(); + + for(int i = 0; i < ui->tableWidget->columnCount(); i++) + { + QTableWidgetItem *item = ui->tableWidget->item(i, 1); + if (item != nullptr) + { + if (check) + item->setCheckState(Qt::Checked); + else + item->setCheckState(Qt::Unchecked); + } + } +} + +void Form_BurnMode::on_pbtn_burn_clicked() +{ + ui->cbox_selectAll->setChecked(true); + + for(int i = 0; i < ui->tableWidget->columnCount(); i++) + { + QTableWidgetItem *item = ui->tableWidget->item(i, 1); + if (item != nullptr && Qt::Checked == item->checkState()) + { + DeviceManager *devManager = (DeviceManager*)item->data(Qt::UserRole).value(); + devManager->setBurnMode(); + } + } +} + +void Form_BurnMode::on_pbtn_setSn_clicked() +{ + int select = 0; + for(int i = 0; i < ui->tableWidget->columnCount(); i++) + { + QTableWidgetItem *item = ui->tableWidget->item(i, 1); + if (item != nullptr && Qt::Checked == item->checkState()) + { + select++; + } + } + + if (select == 0) + { + QMessageBox::information(this, tr("tips"), tr("Please check a devices to set sn at least")); + return; + } + else if (select > 1) + { + QMessageBox::information(this, tr("tips"), tr("Please check single devices to set sn")); + return; + } + else if (select == 1) + { + for(int i = 0; i < ui->tableWidget->columnCount(); i++) + { + QTableWidgetItem *item = ui->tableWidget->item(i, 1); + QTableWidgetItem *item2 = ui->tableWidget->item(i, 3); + if (item != nullptr && Qt::Checked == item->checkState()) + { + Dialog_SetBurnSn dlg(item2->text(), this); + if (dlg.exec()) + { + DeviceManager *devManager = (DeviceManager*)item->data(Qt::UserRole).value(); + devManager->setSn(dlg.getSn()); + break; + } + } + } + } +} + +DeviceManager::DeviceManager(class MainWindow *mainwnd, class Form_BurnMode *burnMode, SANE_Handle handle, const QString & devName, const QString & sn) +{ + m_handle = handle; + m_devName = devName; + m_sn = sn; + m_mainwnd = mainwnd; + m_burnMode = burnMode; + + m_hg = new hgscanner(nullptr, m_burnMode, m_handle); +} + +DeviceManager::~DeviceManager() +{ + delete m_hg; + m_hg = nullptr; + + sane_close(m_handle); +} + +QString DeviceManager::getDevName() +{ + return m_devName; +} + +QString DeviceManager::getSn() +{ + return m_sn; +} + +void DeviceManager::setBurnMode() +{ + const wchar_t *p = L"1"; + func_test_go(HGPDTTOOLDB_NAME_REBOOT_DEVICE, p, m_hg); + m_mainwnd->addTestingRef(); +} + +void DeviceManager::setSn(QString sn) +{ + LPWRITECFG p = new WRITECFG; + + p->cat = WRITE_CAT_SERIALNUM; + p->val = (void*)&sn; + func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg); + m_mainwnd->addTestingRef(); + + delete p; +} diff --git a/app/HGProductionTool/form_burnmode.h b/app/HGProductionTool/form_burnmode.h new file mode 100644 index 0000000..768c102 --- /dev/null +++ b/app/HGProductionTool/form_burnmode.h @@ -0,0 +1,68 @@ +#ifndef FORM_BURNMODE_H +#define FORM_BURNMODE_H + +#include +#include "sane/sane_ex.h" +#include "hgscanner.h" + +namespace Ui { +class Form_BurnMode; +} + +class DeviceManager +{ +public: + DeviceManager(class MainWindow *mainwnd, class Form_BurnMode *burnMode, SANE_Handle handle, const QString &devName, const QString &sn); + ~DeviceManager(); + + QString getDevName(); + QString getSn(); + void setBurnMode(); + void setSn(QString sn); + SANE_Handle m_handle; + +private: + QString m_devName; + QString m_sn; + + class MainWindow *m_mainwnd; + class Form_BurnMode *m_burnMode; + hgscanner *m_hg; +}; + + +class Form_BurnMode : public QWidget +{ + Q_OBJECT + +public: + explicit Form_BurnMode(class MainWindow *mainwnd, QWidget *parent = nullptr); + ~Form_BurnMode(); + + void addDevice(DeviceManager *devManager); + void deleteDevice(QString devName); + +signals: + void testResult(QString text); + +private slots: + void on_testResult(QString text); + +private slots: + void on_cbox_selectAll_stateChanged(int arg1); + + void on_pbtn_burn_clicked(); + + void on_pbtn_setSn_clicked(); + +private: + void initTableWidget(); + +private: + Ui::Form_BurnMode *ui; + class MainWindow *m_mainwnd; + + int m_curIndex; +}; + +#endif // FORM_BURNMODE_H diff --git a/app/HGProductionTool/form_burnmode.ui b/app/HGProductionTool/form_burnmode.ui new file mode 100644 index 0000000..db77729 --- /dev/null +++ b/app/HGProductionTool/form_burnmode.ui @@ -0,0 +1,80 @@ + + + Form_BurnMode + + + + 0 + 0 + 527 + 333 + + + + Form + + + + + + + + + + + Select All + + + + + + + + 91 + 31 + + + + Burn + + + + + + + + 91 + 31 + + + + Set sn + + + + + + + + 43 + 23 + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + diff --git a/app/HGProductionTool/form_maininterface.cpp b/app/HGProductionTool/form_maininterface.cpp index 1d4453b..d4e51c3 100644 --- a/app/HGProductionTool/form_maininterface.cpp +++ b/app/HGProductionTool/form_maininterface.cpp @@ -45,7 +45,7 @@ Form_mainInterface::Form_mainInterface(class MainWindow *mainwnd, SANE_Handle ha if (m_handle) { str = tr("Device has connected"); - m_hg = new hgscanner(this, m_handle); + m_hg = new hgscanner(this, nullptr, m_handle); } else str = tr("Device hasnot connected"); @@ -401,21 +401,24 @@ void Form_mainInterface::setGlobalCfg(AnalysisJson analysisJson) vidpid.VID = jsonGlobal.vid_to; vidpid.PID = jsonGlobal.pid_to; p->cat = WRITE_CAT_VID_PID; - p->val = (void *) & vidpid.Value; - int t = *(int*)p->val; + p->val = (void *) & vidpid.Value; func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg); + m_mainwnd->addTestingRef(); p->cat = WRITE_CAT_SPEED; p->val = (void*)&jsonGlobal.speed_mode; func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg); + m_mainwnd->addTestingRef(); p->cat = WRITE_CAT_SLEEP; p->val = (void*)&jsonGlobal.sleep_time; func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg); + m_mainwnd->addTestingRef(); p->cat = WRITE_CAT_SERIALNUM; p->val = (void*)&m_serialNum; func_test_go(WRITE_CFG_NAME, (const wchar_t*)p, m_hg); + m_mainwnd->addTestingRef(); delete p; } diff --git a/app/HGProductionTool/hgscanner.cpp b/app/HGProductionTool/hgscanner.cpp index 436e102..72575c9 100644 --- a/app/HGProductionTool/hgscanner.cpp +++ b/app/HGProductionTool/hgscanner.cpp @@ -1,11 +1,13 @@ #include "hgscanner.h" #include #include "form_maininterface.h" +#include "form_burnmode.h" #include "dialog_userinput.h" #include -hgscanner::hgscanner(Form_mainInterface *form, SANE_Handle h) +hgscanner::hgscanner(Form_mainInterface *form, Form_BurnMode *burnMode, SANE_Handle h) : m_interface(form) + , m_burnMode(burnMode) , devHandle_(h) { cb_ = nullptr; @@ -38,7 +40,15 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si else if (ev == TEST_EVENT_NOT_FIND_TEST) { QString info = QObject::tr("Not find test item"); - emit m_interface->testResult(info); + + if (m_interface != nullptr) + { + emit m_interface->testResult(info); + } + else if (m_burnMode != nullptr) + { + emit m_burnMode->testResult(info); + } } else if (ev == TEST_EVENT_IO_FAIL) { @@ -47,7 +57,15 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si { info = QObject::tr("failed: ") + QString::fromStdWString((const wchar_t*)data); } - emit m_interface->testResult(info); + + if (m_interface != nullptr) + { + emit m_interface->testResult(info); + } + else if (m_burnMode != nullptr) + { + emit m_burnMode->testResult(info); + } } else if (ev == TEST_EVENT_MANUAL_CONFIRMATION) { @@ -56,7 +74,15 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si { info = QString::fromStdWString((const wchar_t*)data); } - emit m_interface->testResult(info); + + if (m_interface != nullptr) + { + emit m_interface->testResult(info); + } + else if (m_burnMode != nullptr) + { + emit m_burnMode->testResult(info); + } } else if (ev == TEST_EVENT_RESULT) { @@ -68,7 +94,14 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si else info = QObject::tr("failed: ") + QString::fromStdWString((const wchar_t*)data); } - emit m_interface->testResult(info); + if (m_interface != nullptr) + { + emit m_interface->testResult(info); + } + else if (m_burnMode != nullptr) + { + emit m_burnMode->testResult(info); + } } else if (ev == TEST_EVENT_DISTORTION) { diff --git a/app/HGProductionTool/hgscanner.h b/app/HGProductionTool/hgscanner.h index 51203a1..c693b0f 100644 --- a/app/HGProductionTool/hgscanner.h +++ b/app/HGProductionTool/hgscanner.h @@ -4,11 +4,12 @@ #include "test_base.h" class Form_mainInterface; +class Form_BurnMode; class hgscanner :public ui_helper { public: - hgscanner(Form_mainInterface *form, SANE_Handle h); + hgscanner(Form_mainInterface *form, Form_BurnMode *burnMode, SANE_Handle h); ~hgscanner(); virtual parameter* get_user_input(data_from from, value_type type, const wchar_t* title, const wchar_t* desc = NULL); virtual void test_callback(const wchar_t* name/*test name*/, test_event ev, void* data, size_t flag); @@ -18,6 +19,7 @@ public: sane_callback cb_; private: class Form_mainInterface *m_interface; + class Form_BurnMode *m_burnMode; SANE_Handle devHandle_; }; diff --git a/app/HGProductionTool/main.cpp b/app/HGProductionTool/main.cpp index 3c294f6..42b692d 100644 --- a/app/HGProductionTool/main.cpp +++ b/app/HGProductionTool/main.cpp @@ -18,7 +18,7 @@ int main(int argc, char *argv[]) Dialog_logIn login; if (login.exec()) { - MainWindow w(login.GetUserMgr(), login.GetFtpHost(), login.GetFtpPort()); + MainWindow w(login.GetUserMgr(), login.GetLogInType(), login.GetFtpHost(), login.GetFtpPort()); a.exec(); if (w.isExitApp()) { diff --git a/app/HGProductionTool/mainwindow.cpp b/app/HGProductionTool/mainwindow.cpp index 3f5b972..710a6d2 100644 --- a/app/HGProductionTool/mainwindow.cpp +++ b/app/HGProductionTool/mainwindow.cpp @@ -10,7 +10,7 @@ #include "dialog_uploadcfgfile.h" #include "dialog_inputserialnum.h" -MainWindow::MainWindow(HGPdtToolDbUserMgr pdtToolDbuserMgr, const QString &ftpHost, unsigned short ftpPort, QWidget *parent) +MainWindow::MainWindow(HGPdtToolDbUserMgr pdtToolDbuserMgr, Dialog_logIn::LogInType loginType, const QString &ftpHost, unsigned short ftpPort, QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) , m_pdtToolDbuserMgr(pdtToolDbuserMgr) @@ -18,6 +18,8 @@ MainWindow::MainWindow(HGPdtToolDbUserMgr pdtToolDbuserMgr, const QString &ftpHo , m_ftpPort(ftpPort) , m_lock(nullptr) , m_testingRef(0) + , m_loginType(loginType) + , m_formBurnMode(nullptr) , m_top_splitter(nullptr) , m_bot_splitter(nullptr) , m_isLogOut(false) @@ -35,19 +37,35 @@ MainWindow::MainWindow(HGPdtToolDbUserMgr pdtToolDbuserMgr, const QString &ftpHo connect(this, SIGNAL(sane_dev_arrive(QString)), this, SLOT(on_sane_dev_arrive(QString)), Qt::QueuedConnection); connect(this, SIGNAL(sane_dev_remove(QString)), this, SLOT(on_sane_dev_remove(QString)), Qt::QueuedConnection); - m_top_splitter = new QSplitter(Qt::Horizontal); - m_bot_splitter = new QSplitter(Qt::Horizontal); - m_top_splitter->setMinimumWidth(600); - m_bot_splitter->setMinimumWidth(600); - m_top_splitter->setChildrenCollapsible(false); - m_bot_splitter->setChildrenCollapsible(false); + if (m_loginType == Dialog_logIn::LogInType_Burn) + { + ui->act_newDevice->setVisible(false); - QVBoxLayout *vLayout = new QVBoxLayout; - vLayout->addWidget(m_top_splitter); - vLayout->addWidget(m_bot_splitter); - vLayout->setStretch(0, 0); - vLayout->setStretch(1, 0); - this->centralWidget()->setLayout(vLayout); + m_formBurnMode = new Form_BurnMode(this, this); + + QVBoxLayout *vLayout = new QVBoxLayout; + vLayout->addWidget(m_formBurnMode); + this->centralWidget()->setLayout(vLayout); + show(); + } + else + { + m_top_splitter = new QSplitter(Qt::Horizontal); + m_bot_splitter = new QSplitter(Qt::Horizontal); + m_top_splitter->setMinimumWidth(600); + m_bot_splitter->setMinimumWidth(600); + m_top_splitter->setChildrenCollapsible(false); + m_bot_splitter->setChildrenCollapsible(false); + + QVBoxLayout *vLayout = new QVBoxLayout; + vLayout->addWidget(m_top_splitter); + vLayout->addWidget(m_bot_splitter); + vLayout->setStretch(0, 0); + vLayout->setStretch(1, 0); + this->centralWidget()->setLayout(vLayout); + + showMaximized(); + } QTimer *timer = new QTimer(this); timer->start(1000); @@ -65,8 +83,6 @@ MainWindow::MainWindow(HGPdtToolDbUserMgr pdtToolDbuserMgr, const QString &ftpHo HGPdtToolDb_GetUserName(m_pdtToolDbuserMgr, userName, 128); setWindowTitle(userName); - showMaximized(); - SANE_Int v = 0; sane_init_ex(&v, sane_ex_callback, this); } @@ -74,17 +90,24 @@ MainWindow::MainWindow(HGPdtToolDbUserMgr pdtToolDbuserMgr, const QString &ftpHo MainWindow::~MainWindow() { HGBase_EnterLock(m_lock); - while (0 != m_top_splitter->count()) + if (m_top_splitter != nullptr) { - Form_mainInterface *interface = (Form_mainInterface *)m_top_splitter->widget(0); - delete interface; + while (0 != m_top_splitter->count()) + { + Form_mainInterface * mainInterface = (Form_mainInterface *)m_top_splitter->widget(0); + delete mainInterface; + } } - while (0 != m_bot_splitter->count()) + if (m_top_splitter != nullptr) { - Form_mainInterface *interface = (Form_mainInterface *)m_bot_splitter->widget(0); - delete interface; + while (0 != m_bot_splitter->count()) + { + Form_mainInterface * mainInterface = (Form_mainInterface *)m_bot_splitter->widget(0); + delete mainInterface; + } } + HGBase_LeaveLock(m_lock); sane_exit(); @@ -92,6 +115,9 @@ MainWindow::~MainWindow() HGPdtToolDb_DestroyUserMgr(m_pdtToolDbuserMgr); m_pdtToolDbuserMgr = nullptr; + delete m_formBurnMode; + m_formBurnMode = nullptr; + HGBase_DestroyLock(m_lock); m_lock = nullptr; delete ui; @@ -130,19 +156,19 @@ Form_mainInterface* MainWindow::FindInterface(const QString &sn) { for (int i = 0; i < m_top_splitter->count(); ++i) { - Form_mainInterface *interface = (Form_mainInterface *)m_top_splitter->widget(i); - if (sn == interface->getSn()) + Form_mainInterface * mainInterface = (Form_mainInterface *)m_top_splitter->widget(i); + if (sn == mainInterface->getSn()) { - return interface; + return mainInterface; } } for (int i = 0; i < m_bot_splitter->count(); ++i) { - Form_mainInterface *interface = (Form_mainInterface *)m_bot_splitter->widget(i); - if (sn == interface->getSn()) + Form_mainInterface * mainInterface = (Form_mainInterface *)m_bot_splitter->widget(i); + if (sn == mainInterface->getSn()) { - return interface; + return mainInterface; } } @@ -153,19 +179,19 @@ Form_mainInterface *MainWindow::FindInterfaceByDevName(const QString &devName) { for (int i = 0; i < m_top_splitter->count(); ++i) { - Form_mainInterface *interface = (Form_mainInterface *)m_top_splitter->widget(i); - if (devName == interface->getDevName()) + Form_mainInterface * mainInterface = (Form_mainInterface *)m_top_splitter->widget(i); + if (devName == mainInterface->getDevName()) { - return interface; + return mainInterface; } } for (int i = 0; i < m_bot_splitter->count(); ++i) { - Form_mainInterface *interface = (Form_mainInterface *)m_bot_splitter->widget(i); - if (devName == interface->getDevName()) + Form_mainInterface * mainInterface = (Form_mainInterface *)m_bot_splitter->widget(i); + if (devName == mainInterface->getDevName()) { - return interface; + return mainInterface; } } @@ -177,10 +203,10 @@ Form_mainInterface* MainWindow::FindInterface(SANE_Handle handle) Form_mainInterface *form = nullptr; for (int i = 0; i < m_top_splitter->count(); ++i) { - Form_mainInterface *interface = (Form_mainInterface *)m_top_splitter->widget(i); - if (handle == interface->getDevHandle()) + Form_mainInterface * mainInterface = (Form_mainInterface *)m_top_splitter->widget(i); + if (handle == mainInterface->getDevHandle()) { - form = interface; + form = mainInterface; break; } } @@ -189,10 +215,10 @@ Form_mainInterface* MainWindow::FindInterface(SANE_Handle handle) { for (int i = 0; i < m_bot_splitter->count(); ++i) { - Form_mainInterface *interface = (Form_mainInterface *)m_bot_splitter->widget(i); - if (handle == interface->getDevHandle()) + Form_mainInterface * mainInterface = (Form_mainInterface *)m_bot_splitter->widget(i); + if (handle == mainInterface->getDevHandle()) { - form = interface; + form = mainInterface; break; } } @@ -201,20 +227,20 @@ Form_mainInterface* MainWindow::FindInterface(SANE_Handle handle) return form; } -bool MainWindow::AddInterface(Form_mainInterface *interface) +bool MainWindow::AddInterface(Form_mainInterface * mainInterface) { - assert(nullptr != interface); + assert(nullptr != mainInterface); HGBase_EnterLock(m_lock); bool ret = false; if (m_top_splitter->count() < 2) { - m_top_splitter->addWidget(interface); + m_top_splitter->addWidget(mainInterface); ret = true; } else if (m_bot_splitter->count() < 2) { - m_bot_splitter->addWidget(interface); + m_bot_splitter->addWidget(mainInterface); ret = true; } HGBase_LeaveLock(m_lock); @@ -223,11 +249,11 @@ bool MainWindow::AddInterface(Form_mainInterface *interface) return ret; } -bool MainWindow::RemoveInterface(Form_mainInterface *interface) +bool MainWindow::RemoveInterface(Form_mainInterface * mainInterface) { - assert(nullptr != interface); + assert(nullptr != mainInterface); HGBase_EnterLock(m_lock); - delete interface; + delete mainInterface; HGBase_LeaveLock(m_lock); updateSplitter(); return true; @@ -292,11 +318,14 @@ int MainWindow::sane_ex_callback(SANE_Handle hdev, int code, void *data, unsigne if (code == SANE_EVENT_IMAGE_OK || code == SANE_EVENT_SCAN_FINISHED || code == SANE_EVENT_ERROR || code == SANE_EVENT_STATUS) { HGBase_EnterLock(p->m_lock); - Form_mainInterface* interface = p->FindInterface(hdev); - if (nullptr != interface) + if (p->m_loginType != Dialog_logIn::LogInType_Burn) { - if (nullptr != interface->getScanner() && nullptr != interface->getScanner()->cb_) - interface->getScanner()->cb_(hdev, code, data, len, interface->getScanner()); + Form_mainInterface* mainInterface = p->FindInterface(hdev); + if (nullptr != mainInterface) + { + if (nullptr != mainInterface->getScanner() && nullptr != mainInterface->getScanner()->cb_) + mainInterface->getScanner()->cb_(hdev, code, data, len, mainInterface->getScanner()); + } } HGBase_LeaveLock(p->m_lock); } @@ -364,53 +393,73 @@ QString MainWindow::getDevFwNum(SANE_Handle handle) void MainWindow::on_sane_dev_arrive(QString devName) { - QMessageBox msg(QMessageBox::Question, tr("tips"), - tr("Are you sure to connect the new device"), - QMessageBox::Yes | QMessageBox::No, this); - msg.setButtonText(QMessageBox::Yes, tr("yes")); - msg.setButtonText(QMessageBox::No, tr("no")); - msg.exec(); - if (msg.clickedButton() == msg.button(QMessageBox::Yes)) + if (m_loginType == Dialog_logIn::LogInType_Burn) { SANE_Handle devHandle = nullptr; sane_open(devName.toStdString().c_str(), &devHandle); if (nullptr != devHandle) { - Dialog_InputSerialNum dlg(this, getDevSn(devHandle), getDevType(devHandle)); - if (dlg.exec()) + DeviceManager *devManager = new DeviceManager(this, m_formBurnMode, devHandle, devName, getDevSn(devHandle)); + m_formBurnMode->addDevice(devManager); + } + } + else + { + QMessageBox msg(QMessageBox::Question, tr("tips"), + tr("Are you sure to connect the new device"), + QMessageBox::Yes | QMessageBox::No, this); + msg.setButtonText(QMessageBox::Yes, tr("yes")); + msg.setButtonText(QMessageBox::No, tr("no")); + msg.exec(); + if (msg.clickedButton() == msg.button(QMessageBox::Yes)) + { + SANE_Handle devHandle = nullptr; + sane_open(devName.toStdString().c_str(), &devHandle); + if (nullptr != devHandle) { - HGPdtToolDbDevice pdtToolDbDevice = nullptr; - HGPdtToolDb_OpenDevice(m_pdtToolDbuserMgr, dlg.GetSn().toStdString().c_str(), &pdtToolDbDevice); - - Form_mainInterface *mainInterface = new Form_mainInterface(this, devHandle, m_pdtToolDbuserMgr, pdtToolDbDevice, - dlg.GetSn(), dlg.GetDevType(), devName, getDevFwNum(devHandle)); - if (!AddInterface(mainInterface)) + Dialog_InputSerialNum dlg(this, getDevSn(devHandle), getDevType(devHandle)); + if (dlg.exec()) { - QMessageBox::information(this, tr("tips"), tr("cannot create more table")); - delete mainInterface; + HGPdtToolDbDevice pdtToolDbDevice = nullptr; + HGPdtToolDb_OpenDevice(m_pdtToolDbuserMgr, dlg.GetSn().toStdString().c_str(), &pdtToolDbDevice); + + Form_mainInterface *mainInterface = new Form_mainInterface(this, devHandle, m_pdtToolDbuserMgr, pdtToolDbDevice, + dlg.GetSn(), dlg.GetDevType(), devName, getDevFwNum(devHandle)); + if (!AddInterface(mainInterface)) + { + QMessageBox::information(this, tr("tips"), tr("cannot create more table")); + delete mainInterface; + } + } + else + { + sane_close(devHandle); } } else { - sane_close(devHandle); + QMessageBox::information(this, tr("tips"), tr("Open device failed")); } } - else - { - QMessageBox::information(this, tr("tips"), tr("Open device failed")); - } } } void MainWindow::on_sane_dev_remove(QString devName) { - Form_mainInterface *interface = FindInterfaceByDevName(devName); - if (interface != nullptr) + if (m_loginType == Dialog_logIn::LogInType_Burn) { - interface->setDevDisconnect(); - if (!interface->isTesting()) + m_formBurnMode->deleteDevice(devName); + } + else + { + Form_mainInterface * mainInterface = FindInterfaceByDevName(devName); + if (mainInterface != nullptr) { - RemoveInterface(interface); + mainInterface->setDevDisconnect(); + if (!mainInterface->isTesting()) + { + RemoveInterface(mainInterface); + } } } } diff --git a/app/HGProductionTool/mainwindow.h b/app/HGProductionTool/mainwindow.h index 6dcba52..0226156 100644 --- a/app/HGProductionTool/mainwindow.h +++ b/app/HGProductionTool/mainwindow.h @@ -1,14 +1,16 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include -#include "form_maininterface.h" #include "form_texttips.h" +#include "form_burnmode.h" +#include "form_maininterface.h" #include #include #include "HGPdtToolDb.h" #include "sane/sane_ex.h" #include "base/HGLock.h" #include "hgscanner.h" +#include "dialog_login.h" QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } @@ -19,7 +21,7 @@ class MainWindow : public QMainWindow Q_OBJECT public: - MainWindow(HGPdtToolDbUserMgr pdtToolDbuserMgr, const QString &ftpHost, unsigned short ftpPort, QWidget *parent = nullptr); + MainWindow(HGPdtToolDbUserMgr pdtToolDbuserMgr, Dialog_logIn::LogInType loginType, const QString &ftpHost, unsigned short ftpPort, QWidget *parent = nullptr); ~MainWindow(); static QString getLogInfo(HGResult ret); bool isExitApp(); @@ -28,8 +30,8 @@ public: Form_mainInterface* FindInterface(const QString &sn); Form_mainInterface* FindInterfaceByDevName(const QString &devName); Form_mainInterface* FindInterface(SANE_Handle handle); - bool AddInterface(Form_mainInterface *interface); - bool RemoveInterface(Form_mainInterface *interface); + bool AddInterface(Form_mainInterface * mainInterface); + bool RemoveInterface(Form_mainInterface *mainInterface); void addTestingRef(); void releaseTesting(); bool isTesting(); @@ -79,6 +81,9 @@ private: HGPdtToolDbUserMgr m_pdtToolDbuserMgr; HGLock m_lock; int m_testingRef; + Dialog_logIn::LogInType m_loginType; + + Form_BurnMode *m_formBurnMode; public: QString m_ftpHost;