From 913f61636b320fae02b2b0893e5a40caa9d95854 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Thu, 21 Sep 2023 09:26:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0json=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E5=86=85=E5=AD=98=E5=92=8C=E7=A1=AC=E7=9B=98?= =?UTF-8?q?=E5=AE=B9=E9=87=8F=E5=A4=A7=E5=B0=8F=EF=BC=8C=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=AE=BE=E5=A4=87=E7=B1=BB=E5=9E=8B=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E5=88=9B=E5=BB=BA=E6=97=A5=E5=BF=97=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/HGProductionTool/ProductionTool_zh_CN.qm | Bin 17350 -> 17520 bytes app/HGProductionTool/ProductionTool_zh_CN.ts | 182 ++++++++++-------- app/HGProductionTool/analysisjson.cpp | 4 +- app/HGProductionTool/analysisjson.h | 2 + .../dialog_inputserialnum.cpp | 2 +- app/HGProductionTool/dialog_setlogpath.cpp | 5 +- app/HGProductionTool/form_maininterface.cpp | 16 +- app/HGProductionTool/mainwindow.cpp | 4 +- app/HGProductionTool/mainwindow.h | 1 + 9 files changed, 126 insertions(+), 90 deletions(-) diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index 1526d690b8c919df77607b32f4cbe58b7966232c..bc30cf2e852e074d4917293f7a00308b67568bce 100644 GIT binary patch delta 1332 zcmZ`&drVVz7(KVW?-uUtl-GDUt+hNX6)9456_bMQ;V81q1%sByDzi=_P=R44aXy(7 z_VX1ZMxD`3qJkJRm%3zAmlWmquufST$;;R6AfdLL^p6a!;VaSJ`$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Z@_!i}9_shE)iYV@pTOR8IwwVsd=RBoA-k>~Edy5*^Df-+?KwP=?*DfedHAy>LtlVIg` zu=j-|l{3n|5|UE0e%C}Iq^8oKxm>CMuC1D}AscXiR5Q8xJW)HZSy&)_tyZQJ?OZbR zifa@;ZmgG1H@<>}L^G#mO`=uF(C$BwN2}jrABonrA?@%IIj^47et*nK>b7g=%Q}c( zt9HIJmH02PMbVm2ri+YB0;;RJrG^4>RMO{F({E;sc_m+B%1s0J#^->p&Jb5z0+`1P z2_>YGV~}-9X5((d@smL!JVzKMBb(V5l1)2YPqOIm(1&M&eP&tDzLfR-F8N{#J7LdP zOvO$9y-!&88JOdtRkH5kBjMz#U>ys2A7mr;h>4uB9IdE{J?ZfewSDt{o}$kWRvrE? TaSgkYt?O^ij0yb取消 - - - - + + + + tips 提示 - + Speed mode 速度模式 - + Failed! 失败! - + Succeed! 成功! - + Sleep time 休眠时间 - + Vid and Pid Vid和Pid @@ -171,32 +171,32 @@ 检测到配置%1不一致,已重新配置,请再次检查 - + Consistent configuration 配置一致! - + device is lost 设备已丢失 - + Serial num is empty 序列号为空 - + sn is illegal 序列号不合法 - + The device is testing 该设备正在进行测试 - + set sn failed 设置序列号失败 @@ -206,80 +206,80 @@ 设备名: %1 - + Target Configration: Target Configration: 目标配置: - - - - + + + + Speep mode: %1PPM Speep mode: %1PPM 速度模式: %1PPM - + Pass Pass - - - + + + Set 设置 - - - - + + + + Sleep time: %1minute Sleep time: %1minute 休眠时间: %1分钟 - - - - + + + + Vid: %1 Pid: %2 Vid: %1 Pid: %2 Vid: %1 Pid: %2 - + Current Configration of device: 当前设备配置: - + Fail Fail - - - + + + Set serial number: %1 设置序列号: %1 - - + + Detected that the current device's vid-pid and device object are not consistent. 检测到当前设备的vid-pid和设备对象不一致. - - + + Please reboot device to update. 请重启设备刷新. @@ -300,23 +300,23 @@ 测试结果:成功! - - + + Inconsistent configuration %1detected, please reconfigure, and check again 检测到配置 %1不一致,请重新配置后再次检查 - + Inconsistent configuration %1detected, please reboot and reconfigure, and check again 检测到配置 %1不一致,请重启后再次检查 - + Set configuration to device 将目标配置设置到设备 - + Test content: 测试内容: @@ -325,21 +325,21 @@ 成功,请检查配置 - - - - + + + + Sleep time: Not sleeping 休眠时间: 不休眠 - - + + Tester: %1, Test item: %2 测试员: %1, 测试项: %2 - + set sn succeed 设置序列号成功 @@ -1371,7 +1371,7 @@ - + Not sleeping 不休眠 @@ -1398,65 +1398,63 @@ 设备序列号: %1, 测试项: %2, 测试结果: 通过! - - + + device history scan count: 设备历史扫描张数: - - + + Prompt 提示 - + please verify the size of the device's cpu and disk: 请验证设备内存和硬盘容量大小: - Cpu size:%1 - 内存大小:%1 + 内存大小:%1 - Disk size:%1 - 硬盘总容量大小:%1 + 硬盘总容量大小:%1 - + 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 其他错误 @@ -1465,39 +1463,39 @@ 设备序列号:%1 - + ID 序号 - + Test items 测试项 - + status 测试状态 - + not test 未测试 - - + + not pass 不通过 - + not support 不支持 - - + + pass 通过 @@ -1523,14 +1521,14 @@ Pid: - - + + device roller count: 设备滚轴张数: - + image pixel: 标准圆:宽 * 高: @@ -1555,7 +1553,27 @@ - + + Target cpu size:%1 + 目标内存大小:%1 + + + + Target disk size:%1 + 目标硬盘容量:%1 + + + + Actual pu size:%1 + 实际内存大小:%1 + + + + Actual disk size:%1 + 实际硬盘容量:%1 + + + minute 分钟 diff --git a/app/HGProductionTool/analysisjson.cpp b/app/HGProductionTool/analysisjson.cpp index 3af8bb7..a4b5e39 100644 --- a/app/HGProductionTool/analysisjson.cpp +++ b/app/HGProductionTool/analysisjson.cpp @@ -56,7 +56,9 @@ AnalysisJson::json_global AnalysisJson::GetGlobal() obj["pid-to"].toInt(), obj["speed-mode"].toInt(), obj["sleep-time"].toInt(), - obj["device-model"].toString()}; + obj["device-model"].toString(), + obj["cpu-size"].toString(), + obj["disk-size"].toString()}; } diff --git a/app/HGProductionTool/analysisjson.h b/app/HGProductionTool/analysisjson.h index 3ea46b1..ac0abe9 100644 --- a/app/HGProductionTool/analysisjson.h +++ b/app/HGProductionTool/analysisjson.h @@ -26,6 +26,8 @@ public: std::int32_t speed_mode; std::int32_t sleep_time; QString device_model; + QString cpu_size; + QString disk_size; }; AnalysisJson() = delete ; diff --git a/app/HGProductionTool/dialog_inputserialnum.cpp b/app/HGProductionTool/dialog_inputserialnum.cpp index fb5819b..c0d4a97 100644 --- a/app/HGProductionTool/dialog_inputserialnum.cpp +++ b/app/HGProductionTool/dialog_inputserialnum.cpp @@ -302,7 +302,7 @@ QString Dialog_InputSerialNum::getLogPath() strcat(logPath, m_devType.toStdString().c_str()); strcat(logPath, "/"); - return getCfgValue("save", "logPath", getStdFileName(StdStringToUtf8(logPath).c_str())); + return getCfgValue(m_devType.toStdString().c_str(), "logPath", getStdFileName(StdStringToUtf8(logPath).c_str())); } void Dialog_InputSerialNum::writeTestLog(QString logContent) diff --git a/app/HGProductionTool/dialog_setlogpath.cpp b/app/HGProductionTool/dialog_setlogpath.cpp index 77b7cf1..90b0025 100644 --- a/app/HGProductionTool/dialog_setlogpath.cpp +++ b/app/HGProductionTool/dialog_setlogpath.cpp @@ -18,6 +18,9 @@ Dialog_SetLogPath::Dialog_SetLogPath(const QString &devType, QWidget *parent) : QFont ft; ft.setPointSize(15); this->setFont(ft); + + ui->lineEdit->setReadOnly(true); + ui->lineEdit->setText(getCfgValue(m_devType.toStdString().c_str(), "logPath", QString(""))); } Dialog_SetLogPath::~Dialog_SetLogPath() @@ -40,7 +43,7 @@ void Dialog_SetLogPath::on_pushButton_ok_clicked() return; } - saveCfgValue("save", "logPath", getStdFileName(filePath)); + saveCfgValue(m_devType.toStdString().c_str(), "logPath", getStdFileName(filePath)); close(); } diff --git a/app/HGProductionTool/form_maininterface.cpp b/app/HGProductionTool/form_maininterface.cpp index a7894ce..57ef998 100644 --- a/app/HGProductionTool/form_maininterface.cpp +++ b/app/HGProductionTool/form_maininterface.cpp @@ -279,9 +279,17 @@ void Form_mainInterface::on_testGetDevCfgInfo(int vid, int pid, int sleepTime, i void Form_mainInterface::on_testGetDevCpuDisk(QString cpu, QString disk) { - QString str = (tr("please verify the size of the device's cpu and disk:") + "\n\t"); - str.append(tr("Cpu size:%1\n\t").arg(cpu)); - str.append(tr("Disk size:%1\n\t").arg(disk)); + AnalysisJson analysisJson(m_profileName); + AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal(); + QString cpu_size = jsonGlobal.cpu_size; + QString disk_size = jsonGlobal.disk_size; + + QString str = (tr("please verify the size of the device's cpu and disk:") + "\n\n\t"); + str.append(tr("Target cpu size:%1").arg(cpu_size) + "\n\t"); + str.append(tr("Target disk size:%1").arg(disk_size) + "\n\n\t"); + + str.append(tr("Actual pu size:%1").arg(cpu) + "\n\t"); + str.append(tr("Actual disk size:%1").arg(disk) + "\n\t"); m_textTips->setViewContent(str); } @@ -691,7 +699,7 @@ QString Form_mainInterface::getLogPath() strcat(logPath, m_devType.toStdString().c_str()); strcat(logPath, "/"); - return getCfgValue("save", "logPath", getStdFileName(StdStringToUtf8(logPath).c_str())); + return getCfgValue(m_devType.toStdString().c_str(), "logPath", getStdFileName(StdStringToUtf8(logPath).c_str())); } void Form_mainInterface::writeTestLog(QString logContent) diff --git a/app/HGProductionTool/mainwindow.cpp b/app/HGProductionTool/mainwindow.cpp index 33654ff..700c67c 100644 --- a/app/HGProductionTool/mainwindow.cpp +++ b/app/HGProductionTool/mainwindow.cpp @@ -27,6 +27,7 @@ MainWindow::MainWindow(Dialog_logIn::LogInType loginType, const QString &profile , m_bot_splitter(nullptr) , m_isLogOut(false) , m_inputSnDlg(nullptr) + , m_tmpDevType("") { ui->setupUi(this); @@ -679,6 +680,7 @@ void MainWindow::on_act_refreshDevice_triggered() QMessageBox::information(this, tr("tips"), tr("cannot create more table")); delete mainInterface; } + m_tmpDevType = getDevType(devHandle); } else { @@ -702,7 +704,7 @@ void MainWindow::on_act_openLog_triggered() QString defaultFileName = logPath + m_accountName + ".log"; - QString fileName = getCfgValue("save", "logPath", defaultFileName); + QString fileName = getCfgValue(m_tmpDevType.toStdString().c_str(), "logPath", defaultFileName); QFileInfo fileInfo(getStdFileName(fileName)); auto pathDir = fileInfo.path(); QString strFilePath = "file:///" + pathDir; diff --git a/app/HGProductionTool/mainwindow.h b/app/HGProductionTool/mainwindow.h index e0b02d3..9fc0294 100644 --- a/app/HGProductionTool/mainwindow.h +++ b/app/HGProductionTool/mainwindow.h @@ -95,5 +95,6 @@ private: public: QString m_ftpHost; unsigned short m_ftpPort; + QString m_tmpDevType; }; #endif // MAINWINDOW_H