diff --git a/app/HGProductionTool/HGProductionTool.pro b/app/HGProductionTool/HGProductionTool.pro index 6719b36..72547e9 100644 --- a/app/HGProductionTool/HGProductionTool.pro +++ b/app/HGProductionTool/HGProductionTool.pro @@ -87,6 +87,7 @@ SOURCES += \ dialog_login.cpp \ dialog_rootfuntion.cpp \ dialog_setburnsn.cpp \ + dialog_setlogpath.cpp \ dialog_uploadcfgfile.cpp \ dialog_userinput.cpp \ dialog_registeraccount.cpp \ @@ -112,6 +113,7 @@ HEADERS += \ dialog_login.h \ dialog_rootfuntion.h \ dialog_setburnsn.h \ + dialog_setlogpath.h \ dialog_uploadcfgfile.h \ dialog_userinput.h \ dialog_registeraccount.h \ @@ -131,6 +133,7 @@ FORMS += \ dialog_login.ui \ dialog_rootfuntion.ui \ dialog_setburnsn.ui \ + dialog_setlogpath.ui \ dialog_uploadcfgfile.ui \ dialog_userinput.ui \ dialog_registeraccount.ui \ diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm index 97224c6..20cc42d 100644 Binary files a/app/HGProductionTool/ProductionTool_zh_CN.qm and b/app/HGProductionTool/ProductionTool_zh_CN.qm differ diff --git a/app/HGProductionTool/ProductionTool_zh_CN.ts b/app/HGProductionTool/ProductionTool_zh_CN.ts index c51807d..7f0c1d4 100644 --- a/app/HGProductionTool/ProductionTool_zh_CN.ts +++ b/app/HGProductionTool/ProductionTool_zh_CN.ts @@ -77,17 +77,17 @@ 设备类型: - + Scanner: 设备名: - + serialNum: 序列号: - + Set Sn 设置序列号 @@ -107,10 +107,15 @@ 进入测试 - + Reboot 重启 + + + Select Log Path + 选择日志路径 + OK 确定 @@ -120,35 +125,35 @@ 取消 - - - - + + + + tips 提示 - + Speed mode 速度模式 - + Failed! 失败! - + Succeed! 成功! - + Sleep time 休眠时间 - + Vid and Pid Vid和Pid @@ -161,93 +166,93 @@ 检测到配置%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 - - - + + + Set 设置 - - - - + + + + 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 @@ -260,23 +265,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: 测试内容: @@ -285,21 +290,21 @@ 成功,请检查配置 - - - - + + + + Sleep time: Not sleeping 休眠时间: 不休眠 - - + + Tester: %1, Test item: %2 测试员: %1, 测试项: %2 - + set sn succeed 设置序列号成功 @@ -389,6 +394,55 @@ 序列号为空 + + Dialog_SetLogPath + + + Dialog + 选择日志保存路径 + + + + Log path: + 日志路径: + + + + Ok + 确定 + + + + Cancel + 取消 + + + + Select path + 选择路径 + + + + + tips + 提示 + + + + Directory can not be empty + 文件不能为空 + + + + Create logPath failed + 创建文件失败 + + + + Browse directory + 打开文件 + + Dialog_UserInput @@ -682,35 +736,35 @@ 登录 - - - - + + + + Prompt 提示 - + Account dose not exist 账户不存在 - + Password can not be empty 密码不能为空 - + Password error 密码错误 - + Please select a profile first 请先选择配置文件 - + Select profile 选择配置文件 @@ -1184,12 +1238,12 @@ 设备未连接 - + Device type: 设备类型: - + SerialNum: 序列号: @@ -1206,7 +1260,7 @@ 休眠时间: - + load last image which uploaded last time 加载上一次上传的图片 @@ -1215,14 +1269,14 @@ 设备已断开 - + tips 提示 - - - + + + destortion value: 畸变修正值: @@ -1235,68 +1289,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 @@ -1311,46 +1365,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 其他错误 @@ -1359,39 +1413,39 @@ 设备序列号:%1 - + ID 序号 - + Test items 测试项 - + status 测试状态 - + not test 未测试 - - + + not pass 不通过 - + not support 不支持 - - + + pass 通过 @@ -1417,31 +1471,31 @@ Pid: - - + + device roller count: 设备滚轴张数: - - + + image pixel: 标准圆:宽 * 高: - + FirmwareNum: 固件号: - + device serial number:%1 设备序列号:%1 - + device firmware number:%1 device firmware number:%1 @@ -1449,17 +1503,17 @@ - + minute 分钟 - + VID: VID: - + PID: PID: @@ -1519,25 +1573,40 @@ 登出 - + + Ctrl+Q + + + + act_close 退出 - + act_upload 上传配置文件 - + act_refreshDevice 刷新设备列表 - + act_openLog 查看日志 + + + Ctrl+L + + + + + act_setLogPath + + Account login elsewhere 账户在其他地方登录 diff --git a/app/HGProductionTool/dialog_inputserialnum.cpp b/app/HGProductionTool/dialog_inputserialnum.cpp index 942fcae..91cbee8 100644 --- a/app/HGProductionTool/dialog_inputserialnum.cpp +++ b/app/HGProductionTool/dialog_inputserialnum.cpp @@ -1,7 +1,10 @@ #include "dialog_inputserialnum.h" #include "ui_dialog_inputserialnum.h" #include "base/HGBase.h" +#include "HGString.h" #include "HGUIGlobal.h" +#include "app_cfg.h" +#include "dialog_setlogpath.h" 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) : @@ -34,6 +37,12 @@ Dialog_InputSerialNum::Dialog_InputSerialNum(class MainWindow *mainWnd, Dialog_l ui->pbtn_setConfig->setEnabled(false); } + ui->pbtn_slectLogPath->setVisible(false); + if (m_accountName == "admin") + { + ui->pbtn_slectLogPath->setVisible(true); + } + ui->pbtn_enterTest->setEnabled(false); ui->label_scanner->setText(tr("Device name: %1").arg(m_devName)); @@ -275,14 +284,16 @@ void Dialog_InputSerialNum::updateCurDeviceCfg() QString Dialog_InputSerialNum::getLogPath() { - HGChar cachePath[512]; - HGBase_GetDocumentsPath(cachePath, 512); + HGChar logPath[512]; + HGBase_GetDocumentsPath(logPath, 512); HGChar procName[512]; HGBase_GetProcessName(procName, 512); - strcat(cachePath, procName); - strcat(cachePath, "/Test_Log/"); + strcat(logPath, procName); + strcat(logPath, "/Test_Log/"); + strcat(logPath, m_devType.toStdString().c_str()); + strcat(logPath, "/"); - return getStdFileName(cachePath); + return getCfgValue("save", "logPath", getStdFileName(StdStringToUtf8(logPath).c_str())); } void Dialog_InputSerialNum::writeTestLog(QString logContent) @@ -483,3 +494,9 @@ void Dialog_InputSerialNum::on_pbtn_reboot_clicked() { rebootDevice(); } + +void Dialog_InputSerialNum::on_pbtn_slectLogPath_clicked() +{ + Dialog_SetLogPath dlg(m_devType, this); + dlg.exec(); +} diff --git a/app/HGProductionTool/dialog_inputserialnum.h b/app/HGProductionTool/dialog_inputserialnum.h index 8558a8b..3d5cba4 100644 --- a/app/HGProductionTool/dialog_inputserialnum.h +++ b/app/HGProductionTool/dialog_inputserialnum.h @@ -70,6 +70,8 @@ private slots: void on_pbtn_reboot_clicked(); + void on_pbtn_slectLogPath_clicked(); + private: Ui::Dialog_InputSerialNum *ui; diff --git a/app/HGProductionTool/dialog_inputserialnum.ui b/app/HGProductionTool/dialog_inputserialnum.ui index fec0793..e11c015 100644 --- a/app/HGProductionTool/dialog_inputserialnum.ui +++ b/app/HGProductionTool/dialog_inputserialnum.ui @@ -212,6 +212,25 @@ Set Sn + + + + 560 + 50 + 181 + 31 + + + + + 131 + 31 + + + + Select Log Path + + diff --git a/app/HGProductionTool/dialog_login.cpp b/app/HGProductionTool/dialog_login.cpp index 9158d90..88a719f 100644 --- a/app/HGProductionTool/dialog_login.cpp +++ b/app/HGProductionTool/dialog_login.cpp @@ -27,6 +27,7 @@ Dialog_logIn::Dialog_logIn(QWidget *parent) : ft2.setPointSize(8); ui->lineEdit_password->setFont(ft2); + ui->pbtn_login->setDefault(true); ui->pbtn_setting->setVisible(false); ui->radioButton_pressureTest->setVisible(false); diff --git a/app/HGProductionTool/form_maininterface.cpp b/app/HGProductionTool/form_maininterface.cpp index 2e0b160..a25aae0 100644 --- a/app/HGProductionTool/form_maininterface.cpp +++ b/app/HGProductionTool/form_maininterface.cpp @@ -10,6 +10,7 @@ #include "HGString.h" #include "form_texttips.h" #include "test_base.h" +#include "app_cfg.h" #include "hgscanner.h" #include "mainwindow.h" #include "dialog_excepdesc.h" @@ -672,14 +673,16 @@ void Form_mainInterface::getLogInfo(int ret) QString Form_mainInterface::getLogPath() { - HGChar cachePath[512]; - HGBase_GetDocumentsPath(cachePath, 512); + HGChar logPath[512]; + HGBase_GetDocumentsPath(logPath, 512); HGChar procName[512]; HGBase_GetProcessName(procName, 512); - strcat(cachePath, procName); - strcat(cachePath, "/Test_Log/"); + strcat(logPath, procName); + strcat(logPath, "/Test_Log/"); + strcat(logPath, m_devType.toStdString().c_str()); + strcat(logPath, "/"); - return getStdFileName(cachePath); + return getCfgValue("save", "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 0f5ac04..33654ff 100644 --- a/app/HGProductionTool/mainwindow.cpp +++ b/app/HGProductionTool/mainwindow.cpp @@ -4,6 +4,7 @@ #include #include "base/HGBase.h" #include "HGUIGlobal.h" +#include "app_cfg.h" #include "dialog_login.h" #include "dialog_changepwd.h" #include "dialog_accountmanage.h" @@ -34,10 +35,10 @@ MainWindow::MainWindow(Dialog_logIn::LogInType loginType, const QString &profile ui->act_manage->setVisible(false); ui->act_export->setVisible(false); ui->act_upload->setVisible(false); -// ui->act_openLog->setVisible(false); + ui->act_openLog->setVisible(false); -// if (m_accountName == "admin") -// ui->act_openLog->setVisible(true); + if (m_accountName == "admin") + ui->act_openLog->setVisible(true); ui->act_refreshDevice->setShortcut(QKeySequence("F5")); @@ -699,7 +700,9 @@ void MainWindow::on_act_openLog_triggered() strcat(logPath, procName); strcat(logPath, "/Test_Log/"); - QString fileName = logPath + m_accountName + ".log"; + QString defaultFileName = logPath + m_accountName + ".log"; + + QString fileName = getCfgValue("save", "logPath", defaultFileName); QFileInfo fileInfo(getStdFileName(fileName)); auto pathDir = fileInfo.path(); QString strFilePath = "file:///" + pathDir; diff --git a/app/HGProductionTool/mainwindow.ui b/app/HGProductionTool/mainwindow.ui index 4f399e2..5bd2765 100644 --- a/app/HGProductionTool/mainwindow.ui +++ b/app/HGProductionTool/mainwindow.ui @@ -101,6 +101,11 @@ Ctrl+L + + + act_setLogPath + +