diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm
index 67e7dfb..97224c6 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 ed39d4f..c51807d 100644
--- a/app/HGProductionTool/ProductionTool_zh_CN.ts
+++ b/app/HGProductionTool/ProductionTool_zh_CN.ts
@@ -77,35 +77,40 @@
设备类型:
-
+
设备名:
-
+
序列号:
-
+
设置序列号
-
+
目标配置写入到设备
-
+
检查配置是否一致
-
+
进入测试
+
+
+
+ 重启
+
确定
@@ -115,165 +120,186 @@
取消
-
-
-
-
-
-
+
+
+
+
提示
-
+
速度模式
-
+
+
+ 失败!
+
+
+
+
+ 成功!
+
+
+
休眠时间
-
+
Vid和Pid
-
-
-
- 提示
+ 提示
检测到配置%1不一致,已重新配置,请再次检查
-
+
配置一致!
-
+
设备已丢失
-
+
序列号为空
-
+
序列号不合法
-
+
该设备正在进行测试
-
+
设置序列号失败
-
+
设备名: %1
-
+
Target Configration:
目标配置:
-
-
-
+
+
+
+
Speep mode: %1PPM
速度模式: %1PPM
-
-
-
+
+
+
+
+ 设置
+
+
+
+
+
+
Sleep time: %1minute
休眠时间: %1分钟
-
-
-
+
+
+
+
Vid: %1 Pid: %2
Vid: %1 Pid: %2
-
+
当前设备配置:
-
+
+
+
设置序列号: %1
-
- 测试结果:失败!
+ 测试结果:失败!
-
- 测试结果:成功!
+ 测试结果:成功!
-
+
+
检测到配置 %1不一致,请重新配置后再次检查
-
+
+
+ 检测到配置 %1不一致,请重启后再次检查
+
+
+
将目标配置设置到设备
-
+
测试内容:
-
- 成功,请检查配置
+ 成功,请检查配置
-
-
-
+
+
+
+
休眠时间: 不休眠
-
-
+
+
测试员: %1, 测试项: %2
-
+
设置序列号成功
@@ -559,57 +585,62 @@
记住密码
-
+
+
+ 显示密码
+
+
+
数据库地址:
-
+
数据库端口:
-
+
FTP地址:
-
+
FTP端口:
-
+
烧录工位
-
+
初检工位
-
+
图像测试工位
-
+
压力测试工位
-
+
注册
-
+
选择配置文件
-
+
选择配置文件
@@ -622,7 +653,7 @@
端口号:
-
+
登录
@@ -631,55 +662,55 @@
退出
-
+
设置IP与端口
-
+
最小化
-
+
关闭
-
+
登录
-
-
-
+
+
+
提示
-
+
账户不存在
-
+
密码不能为空
-
+
密码错误
-
+
请先选择配置文件
-
+
选择配置文件
@@ -1525,10 +1556,10 @@
-
-
-
-
+
+
+
+
提示
@@ -1554,8 +1585,8 @@
-
-
+
+
测试中,请勿关闭!
@@ -1577,8 +1608,8 @@
取消
-
-
+
+
不能创建更多项目
diff --git a/app/HGProductionTool/dialog_inputserialnum.cpp b/app/HGProductionTool/dialog_inputserialnum.cpp
index 1f1e6bb..942fcae 100644
--- a/app/HGProductionTool/dialog_inputserialnum.cpp
+++ b/app/HGProductionTool/dialog_inputserialnum.cpp
@@ -35,8 +35,6 @@ Dialog_InputSerialNum::Dialog_InputSerialNum(class MainWindow *mainWnd, Dialog_l
}
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));
@@ -105,6 +103,9 @@ void Dialog_InputSerialNum::setSpeedMode()
func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
delete lp;
+
+ QString info = tr("Set") + tr("Speep mode: %1PPM").arg(QString::number(speedMode));
+ addInteractInfo(info, true);
}
void Dialog_InputSerialNum::setSleepTime()
@@ -119,6 +120,9 @@ void Dialog_InputSerialNum::setSleepTime()
func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
delete lp;
+
+ QString info = tr("Set") + (sleepTime > 0 ? tr("Sleep time: %1minute").arg(QString::number(sleepTime)) : tr("Sleep time: Not sleeping"));
+ addInteractInfo(info, true);
}
void Dialog_InputSerialNum::setVidPid()
@@ -136,6 +140,13 @@ void Dialog_InputSerialNum::setVidPid()
func_test_go(WRITE_CFG_NAME, (const wchar_t*)lp, m_hg);
delete lp;
+
+ char buf[10];
+ sprintf(buf, "%x", jsonGlobal.vid_to);
+ char buf2[10];
+ sprintf(buf2, "%x", jsonGlobal.pid_to);
+ QString info = tr("Set") + tr("Vid: %1 Pid: %2").arg(QString::fromStdString(buf)).arg(QString::fromStdString(buf2));
+ addInteractInfo(info, true);
}
void Dialog_InputSerialNum::rebootDevice()
@@ -210,7 +221,7 @@ int Dialog_InputSerialNum::getDevPid()
void Dialog_InputSerialNum::updateTargetCfg()
{
- ui->textEdit_target->clear();
+ ui->textBrowser_target->clear();
AnalysisJson analysisJson(m_profileName);
AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal();
@@ -227,17 +238,17 @@ void Dialog_InputSerialNum::updateTargetCfg()
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");
+ content.append(tr("Target Configration:") + "\n\n");
+ content.append(tr("Speep mode: %1PPM").arg(QString::number(speedMode)) + "\n");
+ content.append((sleepTime > 0 ? tr("Sleep time: %1minute").arg(QString::number(sleepTime)) : tr("Sleep time: Not sleeping")) + "\n");
+ content.append(tr("Vid: %1 Pid: %2").arg(QString::fromStdString(buf)).arg(QString::fromStdString(buf2)) + "\n");
- ui->textEdit_target->setText(content);
+ ui->textBrowser_target->setText(content);
}
void Dialog_InputSerialNum::updateCurDeviceCfg()
{
- ui->textEdit_curConfig->clear();
+ ui->textBrowser_curConfig->clear();
if (m_handle == nullptr)
return;
@@ -254,12 +265,12 @@ void Dialog_InputSerialNum::updateCurDeviceCfg()
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");
+ content.append(tr("Current Configration of device:") + "\n\n");
+ content.append(tr("Speep mode: %1PPM").arg(QString::number(speedMode)) + "\n");
+ content.append(sleepTime > 0 ? tr("Sleep time: %1minute").arg(QString::number(sleepTime)) : tr("Sleep time: Not sleeping") + "\n");
+ content.append(tr("Vid: %1 Pid: %2").arg(QString::fromStdString(buf)).arg(QString::fromStdString(buf2)) + "\n");
- ui->textEdit_curConfig->setText(content);
+ ui->textBrowser_curConfig->setText(content);
}
QString Dialog_InputSerialNum::getLogPath()
@@ -296,6 +307,25 @@ void Dialog_InputSerialNum::writeTestLog(QString logContent)
file.close();
}
+void Dialog_InputSerialNum::addInteractInfo(QString info, bool isNormal)
+{
+ QDateTime dateTime= QDateTime::currentDateTime();
+ QString curTime = dateTime .toString("yyyy-MM-dd hh:mm:ss");
+ QString content = "[" + curTime + "] ";
+ content.append(info + "\n");
+
+ if (isNormal)
+ ui->textBrowser_info->insertPlainText(content);
+ else
+ {
+ ui->textBrowser_info->setTextColor(Qt::red);
+ ui->textBrowser_info->insertPlainText(content);
+ }
+
+ ui->textBrowser_info->moveCursor(QTextCursor::End);
+ ui->textBrowser_info->setTextColor(Qt::black);
+}
+
void Dialog_InputSerialNum::on_testResult()
{
//m_mainWnd->releaseTesting();
@@ -309,13 +339,17 @@ void Dialog_InputSerialNum::on_pbtn_setSn_clicked()
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!"));
+ //QMessageBox::information(this, tr("tips"), tr("set sn failed"));
+ QString info = QString(tr("Set serial number: %1 ").arg(sn)) + tr("Failed!");
+ writeTestLog(testLog + tr("set sn failed"));
+ addInteractInfo(info, false);
}
else
{
- QMessageBox::information(this, tr("tips"), tr("set sn succeed"));
- writeTestLog(testLog + tr("Test result: Succeed!"));
+ //QMessageBox::information(this, tr("tips"), tr("set sn succeed"));
+ QString info = QString(tr("Set serial number: %1 ").arg(sn)) + tr("Succeed!");
+ writeTestLog(testLog + tr("set sn succeed"));
+ addInteractInfo(info, true);
}
}
@@ -342,6 +376,9 @@ void Dialog_InputSerialNum::on_pbtn_checkConfig_clicked()
item.append(tr("Speed mode"));
item.append(" ");
right = false;
+
+ QString info = tr("Inconsistent configuration %1detected, please reconfigure, and check again").arg(item);
+ addInteractInfo(info, false);
}
if (sleepTime_to != sleepTime)
@@ -349,6 +386,8 @@ void Dialog_InputSerialNum::on_pbtn_checkConfig_clicked()
item.append(tr("Sleep time"));
item.append(" ");
right = false;
+ QString info = tr("Inconsistent configuration %1detected, please reconfigure, and check again").arg(item);
+ addInteractInfo(info, false);
}
if (vid != vid_to || pid != pid_to)
@@ -356,17 +395,15 @@ void Dialog_InputSerialNum::on_pbtn_checkConfig_clicked()
item.append(tr("Vid and Pid"));
item.append(" ");
right = false;
+ QString info = tr("Inconsistent configuration %1detected, please reboot and reconfigure, and check again").arg(item);
+ addInteractInfo(info, false);
}
- if (!right)
+ ui->pbtn_enterTest->setEnabled(right);
+ if (right)
{
- QMessageBox::information(this, tr("Prompt"), tr("Inconsistent configuration %1detected, please reconfigure, and check again").arg(item));
- ui->pbtn_enterTest->setEnabled(false);
- }
- else
- {
- QMessageBox::information(this, tr("Prompt"), tr("Consistent configuration"));
- ui->pbtn_enterTest->setEnabled(true);
+ QString info = tr("Consistent configuration");
+ addInteractInfo(info, true);
}
delete lp;
@@ -439,5 +476,10 @@ void Dialog_InputSerialNum::on_pbtn_setConfig_clicked()
updateTargetCfg();
updateCurDeviceCfg();
- QMessageBox::information(this, tr("Prompt"), (tr("Success, please check the configuration")));
+ //QMessageBox::information(this, tr("Prompt"), (tr("Success, please check the configuration")));
+}
+
+void Dialog_InputSerialNum::on_pbtn_reboot_clicked()
+{
+ rebootDevice();
}
diff --git a/app/HGProductionTool/dialog_inputserialnum.h b/app/HGProductionTool/dialog_inputserialnum.h
index e4b0040..8558a8b 100644
--- a/app/HGProductionTool/dialog_inputserialnum.h
+++ b/app/HGProductionTool/dialog_inputserialnum.h
@@ -39,6 +39,7 @@ private:
void updateCurDeviceCfg();
QString getLogPath();
void writeTestLog(QString logContent);
+ void addInteractInfo(QString info, bool isNormal);
signals:
void testResult();
@@ -67,6 +68,8 @@ private slots:
void on_pbtn_setConfig_clicked();
+ void on_pbtn_reboot_clicked();
+
private:
Ui::Dialog_InputSerialNum *ui;
diff --git a/app/HGProductionTool/dialog_inputserialnum.ui b/app/HGProductionTool/dialog_inputserialnum.ui
index b683407..fec0793 100644
--- a/app/HGProductionTool/dialog_inputserialnum.ui
+++ b/app/HGProductionTool/dialog_inputserialnum.ui
@@ -6,250 +6,212 @@
0
0
- 614
- 384
+ 795
+ 608
Dialog
-
- -
-
-
-
-
-
- Scanner:
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- -
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 25
-
-
-
-
- -
-
-
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
-
- 71
- 21
-
-
-
- serialNum:
-
-
-
- -
-
-
-
- 241
- 31
-
-
-
-
- -
-
-
-
- 131
- 31
-
-
-
- Set Sn
-
-
-
- -
-
-
-
- 43
- 23
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
- -
-
-
- 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
-
-
-
-
-
-
-
+
+
+
+ 570
+ 150
+ 190
+ 30
+
+
+
+
+ 190
+ 30
+
+
+
+
+ 190
+ 30
+
+
+
+ Qt::LeftToRight
+
+
+ Set configuration
+
+
+
+
+
+ 570
+ 230
+ 190
+ 30
+
+
+
+
+ 190
+ 30
+
+
+
+
+ 190
+ 30
+
+
+
+ Qt::LeftToRight
+
+
+ Check configuration
+
+
+
+
+
+ 570
+ 310
+ 190
+ 30
+
+
+
+
+ 190
+ 30
+
+
+
+
+ 190
+ 30
+
+
+
+ Qt::LeftToRight
+
+
+ Enter Test
+
+
+
+
+
+ 10
+ 320
+ 521
+ 231
+
+
+
+
+
+
+ 10
+ 110
+ 521
+ 191
+
+
+
+ -
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ -
+
+
+
+
+
+
+
+ 20
+ 10
+ 531
+ 21
+
+
+
+ Scanner:
+
+
+
+
+
+ 610
+ 400
+ 101
+ 41
+
+
+
+ Reboot
+
+
+
+
+
+ 110
+ 50
+ 261
+ 31
+
+
+
+
+ 241
+ 31
+
+
+
+
+
+
+ 20
+ 50
+ 71
+ 31
+
+
+
+
+ 71
+ 21
+
+
+
+ serialNum:
+
+
+
+
+
+ 390
+ 50
+ 141
+ 31
+
+
+
+
+ 131
+ 31
+
+
+
+ Set Sn
+
+
diff --git a/app/HGProductionTool/dialog_login.cpp b/app/HGProductionTool/dialog_login.cpp
index fc45c1e..9158d90 100644
--- a/app/HGProductionTool/dialog_login.cpp
+++ b/app/HGProductionTool/dialog_login.cpp
@@ -23,11 +23,29 @@ Dialog_logIn::Dialog_logIn(QWidget *parent) :
ft.setPointSize(15);
this->setFont(ft);
+ QFont ft2;
+ ft2.setPointSize(8);
+ ui->lineEdit_password->setFont(ft2);
+
ui->pbtn_setting->setVisible(false);
ui->radioButton_pressureTest->setVisible(false);
saveCfgValue("admin", "password", getCfgValue("admin", "password", QString("huagaoadmin")));
+ int type = getCfgValue("login", "station", 0);
+ if (LogInType_Burn == type)
+ {
+ ui->radioButton_burn->setChecked(true);
+ }
+ else if (LogInType_InitTest == type)
+ {
+ ui->radioButton_initTest->setChecked(true);
+ }
+ else if (LogInType_ImageTest == type)
+ {
+ ui->radioButton_imageTest->setChecked(true);
+ }
+
ui->pbtn_setting->setToolTip(tr("Set host and port"));
ui->pbtn_minum->setToolTip(tr("Minimize"));
ui->pbtn_close->setToolTip(tr("Close"));
@@ -38,6 +56,7 @@ Dialog_logIn::Dialog_logIn(QWidget *parent) :
m_profileName = getCfgValue("login", "profile", m_profileName);
ui->lineEdit_account->setText(getCfgValue("login", "account", QString("")));
ui->lineEdit_profilePath->setText(m_profileName);
+ ui->checkBox_showPswd->setChecked(getCfgValue("login", "showPassword", false));
ui->checkBox_rememberPswd->setChecked(getCfgValue("login", "rememberPassword", false));
if (ui->lineEdit_account->text() == "admin")
ui->checkBox_rememberPswd->setChecked(false);
@@ -166,8 +185,6 @@ void Dialog_logIn::on_pbtn_login_clicked()
return;
}
- saveCfgValue("login", "account", account);
-
if (ui->radioButton_burn->isChecked())
m_loginType = LogInType_Burn;
else if (ui->radioButton_initTest->isChecked())
@@ -177,6 +194,11 @@ void Dialog_logIn::on_pbtn_login_clicked()
else if (ui->radioButton_pressureTest->isChecked())
m_loginType = LogInType_PressureTest;
+ saveCfgValue("login", "account", account);
+ saveCfgValue("login", "station", m_loginType);
+ saveCfgValue("login", "rememberPassword", ui->checkBox_rememberPswd->isChecked());
+ saveCfgValue("login", "showPassword", ui->checkBox_showPswd->isChecked());
+
m_accountName = account;
accept();
@@ -244,7 +266,7 @@ void Dialog_logIn::on_pbtn_selectCfgFile_clicked()
saveCfgValue("login", "profile", m_profileName);
}
-void Dialog_logIn::on_checkBox_rememberPswd_toggled(bool checked)
+void Dialog_logIn::on_checkBox_showPswd_toggled(bool checked)
{
- saveCfgValue("login", "rememberPassword", checked);
+ ui->lineEdit_password->setEchoMode(checked ? QLineEdit::Normal : QLineEdit::Password);
}
diff --git a/app/HGProductionTool/dialog_login.h b/app/HGProductionTool/dialog_login.h
index b894648..8b65629 100644
--- a/app/HGProductionTool/dialog_login.h
+++ b/app/HGProductionTool/dialog_login.h
@@ -48,7 +48,7 @@ private slots:
void on_pbtn_selectCfgFile_clicked();
- void on_checkBox_rememberPswd_toggled(bool checked);
+ void on_checkBox_showPswd_toggled(bool checked);
private:
Ui::Dialog_logIn *ui;
diff --git a/app/HGProductionTool/dialog_login.ui b/app/HGProductionTool/dialog_login.ui
index 9e5d080..9cfbc0a 100644
--- a/app/HGProductionTool/dialog_login.ui
+++ b/app/HGProductionTool/dialog_login.ui
@@ -220,8 +220,8 @@ QPushButton#pbtn_close::hover
310
- 90
- 121
+ 80
+ 141
21
@@ -229,6 +229,19 @@ QPushButton#pbtn_close::hover
remember password
+
+
+
+ 310
+ 100
+ 141
+ 21
+
+
+
+ show password
+
+
diff --git a/app/HGProductionTool/mainwindow.cpp b/app/HGProductionTool/mainwindow.cpp
index e29b8d8..0f5ac04 100644
--- a/app/HGProductionTool/mainwindow.cpp
+++ b/app/HGProductionTool/mainwindow.cpp
@@ -34,10 +34,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"));
@@ -388,11 +388,6 @@ QString MainWindow::getDevSn(SANE_Handle handle)
return QString::fromStdString(serialNum.c_str());
}
-void MainWindow::setLogOutStatus(bool show)
-{
- ui->act_logOut->setVisible(show);
-}
-
QString MainWindow::getDevType(SANE_Handle handle)
{
std::string firmWareNum;
diff --git a/app/HGProductionTool/mainwindow.h b/app/HGProductionTool/mainwindow.h
index 9673e08..e0b02d3 100644
--- a/app/HGProductionTool/mainwindow.h
+++ b/app/HGProductionTool/mainwindow.h
@@ -36,7 +36,6 @@ public:
void releaseTesting();
bool isTesting();
QString getDevSn(SANE_Handle handle);
- void setLogOutStatus(bool show);
protected:
void closeEvent(QCloseEvent *event);
diff --git a/app/HGProductionTool/mainwindow.ui b/app/HGProductionTool/mainwindow.ui
index 4c46ceb..4f399e2 100644
--- a/app/HGProductionTool/mainwindow.ui
+++ b/app/HGProductionTool/mainwindow.ui
@@ -74,6 +74,9 @@
act_logOut
+
+ Ctrl+Q
+
@@ -94,6 +97,9 @@
act_openLog
+
+ Ctrl+L
+