From d00a4ce584a6b4e5b2dc98e0ce0aa438426e458a Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Thu, 7 Sep 2023 16:45:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E9=85=8D=E7=BD=AE=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=92=8C=E6=A3=80=E6=9F=A5=E5=8F=82=E6=95=B0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E7=A7=BB=E8=87=B3=E5=88=9D=E6=A3=80=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/HGProductionTool/ProductionTool_zh_CN.qm | Bin 16146 -> 15620 bytes app/HGProductionTool/ProductionTool_zh_CN.ts | 444 +++++++++++------- .../dialog_inputserialnum.cpp | 394 +++++++++++++--- app/HGProductionTool/dialog_inputserialnum.h | 35 +- app/HGProductionTool/dialog_inputserialnum.ui | 342 +++++++++----- app/HGProductionTool/form_burnmode.cpp | 307 +----------- app/HGProductionTool/form_burnmode.h | 18 +- app/HGProductionTool/form_burnmode.ui | 308 +----------- app/HGProductionTool/form_maininterface.cpp | 5 +- app/HGProductionTool/mainwindow.cpp | 9 +- 10 files changed, 890 insertions(+), 972 deletions(-) diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index b5688e1f1f30329075eb04408f6b8697727c2359..ba6606e1df576d66918d5caacbaff0d9b86d9a8c 100644 GIT binary patch delta 2636 zcmZXUdr(y88OGmT_IA#mJ&RoACV0eM?#M;Kidv+NT5rh0T8$cXS&l3Ui&+*_bXN()>x`6|f(L_miewIX@-MAuu+DG^cLh`4ZAxLz0oXjFv*i z%-2YpilQy=k#^b!@=?NC(*AA=QPMWjyHLQG0@5EkOcb|(^c}TC#*>WZY{uXdjA2_D zumhQCdeGgftX zz)qAkQT6#UC>MN7EoSUN19#Mo5qKUEqJHb<7f|G;`rH_(9(!B;L7}e*(o5EV<*(jTCN$R)>*aOpATXbr?kG% z?RXJ>S3C1yAL{Ma&b?O(C7x>6lw%Z{&5WjW#)#dFi7DDG-B`-R4cfi(K5TZr_S9Qy z_%&*K)5bxe-)nF3R-B*He%g8w8_#PWPsPpAJYp0(b*i>rBB9-AR$_sBgsm zP1iS9;6*}*{-6$bJGESYxCPfRV^DuF$BWz0qrZB3I+in9-}huY6l>Jq=k8+pZW+{n z!Q^sYG?>lR_)}&GNk^v{iw)8HVaL5=C~TU6bC_Y@L?}D%nBnZ2&k*kcCr&^?KEqgU z*7O2=7?QZ++o&jQ80X&r1uT!bz5Oc@_zztB86G>bmTNx?Mg?;h8kQ4@-*dgM|B=XW zp6eSwmdLc5`)b}ijHI9Yc9{m-zLXy+LW#H$e15`GD06|I(U1bWPxytl94K4EFG?xE z{Wq-Q%Xw_G{$G5}axf~NUsb8Fmfv~*FeE+^W@lUp{UHFB<1oAx_jGqy5@RqR4jR{2JxlZ!9gd;QmJ! z7|RcYqkvN5&L?@8rOtS|`aBF*fRHNU8{_$guQ8hY#>+=AeEyCuNKg=LFpm zbd;SS#ETnI$T}hQ4GVT4PbjE_5Js>Q+(g$Tjg(VK;NqR?ETHu?CL}|j7 zxMnQZuZ2AqF>Br>bj-jxe!p;LP=x^L!iQ@iaq?>6aoG;c+#@`$Nx{fIHszj$0wG1F z=>xb0>dB^Mm*6LDGc~@y9OPBv>T9OKCgjO}D&~3NmwH;9-G$o|bWbev*-hwt zkLdjEn^=}GQ4SO`f-&Z=Vyh<%U#u^6C3wd4qdkiEVzC--4Pey@@&8l7JQ1BhI z(Pqa7YmGU|j%7>RXO8dP4rM!f?4~u>ylzt^w%!T$VzevG<2EZ5^M}pb z;@81qkWp=53^p-F-Z7tP#BvJr;hl5Yf1Haw(WbYk{U1r$eyu6SZ;H69h6qgu|BtXY1QX(VS*jEiGkJ^rt`GznIQw(B;z zdREH^Lw@{Jw^#N^cDdH8xQtJ8^;FL)&U|H#&&@IvnhL4u;h@m+-7D|P9m;dNXlq?D z%GFcx*-(_3{*|K>N3X1s9ksILk)1W}WtA0m9yv{NxXUG{OLnf192JgAx01tOpBbg} z5*sK_>18MmU*dGQ-LmK3-FpI-dgDv!^tVH%o&yqR3l{JC* zQz94Zo;kIg_PLo8x{-z)WB<=l^43V@OhQRX{j=eUYiV0?M9FuQ$E5g4hzKP_t?a3E zR7vi->N44*$Swt({c|j%0#j?Uj1MrzIw8O=D|`N>HCH(&^Uvy}yrJ5{><&)_V*fHA zq9@Q+9!iod%HV7p7j-GaA2Jt}(J3N$Ww$pkkUk?=v0VR;ioJu;&u6t-2USDXVF7E8 zTw7NK<7tk{D!F`=(r@OEe9D50U;U9!_)mOF>YPsb2Paj$e@-o zvjg+nY_$37l9B?wcO>O2JP{$Zg!%W!@Akhp+8$wZZRLhsxe~cbc6tk{s{BRPh!YEw HJH!76q}ZzY delta 2981 zcmZve3s6&M7ROIQa$mVgAS4hF;X(-rfqzZxrmAV3fTtbv2Gz3(13_f=& z(t;O9ZC$J@RjX}%j;Zo~gJ}#XuC!u?E{O^863vT2ITEu==mKTVDy&EmDBpe!Ah`yJJK^m1*8yU#$SR)B0f^rxYgp)i1`ysRYh1MfAaRv!QP^JqvT51f7gm7G5ZV1| zEWIj1u1R|jfQXS>gZcoXd*sdG_&#L1{NyN{8{;tf<$^*yS1NzrItpOS%Aje+2LPi+ z2319)ohCeJ?V$_U^B;q*^+lrNr$JxUJ23Hk3dSFdf-zb}at6MLyRXPPX$LSIP*}46 zgaLi0XuQt@jILC)ex3&~{0GJ6yl%iBiLyqC@(B{DN{RGliE5KX{e8v0RhTiPNtErD zD1S@g54<4Cr46cGB7H`p>ZPIDDy_BeNHolm7`9z;bwVPBqf^{=-2jN(q@+LU!d88! z4DG;mFsGb(uM8{lrE-ZKTR~P!47n&VYOh~`!h;5*JBb^wT2a7Gj;rax9-k#&``sEG)*a;3Z&zSXJ4r`lGkyCqAD5ivxAHddS=Tcg&3m+;eT`FdtVWuKKKs#=LDp-NDk^X?{9FL{WT21vX`3A3N zGCe(aGA8hXo^=}oOT9}AtFRIY=jpBeb*NWQ?>xca{nsC+clI&>p?UP_CY*LUlfIsv ziM_f=KP)N1mK>xXRV#4Xw=gjptc0=iS5&cF!dv+JYLUh^*d z-Web2Y-ji9;X1yN?M{op1WVYfOR=&e3)p9s8?n{X*k^uEGJY72ssXxXt6KgA&Rim^UAESV(>)H^hds^F{y_{-@wIkCocI@WK%$(I$mB>2jnSTH z#^EE{&^Y@8VLvroXf{xX%E>6XaF~h^I&{Nms^xeoSwps*7PcGo!glwz*H(Hm}@f;@< zX}Lo?Lt6A4RW2_Z+Xh8H4SG~hu5^36E?X_fFLwF_TVlAdlr{@|qTVoXeP!_AIckc> zRaeXVgo;FCX_WY??rwQWS!02|J>TyZvn&3buLBEkgC^#eCOlW!;B`CQ4$kJbb5$O9 zwbRkyxD_sl~OpsBaE`Sw}2iW2C1x3>{FO zrWq%yj1T*@N`YEj4bh1FwMK!*$JL9PSoN1WTQyQt*ECt8-q^^tn6jM3Fkcc&(=APaK+nZ-x`R-R{c+LlBh_&R1_{~ y^}@sq73L&f7&>G`py4w@CW(~A3;7}3(C+AFJMCg?Ij%79U=9?;cql*dsNuh_P6y)v diff --git a/app/HGProductionTool/ProductionTool_zh_CN.ts b/app/HGProductionTool/ProductionTool_zh_CN.ts index 258786a..6993fb4 100644 --- a/app/HGProductionTool/ProductionTool_zh_CN.ts +++ b/app/HGProductionTool/ProductionTool_zh_CN.ts @@ -62,7 +62,7 @@ Dialog - 设备标识 + 设备初检 Input SN: @@ -73,87 +73,201 @@ 设备型号: - - G100 - - - - - G200 - - - - - G300 - - - - - G400 - - - - devType : - 设备类型: + 设备类型: - + + Scanner: + 设备名: + + + serialNum: 序列号: - + Set Sn 设置序列号 - + + Set configuration + 目标配置写入到设备 + + + + Check configuration + 检查配置是否一致 + + + + Enter Test + 进入测试 + + OK - 确定 + 确定 - Cancel - 取消 + 取消 - - - - - - + + + + + + tips 提示 - + + Speed mode + 速度模式 + + + + Sleep time + 休眠时间 + + + + Vid and Pid + Vid和Pid + + + + + Prompt + 提示 + + + Inconsistent configuration %1detected, reconfigured, please check again + 检测到配置%1不一致,已重新配置,请再次检查 + + + + Consistent configuration + 配置一致! + + + device is lost 设备已丢失 - + Serial num is empty 序列号为空 - + sn is illegal 序列号不合法 - + The device is testing 该设备正在进行测试 - + set sn failed 设置序列号失败 - + + Device name: %1 + 设备名: %1 + + + + Target Configration: + Target Configration: + + 目标配置: + + + + + + Speep mode: %1PPM + Speep mode: %1PPM + + 速度模式: %1PPM + + + + + + Sleep time: %1minute + Sleep time: %1minute + + 休眠时间: %1分钟 + + + + + + Vid: %1 Pid: %2 + Vid: %1 Pid: %2 + + Vid: %1 Pid: %2 + + + + Current Configration of device: + 当前设备配置: + + + + Set serial number: %1 + 设置序列号: %1 + + + + Test result: Failed! + 测试结果:失败! + + + + Test result: Succeed! + 测试结果:成功! + + + + Inconsistent configuration %1detected, please reconfigure, and check again + 检测到配置 %1不一致,请重新配置后再次检查 + + + + Set configuration to device + 将目标配置设置到设备 + + + + Test content: + 测试内容: + + + + + + Sleep time: Not sleeping + 休眠时间: 不休眠 + + + + + Tester: %1, Test item: %2 + 测试员: %1, 测试项: %2 + + + set sn succeed 设置序列号成功 @@ -511,55 +625,55 @@ 退出 - + Set host and port 设置IP与端口 - + Minimize 最小化 - + Close 关闭 - + LogIn 登录 - - - - + + + + Prompt 提示 - + Account dose not exist 账户不存在 - + Password can not be empty 密码不能为空 - + Password error 密码错误 - + Please select a profile first 请先选择配置文件 - + Select profile 选择配置文件 @@ -715,29 +829,30 @@ 烧录模式 - + + SelectAll + 全选 + + + Entering burning mode 进入烧录模式 - Confirm completion of burning - 确认烧录完成并重启 + 确认烧录完成并重启 - Check configuration - 检查配置是否一致 + 检查配置是否一致 - Complete - 完成 + 完成 - Abnormal exit - 异常退出 + 异常退出 Select All @@ -756,110 +871,91 @@ 关闭设备 - + ID 序号 - + selected 选择 - + device 设备 - Target Configration: - 目标配置: + 目标配置: - Speep mode: %1PPM - 速度模式: %1PPM + 速度模式: %1PPM - Sleep time: %1minute - 休眠时间: %1分钟 + 休眠时间: %1分钟 - Sleep time: Not sleeping - 休眠时间: 不休眠 + 休眠时间: 不休眠 - Vid: %1 Pid: %2 - Vid: %1 Pid: %2 + Vid: %1 Pid: %2 - Current Configration of device: - 当前设备配置: + 当前设备配置: - - Speep mode: %1PPM - 速度模式: %1PPM + 速度模式: %1PPM - - Sleep time: %1minute - 休眠时间: %1分钟 + 休眠时间: %1分钟 - - Sleep time: Not sleeping - 休眠时间: 不休眠 + 休眠时间: 不休眠 - - Vid: %1 Pid: %2 - Vid: %1 Pid: %2 + Vid: %1 Pid: %2 - Complete burning and configure device parameters: Complete burning and configure device parameters: - 完成烧录并且配置设备参数: + 完成烧录并且配置设备参数: - Speed mode Speed time - 速度模式 + 速度模式 - Tester: %1, Test item: Burn, Test completed - 测试员: %1, 测试项: 烧录, 测试完成! + 测试员: %1, 测试项: 烧录, 测试完成! - Tester: %1, Test item: Burn, Test result: Failed! Reason: %2 - 测试员: %1, 测试项: 烧录, 测试失败! 原因:%2 + 测试员: %1, 测试项: 烧录, 测试失败! 原因:%2 - Tester: %1, Test item: Burn, Test contents: %2 - 测试员: %1, 测试项: 烧录, 测试内容: %2 + 测试员: %1, 测试项: 烧录, 测试内容: %2 Current Configration of device: @@ -868,42 +964,36 @@ - Sleep time - 休眠时间 + 休眠时间 - Vid and Pid - Vid和Pid + Vid和Pid - - Prompt - 提示 + 提示 - Inconsistent configuration %1detected, reconfigured, please check again - 检测到配置%1不一致,已重新配置,请再次检查 + 检测到配置%1不一致,已重新配置,请再次检查 - Consistent configuration - 配置一致! + 配置一致! serialNum 序列号 - + tips 提示 - + Please check a devices at least 请至少勾选一台设备 @@ -1057,12 +1147,12 @@ 设备未连接 - + Device type: 设备类型: - + SerialNum: 序列号: @@ -1079,7 +1169,7 @@ 休眠时间: - + load last image which uploaded last time 加载上一次上传的图片 @@ -1088,14 +1178,14 @@ 设备已断开 - + tips 提示 - - - + + + destortion value: 畸变修正值: @@ -1108,68 +1198,68 @@ 取消 - + speed mode: 目标配置: 速度模式: - + sleep time: 休眠时间: - + ,but correct information is abnormal ,但是校正有异常 - + please verify the configuration of the device: 请验证设备配置: - + vid:%1 vid:%1 - + pid:%1 pid:%1 - + sleep time:%1minute 休眠时间:%1分钟 - + sleep time:%1 休眠时间:%1 - - + + Not sleeping 不休眠 - + speed mode:%1PPM 速度模式:%1PPM - + device model:%1 设备型号:%1 @@ -1184,46 +1274,46 @@ 设备序列号: %1, 测试项: %2, 测试结果: 通过! - - + + device history scan count: 设备历史扫描张数: - - - - + + + + Prompt 提示 - + Tester: %1, Test item: %2, Test result: Failed! Reason: %3 测试员: %1, 测试项: %2, 测试结果: 不通过! 原因: %3 - + Tester: %1, Test item: %2, Test result: Pass! 测试员: %1, 测试项: %2, 测试结果: 通过! - + No paper 无纸 - + Device is sleeping 设备处于休眠模式 - + Counting mode 设备处于计数模式 - + Other error 其他错误 @@ -1232,39 +1322,39 @@ 设备序列号:%1 - + ID 序号 - + Test items 测试项 - + status 测试状态 - + not test 未测试 - - + + not pass 不通过 - + not support 不支持 - - + + pass 通过 @@ -1290,31 +1380,31 @@ Pid: - - + + device roller count: 设备滚轴张数: - - + + image pixel: 标准圆:宽 * 高: - + FirmwareNum: 固件号: - + device serial number:%1 设备序列号:%1 - + device firmware number:%1 device firmware number:%1 @@ -1322,17 +1412,17 @@ - + minute 分钟 - + VID: VID: - + PID: PID: @@ -1428,38 +1518,38 @@ 数据库错误 - - - - - + + + + + tips 提示 - + production tool-burn station 华高生产工具-烧录工位 - + production tool-init test station 华高生产工具-初检工位 - + production tool-image test station 华高生产工具-图像测试工位 - + production tool-pressure test station 华高生产工具-压力测试工位 - - - + + + Is testing, do not close! 测试中,请勿关闭! @@ -1481,8 +1571,8 @@ 取消 - - + + cannot create more table 不能创建更多项目 diff --git a/app/HGProductionTool/dialog_inputserialnum.cpp b/app/HGProductionTool/dialog_inputserialnum.cpp index 611203e..c5af867 100644 --- a/app/HGProductionTool/dialog_inputserialnum.cpp +++ b/app/HGProductionTool/dialog_inputserialnum.cpp @@ -1,20 +1,23 @@ #include "dialog_inputserialnum.h" #include "ui_dialog_inputserialnum.h" -#include "mainwindow.h" #include "base/HGBase.h" +#include "HGUIGlobal.h" -Dialog_InputSerialNum::Dialog_InputSerialNum(class MainWindow *mainWnd, const QString &devName, const QString &profileName, - SANE_Handle handle, const QString &serialNum, const QString &devType) : +Dialog_InputSerialNum::Dialog_InputSerialNum(class MainWindow *mainWnd, Dialog_logIn::LogInType logInType, const QString &devName, const QString &profileName, + const QString &accountName, SANE_Handle handle, const QString &serialNum, const QString &devType) : QDialog(mainWnd), ui(new Ui::Dialog_InputSerialNum), m_mainWnd(mainWnd), + m_logInType(logInType), m_handle(handle), m_valid(true), m_profileName(profileName), + m_accountName(accountName), m_serialNum(serialNum), m_devType(devType), m_devName(devName), - m_hg(nullptr) + m_hg(nullptr), + m_curIndex(0) { ui->setupUi(this); @@ -24,19 +27,29 @@ Dialog_InputSerialNum::Dialog_InputSerialNum(class MainWindow *mainWnd, const QS ft.setPointSize(15); this->setFont(ft); + if (m_logInType != Dialog_logIn::LogInType_InitTest) + { + ui->lineEdit_sn->setEnabled(false); + ui->pbtn_setSn->setEnabled(false); + ui->pbtn_setConfig->setEnabled(false); + } + + ui->pbtn_enterTest->setEnabled(false); + ui->textEdit_curConfig->setReadOnly(true); + ui->textEdit_target->setReadOnly(true); + + ui->label_scanner->setText(tr("Device name: %1").arg(m_devName)); + ui->lineEdit_sn->setValidator(new QRegExpValidator(QRegExp("[a-zA-Z0-9]+$"))); ui->lineEdit_sn->setMaxLength(14); if (handle != nullptr) { - ui->cbox_devType->setEnabled(false); - ui->cbox_devType->setCurrentText(devType); ui->lineEdit_sn->setText(serialNum); ui->lineEdit_sn->selectAll(); } else { - ui->cbox_devType->setCurrentIndex(0); ui->lineEdit_sn->setText(""); ui->pbtn_setSn->setEnabled(false); } @@ -45,6 +58,10 @@ Dialog_InputSerialNum::Dialog_InputSerialNum(class MainWindow *mainWnd, const QS m_hg = new hgscanner(nullptr, nullptr, this, m_handle); connect(this, SIGNAL(testResult()), this, SLOT(on_testResult())); + + setSleepTime(); + updateTargetCfg(); + updateCurDeviceCfg(); } Dialog_InputSerialNum::~Dialog_InputSerialNum() @@ -62,7 +79,7 @@ QString Dialog_InputSerialNum::GetSn() QString Dialog_InputSerialNum::GetDevType() { - return ui->cbox_devType->currentText(); + return m_devType; } void Dialog_InputSerialNum::Invalid(const QString &devName) @@ -76,65 +93,288 @@ void Dialog_InputSerialNum::Invalid(const QString &devName) } } -void Dialog_InputSerialNum::setSpeedAndSleep(bool updateSleep) +void Dialog_InputSerialNum::setSpeedMode() { - if (m_hg == nullptr) - { - return; - } - - //HGPdtToolDb_DownloadFile(m_pdtToolDbuserMgr, m_devType.toStdString().c_str(), cfgPath); - AnalysisJson analysisJson(m_profileName); AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal(); 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.VID = jsonGlobal.vid_to; -// vidpid.PID = jsonGlobal.pid_to; -// int vidpidValue = vidpid.Value; -// lp->cat = WRITE_CAT_VID_PID; -// lp->val = (void*)&vidpidValue; -// m_mainWnd->addTestingRef(); -// func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg); - -// int speedMode = jsonGlobal.speed_mode ; -// lp->cat = WRITE_CAT_SPEED; -// lp->val = (void*)&speedMode; -// m_mainWnd->addTestingRef(); -// func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg); - -// QString device_model = jsonGlobal.device_model; -// if (!device_model.isEmpty()) -// { -// std::wstring devModel = device_model.toStdWString(); -// lp->cat = WRITE_CAT_DEVS_MODEL; -// lp->val = (void*)devModel.c_str(); -// m_mainWnd->addTestingRef(); -// func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg); -// } + int speedMode = jsonGlobal.speed_mode; + lp->cat = WRITE_CAT_SPEED; + lp->val = (void*)&speedMode; + func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg); delete lp; } -void Dialog_InputSerialNum::on_testResult() +void Dialog_InputSerialNum::setSleepTime() { - m_mainWnd->releaseTesting(); + AnalysisJson analysisJson(m_profileName); + AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal(); + LPWRITECFG lp = new WRITECFG; + + int sleepTime = jsonGlobal.sleep_time; + lp->cat = WRITE_CAT_SLEEP; + lp->val = (void*)&sleepTime; + func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg); + + delete lp; } -void Dialog_InputSerialNum::on_pbtn_ok_clicked() +void Dialog_InputSerialNum::setVidPid() +{ + AnalysisJson analysisJson(m_profileName); + AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal(); + LPWRITECFG lp = new WRITECFG; + + VIDPID vidpid; + vidpid.VID = jsonGlobal.vid_to; + vidpid.PID = jsonGlobal.pid_to; + int vidpidValue = vidpid.Value; + lp->cat = WRITE_CAT_VID_PID; + lp->val = (void*)&vidpidValue; + func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg); + + delete lp; +} + +void Dialog_InputSerialNum::rebootDevice() +{ + const wchar_t *p = L"0"; + func_test_go(HGPDTTOOLDB_NAME_REBOOT_DEVICE, p, m_hg); +} + +int Dialog_InputSerialNum::getSpeedMode() +{ + SANE_Int speedMode = 0; + unsigned int len = sizeof(SANE_Int); + sane_io_control(m_handle, IO_CTRL_CODE_GET_SPEED_MODE, &speedMode, &len); + + const wchar_t G100[6] = { 70,80,90,110 }; + const wchar_t G200[6] = { 100,110,120,130 }; + const wchar_t G300[6] = { 40,50,60,70,80,90 }; + const wchar_t G400[6] = { 40,50,60,70,80,90 }; + + int speed = 0; + + if ((int)speedMode >= 40) + speed = (int)speedMode; + else + { + if (m_devType == "G100") + speed = G100[(int)speedMode - 1]; + else if (m_devType == "G200") + speed = G200[(int)speedMode - 1]; + else if (m_devType == "G300") + speed = G300[(int)speedMode - 1]; + else if (m_devType == "G400") + speed = G400[(int)speedMode - 1]; + } + + return speed; +} + +int Dialog_InputSerialNum::getSleepTime() +{ + int sleepTime = SANE_POWER_FIRST; + unsigned int len2 = sizeof(int); + sane_io_control(m_handle, IO_CTRL_CODE_GET_POWER_LEVEL, &sleepTime, &len2); + + if (sleepTime > 99999 || sleepTime == -1) + return 0; + + return (sleepTime / 60); +} + +int Dialog_InputSerialNum::getDevVid() +{ + VIDPID vidpid; + int vidpid_val; + unsigned int len = sizeof(int); + sane_io_control(m_handle, IO_CTRL_CODE_GET_VIDPID, &vidpid_val, &len); + vidpid.Value = vidpid_val; + int vid = vidpid.VID; + return vid; +} + +int Dialog_InputSerialNum::getDevPid() +{ + VIDPID vidpid; + int vidpid_val; + unsigned int len = sizeof(int); + sane_io_control(m_handle, IO_CTRL_CODE_GET_VIDPID, &vidpid_val, &len); + vidpid.Value = vidpid_val; + int pid = vidpid.PID; + return pid; +} + +void Dialog_InputSerialNum::updateTargetCfg() +{ + ui->textEdit_target->clear(); + + AnalysisJson analysisJson(m_profileName); + AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal(); + + int speedMode = jsonGlobal.speed_mode; + int sleepTime = jsonGlobal.sleep_time; + int vid_to = jsonGlobal.vid_to; + int pid_to = jsonGlobal.pid_to; + + char buf[10]; + sprintf(buf, "%x", vid_to); + + char buf2[10]; + sprintf(buf2, "%x", pid_to); + + QString content; + content.append(tr("Target Configration:") + "\n\t"); + content.append(tr("Speep mode: %1PPM").arg(QString::number(speedMode)) + "\n\t"); + content.append((sleepTime > 0 ? tr("Sleep time: %1minute").arg(QString::number(sleepTime)) : tr("Sleep time: Not sleeping")) + "\n\t"); + content.append(tr("Vid: %1 Pid: %2").arg(QString::fromStdString(buf)).arg(QString::fromStdString(buf2)) + "\n\t"); + + ui->textEdit_target->setText(content); +} + +void Dialog_InputSerialNum::updateCurDeviceCfg() +{ + ui->textEdit_curConfig->clear(); + + if (m_handle == nullptr) + return; + + int speedMode = getSpeedMode(); + int sleepTime = getSleepTime(); + int vid_to = getDevVid(); + int pid_to = getDevPid(); + + char buf[10]; + sprintf(buf, "%x", vid_to); + + char buf2[10]; + sprintf(buf2, "%x", pid_to); + + QString content; + content.append(tr("Current Configration of device:") + "\n\t"); + content.append(tr("Speep mode: %1PPM").arg(QString::number(speedMode)) + "\n\t"); + content.append(sleepTime > 0 ? tr("Sleep time: %1minute").arg(QString::number(sleepTime)) : tr("Sleep time: Not sleeping") + "\n\t"); + content.append(tr("Vid: %1 Pid: %2").arg(QString::fromStdString(buf)).arg(QString::fromStdString(buf2)) + "\n\t"); + + ui->textEdit_curConfig->setText(content); +} + +QString Dialog_InputSerialNum::getLogPath() +{ + HGChar cachePath[512]; + HGBase_GetDocumentsPath(cachePath, 512); + HGChar procName[512]; + HGBase_GetProcessName(procName, 512); + strcat(cachePath, procName); + strcat(cachePath, "/Test_Log/"); + + return getStdFileName(cachePath); +} + +void Dialog_InputSerialNum::writeTestLog(QString logContent) +{ + QString logPath = getLogPath(); + HGBase_CreateDir(getStdString(logPath).c_str()); + + QString fileName = logPath + m_serialNum + ".log"; + QFile file(fileName); + if(!file.open(QIODevice::ReadWrite | QIODevice::Append)) + { + return; + } + + QDateTime dateTime= QDateTime::currentDateTime(); + QString curTime = dateTime .toString("yyyy-MM-dd hh:mm:ss"); + QString content = "[" + curTime + "] "; + content += logContent; + + QTextStream txtOutput(&file); + txtOutput << content << endl; + file.close(); +} + +void Dialog_InputSerialNum::on_testResult() +{ + //m_mainWnd->releaseTesting(); +} + +void Dialog_InputSerialNum::on_pbtn_setSn_clicked() +{ + QString sn = ui->lineEdit_sn->text(); + std::string serialNum = sn.toStdString(); + + QString testLog = tr("Tester: %1, Test item: %2").arg(m_accountName).arg(QString(tr("Set serial number: %1 ").arg(sn))); + if(SANE_STATUS_GOOD != sane_io_control(m_handle, IO_CTRL_CODE_SET_SERIAL, &serialNum[0], nullptr)) + { + QMessageBox::information(this, tr("tips"), tr("set sn failed")); + writeTestLog(testLog + tr("Test result: Failed!")); + } + else + { + QMessageBox::information(this, tr("tips"), tr("set sn succeed")); + writeTestLog(testLog + tr("Test result: Succeed!")); + } +} + +void Dialog_InputSerialNum::on_pbtn_checkConfig_clicked() +{ + AnalysisJson analysisJson(m_profileName); + AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal(); + + int speedMode_to = jsonGlobal.speed_mode; + int sleepTime_to = jsonGlobal.sleep_time; + int vid_to = jsonGlobal.vid_to; + int pid_to = jsonGlobal.pid_to; + + int speedMode = getSpeedMode(); + int sleepTime = getSleepTime(); + int vid = getDevVid(); + int pid = getDevPid(); + + QString item; + bool right = true; + LPWRITECFG lp = new WRITECFG; + if (speedMode_to != speedMode) + { + item.append(tr("Speed mode")); + item.append(" "); + right = false; + } + + if (sleepTime_to != sleepTime) + { + item.append(tr("Sleep time")); + item.append(" "); + right = false; + } + + if (vid != vid_to || pid != pid_to) + { + item.append(tr("Vid and Pid")); + item.append(" "); + right = false; + } + + if (!right) + { + QMessageBox::information(this, tr("Prompt"), tr("Inconsistent configuration %1detected, please reconfigure, and check again").arg(item)); + } + else + { + QMessageBox::information(this, tr("Prompt"), tr("Consistent configuration")); + ui->pbtn_enterTest->setEnabled(true); + } + + delete lp; + + updateTargetCfg(); + updateCurDeviceCfg(); +} + +void Dialog_InputSerialNum::on_pbtn_enterTest_clicked() { if (!m_valid) { @@ -165,28 +405,36 @@ void Dialog_InputSerialNum::on_pbtn_ok_clicked() return; } - setSpeedAndSleep(true); accept(); } -void Dialog_InputSerialNum::on_pbtn_cancel_clicked() +void Dialog_InputSerialNum::on_pbtn_setConfig_clicked() { - reject(); -} + setSpeedMode(); + setSleepTime(); + setVidPid(); -void Dialog_InputSerialNum::on_pbtn_setSn_clicked() -{ - QString sn = ui->lineEdit_sn->text(); - std::string serialNum = sn.toStdString(); - if(SANE_STATUS_GOOD != sane_io_control(m_handle, IO_CTRL_CODE_SET_SERIAL, &serialNum[0], nullptr)) - { - QMessageBox::information(this, tr("tips"), tr("set sn failed")); - } - else - { - ui->lineEdit_sn->setText(m_mainWnd->getDevSn(m_handle)); - QMessageBox::information(this, tr("tips"), tr("set sn succeed")); - } + AnalysisJson analysisJson(m_profileName); + AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal(); - setSpeedAndSleep(false); + int speedMode = jsonGlobal.speed_mode; + int sleepTime = jsonGlobal.sleep_time; + int vid_to = jsonGlobal.vid_to; + int pid_to = jsonGlobal.pid_to; + + char buf[10]; + sprintf(buf, "%x", vid_to); + char buf2[10]; + sprintf(buf2, "%x", pid_to); + + QString content; + content.append(tr("Speep mode: %1PPM").arg(QString::number(speedMode)) + " "); + content.append((sleepTime > 0 ? tr("Sleep time: %1minute").arg(QString::number(sleepTime)) : tr("Sleep time: Not sleeping")) + " "); + content.append(tr("Vid: %1 Pid: %2").arg(QString::fromStdString(buf)).arg(QString::fromStdString(buf2))); + + writeTestLog(tr("Tester: %1, Test item: %2").arg(m_accountName).arg(tr("Set configuration to device ") + + tr("Test content: ") + content)); + + updateTargetCfg(); + updateCurDeviceCfg(); } diff --git a/app/HGProductionTool/dialog_inputserialnum.h b/app/HGProductionTool/dialog_inputserialnum.h index 876eacc..e4b0040 100644 --- a/app/HGProductionTool/dialog_inputserialnum.h +++ b/app/HGProductionTool/dialog_inputserialnum.h @@ -5,6 +5,7 @@ #include "sane/sane_ex.h" //#include "HGPdtToolDb.h" #include "hgscanner.h" +#include "mainwindow.h" namespace Ui { class Dialog_InputSerialNum; @@ -15,14 +16,29 @@ class Dialog_InputSerialNum : public QDialog Q_OBJECT public: - explicit Dialog_InputSerialNum(class MainWindow *mainWnd, const QString &devName, const QString &profileName, - SANE_Handle handle, const QString &serialNum, const QString &devType); + explicit Dialog_InputSerialNum(class MainWindow *mainWnd, Dialog_logIn::LogInType logInType, const QString &devName, const QString &profileName, + const QString &accountName, SANE_Handle handle, const QString &serialNum, const QString &devType); ~Dialog_InputSerialNum(); QString GetSn(); QString GetDevType(); void Invalid(const QString &devName); - void setSpeedAndSleep(bool updateSleep); + + void setSpeedMode(); + void setSleepTime(); + void setVidPid(); + void rebootDevice(); + + int getSpeedMode(); + int getSleepTime(); + int getDevVid(); + int getDevPid(); + +private: + void updateTargetCfg(); + void updateCurDeviceCfg(); + QString getLogPath(); + void writeTestLog(QString logContent); signals: void testResult(); @@ -42,24 +58,31 @@ private: }; private slots: - void on_pbtn_ok_clicked(); - - void on_pbtn_cancel_clicked(); void on_pbtn_setSn_clicked(); + void on_pbtn_checkConfig_clicked(); + + void on_pbtn_enterTest_clicked(); + + void on_pbtn_setConfig_clicked(); + private: Ui::Dialog_InputSerialNum *ui; class MainWindow *m_mainWnd; + Dialog_logIn::LogInType m_logInType; SANE_Handle m_handle; bool m_valid; QString m_profileName; + QString m_accountName; QString m_serialNum; QString m_devType; QString m_devName; //HGPdtToolDbUserMgr m_pdtToolDbuserMgr; hgscanner *m_hg; + + int m_curIndex; }; #endif // DIALOG_INPUTSERIALNUM_H diff --git a/app/HGProductionTool/dialog_inputserialnum.ui b/app/HGProductionTool/dialog_inputserialnum.ui index 6734f5c..b683407 100644 --- a/app/HGProductionTool/dialog_inputserialnum.ui +++ b/app/HGProductionTool/dialog_inputserialnum.ui @@ -6,130 +6,250 @@ 0 0 - 572 - 212 + 614 + 384 Dialog - - - - 210 - 150 - 75 - 31 - - - - OK - - - - - - 330 - 150 - 75 - 31 - - - - Cancel - - - - - - 190 - 80 - 191 - 31 - - - - - 130 - 0 - - + - - G100 - + + + + + Scanner: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - G200 - + + + + + + + + Qt::Vertical + + + + + + + - - G300 - + + + Qt::Vertical + + + + 20 + 25 + + + - - G400 - + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 71 + 21 + + + + serialNum: + + + + + + + + 241 + 31 + + + + + + + + + 131 + 31 + + + + Set Sn + + + + + + + + 43 + 23 + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - - - - - 80 - 80 - 91 - 21 - - - - devType : - - - - - - 100 - 30 - 71 - 21 - - - - serialNum: - - - - - - 190 - 30 - 191 - 31 - - - - - 130 - 0 - - - - - - - 390 - 30 - 131 - 31 - - - - Set Sn - - + + + + Qt::Vertical + + + + 20 + 7 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 190 + 30 + + + + + 190 + 30 + + + + Qt::LeftToRight + + + Set configuration + + + + + + + + 190 + 30 + + + + + 190 + 30 + + + + Qt::LeftToRight + + + Check configuration + + + + + + + + 190 + 30 + + + + + 190 + 30 + + + + Qt::LeftToRight + + + Enter Test + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + diff --git a/app/HGProductionTool/form_burnmode.cpp b/app/HGProductionTool/form_burnmode.cpp index 4bfe064..4f5ec9c 100644 --- a/app/HGProductionTool/form_burnmode.cpp +++ b/app/HGProductionTool/form_burnmode.cpp @@ -11,26 +11,15 @@ #include #include -Form_BurnMode::Form_BurnMode(class MainWindow *mainwnd, const QString &profileName, const QString &accountName, QWidget *parent) : +Form_BurnMode::Form_BurnMode(class MainWindow *mainwnd, QWidget *parent) : QWidget(parent), m_curIndex(0), - m_profileName(profileName), - m_accountName(accountName), m_mainwnd(mainwnd), m_hg(nullptr), ui(new Ui::Form_BurnMode) { ui->setupUi(this); - ui->textEdit_target->setReadOnly(true); - ui->textEdit_curConfig->setReadOnly(true); - - ui->pbtn_enterBurnMode->setEnabled(true); - ui->pbtn_confirmFinishBurn->setEnabled(false); - ui->pbtn_checkConfig->setEnabled(false); - ui->pbtn_complete->setEnabled(false); - ui->pbtn_abnormal->setEnabled(false); - connect(this, SIGNAL(testResult(bool)), this, SLOT(on_testResult(bool)), Qt::QueuedConnection); initTableWidget(); @@ -59,8 +48,6 @@ void Form_BurnMode::addDevice(DeviceManager *devManager) item->setData(Qt::UserRole, var); updatetablewidget(); - updateTargetCfg(); - updateCurDeviceCfg(); m_curIndex++; } @@ -85,8 +72,6 @@ void Form_BurnMode::deleteDevice(QString devName) } } updatetablewidget(); - updateTargetCfg(); - updateCurDeviceCfg(); } DeviceManager *Form_BurnMode::getDevManager() @@ -151,118 +136,27 @@ void Form_BurnMode:: updatetablewidget() if (item != nullptr) item->setCheckState(Qt::Checked); } - //ui->cbox_selectAll->setChecked(true); + ui->cbox_selectAll->setChecked(true); } -void Form_BurnMode::updateTargetCfg() +void Form_BurnMode::on_cbox_selectAll_stateChanged(int arg1) { - ui->textEdit_target->clear(); + (void)arg1; + bool check = ui->cbox_selectAll->isChecked(); - AnalysisJson analysisJson(m_profileName); - AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal(); - - int speedMode = jsonGlobal.speed_mode; - int sleepTime = jsonGlobal.sleep_time; - int vid_to = jsonGlobal.vid_to; - int pid_to = jsonGlobal.pid_to; - - char buf[10]; - sprintf(buf, "%x", vid_to); - - char buf2[10]; - sprintf(buf2, "%x", pid_to); - - QString content; - content += tr("Target Configration:\n\t"); - content += tr("Speep mode: %1PPM\n\t").arg(QString::number(speedMode)); - content.append(sleepTime > 0 ? tr("Sleep time: %1minute\n\t").arg(QString::number(sleepTime)) : tr("Sleep time: Not sleeping\n\t")); - content += tr("Vid: %1 Pid: %2\n\t").arg(QString::fromStdString(buf)).arg(QString::fromStdString(buf2)); - - ui->textEdit_target->setText(content); -} - -void Form_BurnMode::updateCurDeviceCfg() -{ - ui->textEdit_curConfig->clear(); - - DeviceManager *devManager = getDevManager(); - if (devManager == nullptr) - return; - - int speedMode = devManager->getSpeedMode(); - int sleepTime = devManager->getSleepTime(); - int vid_to = devManager->getDevVid(); - int pid_to = devManager->getDevPid(); - - char buf[10]; - sprintf(buf, "%x", vid_to); - - char buf2[10]; - sprintf(buf2, "%x", pid_to); - - QString content; - content.append(tr("Current Configration of device:") + "\n\t"); - content.append(tr("Speep mode: %1PPM").arg(QString::number(speedMode)) + "\n\t"); - content.append(sleepTime > 0 ? tr("Sleep time: %1minute").arg(QString::number(sleepTime)) : tr("Sleep time: Not sleeping") + "\n\t"); - content.append(tr("Vid: %1 Pid: %2").arg(QString::fromStdString(buf)).arg(QString::fromStdString(buf2)) + "\n\t"); - - ui->textEdit_curConfig->setText(content); -} - -QString Form_BurnMode::getLogPath() -{ - HGChar cachePath[512]; - HGBase_GetDocumentsPath(cachePath, 512); - HGChar procName[512]; - HGBase_GetProcessName(procName, 512); - strcat(cachePath, procName); - strcat(cachePath, "/Test_Log/"); - - return getStdFileName(cachePath); -} - -void Form_BurnMode::writeTestLog(QString logContent) -{ - QString logPath = getLogPath(); - HGBase_CreateDir(getStdString(logPath).c_str()); - - DeviceManager *devManager = getDevManager(); - QString serialNum = devManager->getSerialNum(); - QString fileName = logPath + serialNum + ".log"; - QFile file(fileName); - if(!file.open(QIODevice::ReadWrite | QIODevice::Append)) + for(int i = 0; i < ui->tableWidget->rowCount(); i++) { - return; + QTableWidgetItem *item = ui->tableWidget->item(i, 1); + if (item != nullptr) + { + if (check) + item->setCheckState(Qt::Checked); + else + item->setCheckState(Qt::Unchecked); + } } - - QDateTime dateTime= QDateTime::currentDateTime(); - QString curTime = dateTime .toString("yyyy-MM-dd hh:mm:ss"); - QString content = "[" + curTime + "] "; - content += logContent; - - QTextStream txtOutput(&file); - txtOutput << content << endl; - file.close(); } -//void Form_BurnMode::on_cbox_selectAll_stateChanged(int arg1) -//{ -// (void)arg1; -// bool check = ui->cbox_selectAll->isChecked(); - -// for(int i = 0; i < ui->tableWidget->rowCount(); 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_enterBurnMode_clicked() { int select = 0; @@ -287,13 +181,6 @@ void Form_BurnMode::on_pbtn_enterBurnMode_clicked() { DeviceManager *devManager = (DeviceManager*)item->data(Qt::UserRole).value(); devManager->setBurnMode(); - - ui->pbtn_confirmFinishBurn->setEnabled(true); - ui->pbtn_checkConfig->setEnabled(false); - ui->pbtn_complete->setEnabled(false); - ui->pbtn_abnormal->setEnabled(true); - - m_mainwnd->setLogOutStatus(false); } } } @@ -514,169 +401,3 @@ void Form_BurnMode::on_tableWidget_itemDoubleClicked(QTableWidgetItem *item) // updatetablewidget(); //} - -void Form_BurnMode::on_pbtn_confirmFinishBurn_clicked() -{ - int select = 0; - for(int i = 0; i < ui->tableWidget->rowCount(); 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 at least")); - return; - } - - DeviceManager *devManager = getDevManager(); - if (devManager == nullptr) - return; - - devManager->setSpeedMode(); - devManager->setSleepTime(); - devManager->setVidPid(); - devManager->rebootDevice(); - - AnalysisJson analysisJson(m_profileName); - AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal(); - int speedMode_to = jsonGlobal.speed_mode; - int sleepTime_to = jsonGlobal.sleep_time; - int vid_to = jsonGlobal.vid_to; - int pid_to = jsonGlobal.pid_to; - - char buf[10]; - sprintf(buf, "%x", vid_to); - - char buf2[10]; - sprintf(buf2, "%x", pid_to); - - QString content; - content.append(tr("Complete burning and configure device parameters: ")); - content.append(tr("Speep mode: %1PPM").arg(QString::number(speedMode_to)) + " "); - content.append(sleepTime_to > 0 ? tr("Sleep time: %1minute").arg(QString::number(sleepTime_to)) : tr("Sleep time: Not sleeping") + " "); - content.append(tr("Vid: %1 Pid: %2").arg(QString::fromStdString(buf)).arg(QString::fromStdString(buf2)) + " "); - writeTestLog(tr("Tester: %1, Test item: Burn, Test contents: %2").arg(m_accountName).arg(content)); - - ui->pbtn_checkConfig->setEnabled(true); -} - -void Form_BurnMode::on_pbtn_checkConfig_clicked() -{ - int select = 0; - for(int i = 0; i < ui->tableWidget->rowCount(); 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 at least")); - return; - } - - AnalysisJson analysisJson(m_profileName); - AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal(); - - int speedMode_to = jsonGlobal.speed_mode; - int sleepTime_to = jsonGlobal.sleep_time; - int vid_to = jsonGlobal.vid_to; - int pid_to = jsonGlobal.pid_to; - - DeviceManager *devManager = getDevManager(); - if (devManager == nullptr) - return; - - int speedMode = devManager->getSpeedMode(); - int sleepTime = devManager->getSleepTime(); - int vid = devManager->getDevVid(); - int pid = devManager->getDevPid(); - - QString item; - bool right = true; - LPWRITECFG lp = new WRITECFG; - if (speedMode_to != speedMode) - { - item.append(tr("Speed mode")); - item.append(" "); - right = false; - devManager->setSpeedMode(); - } - - if (sleepTime_to != sleepTime) - { - item.append(tr("Sleep time")); - item.append(" "); - right = false; - devManager->setSleepTime(); - } - - if (vid != vid_to || pid != pid_to) - { - item.append(tr("Vid and Pid")); - item.append(" "); - right = false; - devManager->setVidPid(); - } - - if (!right) - { - QMessageBox::information(this, tr("Prompt"), tr("Inconsistent configuration %1detected, reconfigured, please check again").arg(item)); - } - else - { - QMessageBox::information(this, tr("Prompt"), tr("Consistent configuration")); - - ui->pbtn_complete->setEnabled(true); - } - - delete lp; - - updateTargetCfg(); - updateCurDeviceCfg(); -} - -void Form_BurnMode::on_pbtn_complete_clicked() -{ - writeTestLog(tr("Tester: %1, Test item: Burn, Test completed").arg(m_accountName)); - ui->pbtn_enterBurnMode->setEnabled(true); - ui->pbtn_confirmFinishBurn->setEnabled(false); - ui->pbtn_checkConfig->setEnabled(false); - ui->pbtn_complete->setEnabled(false); - - m_mainwnd->setLogOutStatus(true); -} - -void Form_BurnMode::on_pbtn_abnormal_clicked() -{ - int select = 0; - for(int i = 0; i < ui->tableWidget->rowCount(); 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 at least")); - return; - } - - Dialog_ExcepDesc dlg(this); - if (dlg.exec()) - { - QString str = dlg.getExcepDesc(); - writeTestLog(tr("Tester: %1, Test item: Burn, Test result: Failed! Reason: %2") - .arg(m_accountName).arg(str)); - } - - m_mainwnd->setLogOutStatus(true); -} diff --git a/app/HGProductionTool/form_burnmode.h b/app/HGProductionTool/form_burnmode.h index 0db4447..02d86fd 100644 --- a/app/HGProductionTool/form_burnmode.h +++ b/app/HGProductionTool/form_burnmode.h @@ -60,7 +60,7 @@ class Form_BurnMode : public QWidget Q_OBJECT public: - explicit Form_BurnMode(class MainWindow *mainwnd, const QString &profileName, const QString &accountName, QWidget *parent = nullptr); + explicit Form_BurnMode(class MainWindow *mainwnd, QWidget *parent = nullptr); ~Form_BurnMode(); void addDevice(DeviceManager *devManager); @@ -86,7 +86,7 @@ private slots: void on_testResult(bool setStatus); private slots: - //void on_cbox_selectAll_stateChanged(int arg1); + void on_cbox_selectAll_stateChanged(int arg1); void on_pbtn_enterBurnMode_clicked(); @@ -94,21 +94,9 @@ private slots: //void on_pbtn_close_clicked(); - void on_pbtn_confirmFinishBurn_clicked(); - - void on_pbtn_checkConfig_clicked(); - - void on_pbtn_complete_clicked(); - - void on_pbtn_abnormal_clicked(); - private: void initTableWidget(); void updatetablewidget(); - void updateTargetCfg(); - void updateCurDeviceCfg(); - QString getLogPath(); - void writeTestLog(QString logContent); private: Ui::Form_BurnMode *ui; @@ -116,8 +104,6 @@ private: hgscanner *m_hg; int m_curIndex; - QString m_profileName; - QString m_accountName; }; #endif // FORM_BURNMODE_H diff --git a/app/HGProductionTool/form_burnmode.ui b/app/HGProductionTool/form_burnmode.ui index df71c6a..3c0fc65 100644 --- a/app/HGProductionTool/form_burnmode.ui +++ b/app/HGProductionTool/form_burnmode.ui @@ -6,20 +6,20 @@ 0 0 - 735 - 718 + 720 + 436 Form - + 16777215 - 180 + 9999999 @@ -27,285 +27,36 @@ - - - - - - Qt::Vertical + + + SelectAll - - - - - - - - Qt::Vertical - - - - 20 - 33 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 190 - 40 - - - - - 190 - 40 - - - - Qt::LeftToRight - - - Entering burning mode - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - + + - 20 - 13 + 190 + 40 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 190 - 40 - - - - - 190 - 40 - - - - Confirm completion of burning - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - + - 20 - 13 + 190 + 40 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 190 - 40 - - - - - 190 - 40 - - - - Qt::LeftToRight - - - Check configuration - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical + + Qt::LeftToRight - - - 20 - 13 - + + Entering burning mode - + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 190 - 40 - - - - - 190 - 40 - - - - Qt::LeftToRight - - - Complete - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - + Qt::Horizontal @@ -317,25 +68,6 @@ - - - - - 141 - 41 - - - - - 141 - 41 - - - - Abnormal exit - - - diff --git a/app/HGProductionTool/form_maininterface.cpp b/app/HGProductionTool/form_maininterface.cpp index a5c74eb..2e0b160 100644 --- a/app/HGProductionTool/form_maininterface.cpp +++ b/app/HGProductionTool/form_maininterface.cpp @@ -47,7 +47,6 @@ Form_mainInterface::Form_mainInterface(class MainWindow *mainwnd, Dialog_logIn:: ui->pbtn_rightRotate->setVisible(false); ui->pbtn_prePage->setVisible(false); ui->pbtn_nextPage->setVisible(false); - ui->pbtn_stop->setVisible(false); QFont ft; ft.setPointSize(15); @@ -567,8 +566,8 @@ QString Form_mainInterface::getSpeedMode() const wchar_t G100[6] = { 70,80,90,110 }; const wchar_t G200[6] = { 100,110,120,130 }; - const wchar_t G300[6] = { 40,50,60,70 }; - const wchar_t G400[6] = { 40,50,60,70,80 }; + const wchar_t G300[6] = { 40,50,60,70,80,90 }; + const wchar_t G400[6] = { 40,50,60,70,80,90 }; int speed = 0; diff --git a/app/HGProductionTool/mainwindow.cpp b/app/HGProductionTool/mainwindow.cpp index 4afc30f..e29b8d8 100644 --- a/app/HGProductionTool/mainwindow.cpp +++ b/app/HGProductionTool/mainwindow.cpp @@ -55,11 +55,9 @@ MainWindow::MainWindow(Dialog_logIn::LogInType loginType, const QString &profile if (m_loginType == Dialog_logIn::LogInType_Burn) { setWindowTitle(tr("production tool-burn station")); - setWindowFlags(Qt::SubWindow | Qt::Popup); - // ui->act_newDevice->setVisible(false); - m_formBurnMode = new Form_BurnMode(this, m_profileName, m_accountName, this); + m_formBurnMode = new Form_BurnMode(this, this); QVBoxLayout *vLayout = new QVBoxLayout; vLayout->addWidget(m_formBurnMode); @@ -543,7 +541,7 @@ void MainWindow::on_update_userStatus() void MainWindow::on_act_newDevice_triggered() { - m_inputSnDlg = new Dialog_InputSerialNum(this, "", m_profileName, nullptr, "", ""); + m_inputSnDlg = new Dialog_InputSerialNum(this, m_loginType, "", m_profileName, m_accountName, nullptr, "", ""); if (m_inputSnDlg->exec()) { //HGPdtToolDbDevice pdtToolDbDevice = nullptr; @@ -671,7 +669,8 @@ void MainWindow::on_act_refreshDevice_triggered() sane_open(name[i].c_str(), &devHandle); if (nullptr != devHandle) { - m_inputSnDlg = new Dialog_InputSerialNum(this, name[i].c_str(), m_profileName, devHandle, getDevSn(devHandle), getDevType(devHandle)); + m_inputSnDlg = new Dialog_InputSerialNum(this, m_loginType, name[i].c_str(), m_profileName, m_accountName, devHandle, getDevSn(devHandle), getDevType(devHandle)); + if (m_inputSnDlg->exec()) { //HGPdtToolDbDevice pdtToolDbDevice = nullptr;