diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm
index 403bc2b..09e182e 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 365984c..8e03d34 100644
--- a/app/HGProductionTool/ProductionTool_zh_CN.ts
+++ b/app/HGProductionTool/ProductionTool_zh_CN.ts
@@ -118,42 +118,42 @@
取消
-
-
-
-
-
-
+
+
+
+
+
+
提示
-
+
设备已丢失
-
+
序列号为空
-
+
序列号不合法
-
+
该设备正在进行测试
-
+
设置序列号失败
-
+
设置序列号成功
@@ -167,7 +167,7 @@
-
+
注册
@@ -190,7 +190,7 @@
-
+
提示
@@ -205,7 +205,7 @@
密码不一致!
-
+
用户已存在!
@@ -314,52 +314,44 @@
重置密码
-
-
-
-
- 提示
+ 提示
-
- 创建账户失败:
+ 创建账户失败:
-
+
询问
-
+
请确认是否删除账户:
-
+
确定
-
+
取消
-
- 销毁账户失败:
+ 销毁账户失败:
-
- 修改密码成功
+ 修改密码成功
-
- 修改密码失败:
+ 修改密码失败:
@@ -399,20 +391,18 @@
取消
-
-
+
提示
-
+
两次输入的密码不一致
-
- 修改密码失败:
+ 修改密码失败:
@@ -428,60 +418,80 @@
-
+
+
+ 登录
+
+
+
账户:
-
+
密码:
-
+
+
+ 显示密码
+
+
+
数据库地址:
-
+
数据库端口:
-
+
FTP地址:
-
+
FTP端口:
-
+
烧录工位
-
+
初检工位
-
+
图像测试工位
-
+
压力测试工位
-
+
注册
+
+
+
+ 选择配置文件
+
+
+
+
+ 选择配置文件
+
IP地址:
@@ -491,7 +501,7 @@
端口号:
-
+
登录
@@ -520,24 +530,53 @@
登录
-
-
+
+
+
+
+
提示
-
+
+
+ 账户不存在
+
+
+
+
+ 密码不能为空
+
+
+
+
+ 密码错误
+
+
+
+
+ 请先选择配置文件
+
+
+
+
+ 选择配置文件
+
+
+
+ 提示
+
+
- 登录失败,是否进入单机测试模式?
+ 登录失败,是否进入单机测试模式?
-
- 确定
+ 确定
-
- 取消
+ 取消
@@ -635,36 +674,32 @@
上传
-
+
打开文件
-
+
配置文件(*json)
-
-
-
+
提示
-
+
文件为空
-
- 上传成功
+ 上传成功
-
- 上传至服务器失败,已保存至本地
+ 上传至服务器失败,已保存至本地
@@ -698,17 +733,17 @@
关闭设备
-
+
序号
-
+
选择
-
+
设备
@@ -717,14 +752,14 @@
序列号
-
-
+
+
提示
-
-
+
+
请至少勾选一台设备
@@ -978,7 +1013,7 @@
-
+
不休眠
@@ -995,48 +1030,56 @@
设备型号:%1
-
Serial number: %1, Test item: %2, Test result: Failed! Reason: %3
- 设备序列号: %1, 测试项: %2, 测试结果: 不通过! 原因: %3
+ 设备序列号: %1, 测试项: %2, 测试结果: 不通过! 原因: %3
-
Serial number: %1, Test item: %2, Test result: Pass!
- 设备序列号: %1, 测试项: %2, 测试结果: 通过!
+ 设备序列号: %1, 测试项: %2, 测试结果: 通过!
-
-
+
+
设备历史扫描张数:
-
-
-
-
+
+
+
+
提示
-
+
+
+ 测试员: %1, 测试项: %2, 测试结果: 不通过! 原因: %3
+
+
+
+
+ 测试员: %1, 测试项: %2, 测试结果: 通过!
+
+
+
无纸
-
+
设备处于休眠模式
-
+
设备处于计数模式
-
+
其他错误
@@ -1060,22 +1103,22 @@
测试状态
-
+
未测试
-
+
不通过
-
+
不支持
-
+
通过
@@ -1101,14 +1144,14 @@
Pid:
-
-
+
+
设备滚轴张数:
-
+
标准圆:宽 * 高:
@@ -1133,7 +1176,7 @@
-
+
分钟
@@ -1178,100 +1221,99 @@
用户
-
+
新建项目
-
+
账户管理
-
+
修改密码
-
+
导出
-
+
登出
-
+
退出
-
+
上传配置文件
-
+
刷新设备列表
-
+
+
+ 查看日志
+
+
- 账户在其他地方登录
+ 账户在其他地方登录
网络连接断开
-
- 你已被管理员账户强制下线
+ 你已被管理员账户强制下线
-
- 数据库错误
+ 数据库错误
-
-
-
-
-
-
-
-
+
+
+
+
+
提示
-
+
华高生产工具-烧录工位
-
+
华高生产工具-初检工位
-
+
华高生产工具-图像测试工位
-
+
华高生产工具-压力测试工位
-
-
-
+
+
+
测试中,请勿关闭!
@@ -1293,8 +1335,8 @@
取消
-
-
+
+
不能创建更多项目
@@ -1311,49 +1353,40 @@
打开设备失败
-
- 保存
+ 保存
-
- xls表格(*.xls)
+ xls表格(*.xls)
-
- 导出成功
+ 导出成功
-
- 导出失败
+ 导出失败
-
- 非法的用户
+ 非法的用户
-
- 密码错误
+ 密码错误
-
- 数据库错误
+ 数据库错误
-
- 连接错误
+ 连接错误
-
- 错误
+ 错误
diff --git a/app/HGProductionTool/app_cfg.cpp b/app/HGProductionTool/app_cfg.cpp
index 10b4d3c..8740d94 100644
--- a/app/HGProductionTool/app_cfg.cpp
+++ b/app/HGProductionTool/app_cfg.cpp
@@ -17,27 +17,27 @@ QString getCfgValue(const char *appName, const char *key, const QString &def)
return StdStringToUtf8(value).c_str();
}
-int getCfgValue(const char *appName, const char *key, int def)
-{
- HGChar cfgPath[512];
- HGBase_GetConfigPath(cfgPath, 512);
- strcat(cfgPath, "config.ini");
+//int getCfgValue(const char *appName, const char *key, int def)
+//{
+// HGChar cfgPath[512];
+// HGBase_GetConfigPath(cfgPath, 512);
+// strcat(cfgPath, "config.ini");
- HGInt value = 0;
- HGBase_GetProfileInt(cfgPath, appName, key, def, &value);
- return value;
-}
+// HGInt value = 0;
+// HGBase_GetProfileInt(cfgPath, appName, key, def, &value);
+// return value;
+//}
-bool getCfgValue(const char *appName, const char *key, bool def)
-{
- HGChar cfgPath[512];
- HGBase_GetConfigPath(cfgPath, 512);
- strcat(cfgPath, "config.ini");
+//bool getCfgValue(const char *appName, const char *key, bool def)
+//{
+// HGChar cfgPath[512];
+// HGBase_GetConfigPath(cfgPath, 512);
+// strcat(cfgPath, "config.ini");
- HGInt value = 0;
- HGBase_GetProfileInt(cfgPath, appName, key, (HGInt)def, &value);
- return (bool)value;
-}
+// HGInt value = 0;
+// HGBase_GetProfileInt(cfgPath, appName, key, (HGInt)def, &value);
+// return (bool)value;
+//}
void saveCfgValue(const char *appName, const char *key, const QString &value)
{
@@ -49,22 +49,22 @@ void saveCfgValue(const char *appName, const char *key, const QString &value)
HGBase_SetProfileString(cfgPath, appName, key, getStdString(value).c_str());
}
-void saveCfgValue(const char *appName, const char *key, int value)
-{
- HGChar cfgPath[512];
- HGBase_GetConfigPath(cfgPath, 512);
- HGBase_CreateDir(cfgPath);
- strcat(cfgPath, "config.ini");
+//void saveCfgValue(const char *appName, const char *key, int value)
+//{
+// HGChar cfgPath[512];
+// HGBase_GetConfigPath(cfgPath, 512);
+// HGBase_CreateDir(cfgPath);
+// strcat(cfgPath, "config.ini");
- HGBase_SetProfileInt(cfgPath, appName, key, value);
-}
+// HGBase_SetProfileInt(cfgPath, appName, key, value);
+//}
-void saveCfgValue(const char *appName, const char *key, bool value)
-{
- HGChar cfgPath[512];
- HGBase_GetConfigPath(cfgPath, 512);
- HGBase_CreateDir(cfgPath);
- strcat(cfgPath, "config.ini");
+//void saveCfgValue(const char *appName, const char *key, bool value)
+//{
+// HGChar cfgPath[512];
+// HGBase_GetConfigPath(cfgPath, 512);
+// HGBase_CreateDir(cfgPath);
+// strcat(cfgPath, "config.ini");
- HGBase_SetProfileInt(cfgPath, appName, key, (HGInt)value);
-}
+// HGBase_SetProfileInt(cfgPath, appName, key, (HGInt)value);
+//}
diff --git a/app/HGProductionTool/app_cfg.h b/app/HGProductionTool/app_cfg.h
index 0b5d122..4299390 100644
--- a/app/HGProductionTool/app_cfg.h
+++ b/app/HGProductionTool/app_cfg.h
@@ -4,11 +4,11 @@
#include
QString getCfgValue(const char *appName, const char *key, const QString &def);
-int getCfgValue(const char *appName, const char *key, int def);
-bool getCfgValue(const char *appName, const char *key, bool def);
+//int getCfgValue(const char *appName, const char *key, int def);
+//bool getCfgValue(const char *appName, const char *key, bool def);
void saveCfgValue(const char *appName, const char *key, const QString &value);
-void saveCfgValue(const char *appName, const char *key, int value);
-void saveCfgValue(const char *appName, const char *key, bool value);
+//void saveCfgValue(const char *appName, const char *key, int value);
+//void saveCfgValue(const char *appName, const char *key, bool value);
#endif /* __APP_CFG_H__ */
diff --git a/app/HGProductionTool/dialog_inputserialnum.cpp b/app/HGProductionTool/dialog_inputserialnum.cpp
index 7518ddf..7bc2773 100644
--- a/app/HGProductionTool/dialog_inputserialnum.cpp
+++ b/app/HGProductionTool/dialog_inputserialnum.cpp
@@ -3,13 +3,14 @@
#include "mainwindow.h"
#include "base/HGBase.h"
-Dialog_InputSerialNum::Dialog_InputSerialNum(class MainWindow *mainWnd, const QString &devName,
+Dialog_InputSerialNum::Dialog_InputSerialNum(class MainWindow *mainWnd, const QString &devName, const QString &profileName,
SANE_Handle handle, const QString &serialNum, const QString &devType) :
QDialog(mainWnd),
ui(new Ui::Dialog_InputSerialNum),
m_mainWnd(mainWnd),
m_handle(handle),
m_valid(true),
+ m_profileName(profileName),
m_serialNum(serialNum),
m_devType(devType),
m_devName(devName),
@@ -82,15 +83,9 @@ void Dialog_InputSerialNum::setSpeedAndSleep(bool updateSleep)
return;
}
- HGChar cfgPath[512] = {0};
- HGBase_GetConfigPath(cfgPath, 512);
- HGBase_CreateDir(cfgPath);
- strcat(cfgPath, m_devType.toStdString().c_str());
- strcat(cfgPath, ".json");
-
//HGPdtToolDb_DownloadFile(m_pdtToolDbuserMgr, m_devType.toStdString().c_str(), cfgPath);
- AnalysisJson analysisJson(QString::fromStdString(cfgPath));
+ AnalysisJson analysisJson(m_profileName);
AnalysisJson::json_global jsonGlobal = analysisJson.GetGlobal();
LPWRITECFG lp = new WRITECFG;
diff --git a/app/HGProductionTool/dialog_inputserialnum.h b/app/HGProductionTool/dialog_inputserialnum.h
index dfd703b..876eacc 100644
--- a/app/HGProductionTool/dialog_inputserialnum.h
+++ b/app/HGProductionTool/dialog_inputserialnum.h
@@ -15,7 +15,7 @@ class Dialog_InputSerialNum : public QDialog
Q_OBJECT
public:
- explicit Dialog_InputSerialNum(class MainWindow *mainWnd, const QString &devName,
+ explicit Dialog_InputSerialNum(class MainWindow *mainWnd, const QString &devName, const QString &profileName,
SANE_Handle handle, const QString &serialNum, const QString &devType);
~Dialog_InputSerialNum();
@@ -54,6 +54,7 @@ private:
class MainWindow *m_mainWnd;
SANE_Handle m_handle;
bool m_valid;
+ QString m_profileName;
QString m_serialNum;
QString m_devType;
QString m_devName;
diff --git a/app/HGProductionTool/dialog_login.cpp b/app/HGProductionTool/dialog_login.cpp
index 1643408..5cc03e6 100644
--- a/app/HGProductionTool/dialog_login.cpp
+++ b/app/HGProductionTool/dialog_login.cpp
@@ -3,7 +3,9 @@
#include
#include
#include
+#include
#include "base/HGUtility.h"
+#include "HGUIGlobal.h"
#include "dialog_registeraccount.h"
#include "app_cfg.h"
@@ -11,6 +13,7 @@ Dialog_logIn::Dialog_logIn(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog_logIn)
, m_accountName("")
+ , m_profileName("")
{
ui->setupUi(this);
@@ -28,25 +31,29 @@ Dialog_logIn::Dialog_logIn(QWidget *parent) :
ui->pbtn_close->setToolTip(tr("Close"));
ui->label_title->setText(tr("LogIn"));
ui->lineEdit_password->setEchoMode(QLineEdit::EchoMode::Password);
+ ui->lineEdit_profilePath->setReadOnly(true);
- QString ipStr = "\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b";
- QString portStr = "[0-9]+$";
- ui->lineEdit_dbHost->setValidator(new QRegExpValidator(QRegExp(ipStr)));
- ui->lineEdit_ftpHost->setValidator(new QRegExpValidator(QRegExp(ipStr)));
- ui->lineEdit_dbPort->setValidator(new QRegExpValidator(QRegExp(portStr)));
- ui->lineEdit_ftpPort->setValidator(new QRegExpValidator(QRegExp(portStr)));
+ m_profileName = getCfgValue("login", "profile", m_profileName);
+ ui->lineEdit_profilePath->setText(m_profileName);
- QString account("root");
- QString dbHost("192.168.1.70");
- QString dbPort("3306");
- QString ftpHost("192.168.1.70");
- QString ftpPort("21");
+// QString ipStr = "\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b";
+// QString portStr = "[0-9]+$";
+// ui->lineEdit_dbHost->setValidator(new QRegExpValidator(QRegExp(ipStr)));
+// ui->lineEdit_ftpHost->setValidator(new QRegExpValidator(QRegExp(ipStr)));
+// ui->lineEdit_dbPort->setValidator(new QRegExpValidator(QRegExp(portStr)));
+// ui->lineEdit_ftpPort->setValidator(new QRegExpValidator(QRegExp(portStr)));
- ui->lineEdit_account->setText(getCfgValue("login", "account", account));
- ui->lineEdit_dbHost->setText(getCfgValue("login", "dbHost", dbHost));
- ui->lineEdit_dbPort->setText(getCfgValue("login", "dbPort", dbPort));
- ui->lineEdit_ftpHost->setText(getCfgValue("login", "ftpHost", ftpHost));
- ui->lineEdit_ftpPort->setText(getCfgValue("login", "ftpPort", ftpPort));
+// QString account("root");
+// QString dbHost("192.168.1.70");
+// QString dbPort("3306");
+// QString ftpHost("192.168.1.70");
+// QString ftpPort("21");
+
+ ui->lineEdit_account->setText(getCfgValue("login", "account", ""));
+// ui->lineEdit_dbHost->setText(getCfgValue("login", "dbHost", dbHost));
+// ui->lineEdit_dbPort->setText(getCfgValue("login", "dbPort", dbPort));
+// ui->lineEdit_ftpHost->setText(getCfgValue("login", "ftpHost", ftpHost));
+// ui->lineEdit_ftpPort->setText(getCfgValue("login", "ftpPort", ftpPort));
ui->stackedWidget->setCurrentIndex(0);
}
@@ -81,6 +88,11 @@ QString Dialog_logIn::GetAccountName()
return m_accountName;
}
+QString Dialog_logIn::GetProfileName()
+{
+ return m_profileName;
+}
+
void Dialog_logIn::mousePressEvent(QMouseEvent *event)
{
if(event->button()==Qt::LeftButton)
@@ -111,16 +123,33 @@ void Dialog_logIn::on_pbtn_login_clicked()
{
QString account = ui->lineEdit_account->text();
QString password = ui->lineEdit_password->text();
- QString dbHost = ui->lineEdit_dbHost->text();
- QString dbPort = ui->lineEdit_dbPort->text();
- QString ftpHost = ui->lineEdit_ftpHost->text();
- QString ftpPort = ui->lineEdit_ftpPort->text();
+
+ QString cfgPassword = getCfgValue(account.toStdString().c_str(), "password", "");
+ if (cfgPassword.isEmpty())
+ {
+ QMessageBox::information(this, tr("Prompt"), tr("Account dose not exist"));
+ return;
+ }
+
+ if (password.isEmpty())
+ {
+ QMessageBox::information(this, tr("Prompt"), tr("Password can not be empty"));
+ return;
+ }
+
+ if (password != cfgPassword)
+ {
+ QMessageBox::information(this, tr("Prompt"), tr("Password error"));
+ return;
+ }
+
+ if (ui->lineEdit_profilePath->text().isEmpty())
+ {
+ QMessageBox::information(this, tr("Prompt"), tr("Please select a profile first"));
+ return;
+ }
saveCfgValue("login", "account", account);
- saveCfgValue("login", "dbHost", dbHost);
- saveCfgValue("login", "dbPort", dbPort);
- saveCfgValue("login", "ftpHost", ftpHost);
- saveCfgValue("login", "ftpPort", ftpPort);
if (ui->radioButton_burn->isChecked())
m_loginType = LogInType_Burn;
@@ -189,3 +218,16 @@ void Dialog_logIn::on_pbtn_register_clicked()
dlg.exec();
}
+
+void Dialog_logIn::on_pbtn_selectCfgFile_clicked()
+{
+ QString fileName = QFileDialog::getOpenFileName(nullptr, tr("Select profile"), "", "*.json");
+ ui->lineEdit_profilePath->setText(fileName);
+ m_profileName = getStdFileName(fileName);
+ saveCfgValue("login", "profile", m_profileName);
+}
+
+void Dialog_logIn::on_checkBox_showPassword_toggled(bool 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 3b8626f..b295799 100644
--- a/app/HGProductionTool/dialog_login.h
+++ b/app/HGProductionTool/dialog_login.h
@@ -29,6 +29,7 @@ public:
unsigned short GetFtpPort();
LogInType GetLogInType();
QString GetAccountName();
+ QString GetProfileName();
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
@@ -45,6 +46,10 @@ private slots:
void on_pbtn_register_clicked();
+ void on_pbtn_selectCfgFile_clicked();
+
+ void on_checkBox_showPassword_toggled(bool checked);
+
private:
Ui::Dialog_logIn *ui;
@@ -54,6 +59,7 @@ private:
bool m_leftMousePressed;
LogInType m_loginType;
QString m_accountName;
+ QString m_profileName;
};
#endif // DIALOG_LOGIN_H
diff --git a/app/HGProductionTool/dialog_login.ui b/app/HGProductionTool/dialog_login.ui
index daf6a91..7403051 100644
--- a/app/HGProductionTool/dialog_login.ui
+++ b/app/HGProductionTool/dialog_login.ui
@@ -6,8 +6,8 @@
0
0
- 479
- 329
+ 538
+ 339
@@ -18,7 +18,7 @@
0
0
- 481
+ 541
30
@@ -141,247 +141,312 @@ QPushButton#pbtn_close::hover
-
+
- 40
- 40
- 411
- 141
+ 10
+ 30
+ 521
+ 291
0
-
-
+
+
+ Login
+
+
- 80
- 30
- 48
- 16
+ 60
+ 0
+ 421
+ 141
+
+
+
+ 0
+
+
+
+
+
+ 80
+ 30
+ 48
+ 16
+
+
+
+ account:
+
+
+
+
+
+ 140
+ 30
+ 161
+ 22
+
+
+
+
+
+
+ 80
+ 90
+ 54
+ 16
+
+
+
+ password:
+
+
+
+
+
+ 140
+ 90
+ 161
+ 22
+
+
+
+
+
+
+ 310
+ 90
+ 111
+ 21
+
+
+
+ Show password
+
+
+
+
+
+
+
+ 20
+ 20
+ 111
+ 16
+
+
+
+ dbHost:
+
+
+
+
+
+ 150
+ 20
+ 171
+ 20
+
+
+
+
+
+
+ 20
+ 50
+ 111
+ 16
+
+
+
+ dbPort:
+
+
+
+
+
+ 150
+ 50
+ 171
+ 20
+
+
+
+
+
+
+ 50
+ 80
+ 81
+ 16
+
+
+
+ ftpHost:
+
+
+
+
+
+ 150
+ 80
+ 171
+ 20
+
+
+
+
+
+
+ 50
+ 110
+ 81
+ 16
+
+
+
+ ftpPort:
+
+
+
+
+
+ 150
+ 110
+ 171
+ 20
+
+
+
+
+
+
+ 80
+ 40
+ 151
+ 21
+
+
+
+ PressureTest
+
+
+
+
+
+
+
+ 40
+ 150
+ 131
+ 20
- account:
+ Burn
+
+
+ true
-
+
- 140
- 30
- 161
- 22
-
-
-
-
-
-
- 80
- 90
- 54
- 16
+ 190
+ 150
+ 141
+ 21
- password:
+ InitTest
-
+
- 140
- 90
- 161
- 22
+ 340
+ 150
+ 151
+ 21
+
+
+
+ ImageTest
+
+
+
+
+
+ 150
+ 210
+ 75
+ 31
+
+
+
+ LOG IN
+
+
+ true
+
+
+ true
+
+
+
+
+
+ 280
+ 210
+ 75
+ 31
+
+
+
+ Register
+
+
+
+
+
+ Select Profile
+
+
+
+
+ 170
+ 140
+ 141
+ 31
+
+
+
+ Select config file
+
+
+ true
+
+
+ true
+
+
+
+
+
+ 20
+ 60
+ 481
+ 31
-
-
-
-
- 20
- 20
- 111
- 16
-
-
-
- dbHost:
-
-
-
-
-
- 150
- 20
- 171
- 20
-
-
-
-
-
-
- 20
- 50
- 111
- 16
-
-
-
- dbPort:
-
-
-
-
-
- 150
- 50
- 171
- 20
-
-
-
-
-
-
- 50
- 80
- 81
- 16
-
-
-
- ftpHost:
-
-
-
-
-
- 150
- 80
- 171
- 20
-
-
-
-
-
-
- 50
- 110
- 81
- 16
-
-
-
- ftpPort:
-
-
-
-
-
- 150
- 110
- 171
- 20
-
-
-
-
-
-
-
-
- 140
- 280
- 75
- 31
-
-
-
- LOG IN
-
-
- true
-
-
- true
-
-
-
-
-
- 90
- 186
- 131
- 20
-
-
-
- Burn
-
-
- true
-
-
-
-
-
- 270
- 185
- 141
- 21
-
-
-
- InitTest
-
-
-
-
-
- 90
- 230
- 151
- 21
-
-
-
- ImageTest
-
-
-
-
-
- 270
- 230
- 151
- 21
-
-
-
- PressureTest
-
-
-
-
-
- 260
- 280
- 75
- 31
-
-
-
- Register
-
diff --git a/app/HGProductionTool/dialog_registeraccount.cpp b/app/HGProductionTool/dialog_registeraccount.cpp
index 3795b6c..811c79e 100644
--- a/app/HGProductionTool/dialog_registeraccount.cpp
+++ b/app/HGProductionTool/dialog_registeraccount.cpp
@@ -36,7 +36,8 @@ void Dialog_RegisterAccount::on_pushButton_register_clicked()
return;
}
- if (0)
+ QString account = getCfgValue(ui->lineEdit_account->text().toStdString().c_str(), "password", "");
+ if (!account.isEmpty())
{
QMessageBox::information(this, tr("Prompt"), tr("User already exists"));
return;
diff --git a/app/HGProductionTool/dialog_registeraccount.ui b/app/HGProductionTool/dialog_registeraccount.ui
index fa6a03c..cd52f4b 100644
--- a/app/HGProductionTool/dialog_registeraccount.ui
+++ b/app/HGProductionTool/dialog_registeraccount.ui
@@ -6,7 +6,7 @@
0
0
- 407
+ 406
235
diff --git a/app/HGProductionTool/form_maininterface.cpp b/app/HGProductionTool/form_maininterface.cpp
index 0f72539..c0d6c1b 100644
--- a/app/HGProductionTool/form_maininterface.cpp
+++ b/app/HGProductionTool/form_maininterface.cpp
@@ -15,13 +15,14 @@
#include "dialog_excepdesc.h"
#include "huagao/hgscanner_error.h"
-Form_mainInterface::Form_mainInterface(class MainWindow *mainwnd, Dialog_logIn::LogInType logInType, const QString &accountName, SANE_Handle handle,
+Form_mainInterface::Form_mainInterface(class MainWindow *mainwnd, Dialog_logIn::LogInType logInType, const QString &profileName, const QString &accountName, SANE_Handle handle,
const QString &serialNum, const QString &devType, const QString &devName, const QString &devFwNum)
: QWidget(mainwnd)
, ui(new Ui::Form_mainInterface)
, m_mainwnd(mainwnd)
, m_logInType(logInType)
, m_accountName(accountName)
+ , m_profileName(profileName)
, m_hg(nullptr)
, m_handle(handle)
, m_disconnect(false)
@@ -46,6 +47,7 @@ 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);
@@ -343,8 +345,8 @@ void Form_mainInterface::on_pbtn_fail_clicked()
QTableWidgetItem *item2 = ui->tableWidget->item(row, 2);
item2->setToolTip(str);
- writeTestLog(tr("Serial number: %1, Test item: %2, Test result: Failed! Reason: %3")
- .arg(m_serialNum).arg(title).arg(str));
+ writeTestLog(tr("Tester: %1, Test item: %2, Test result: Failed! Reason: %3")
+ .arg(m_accountName).arg(title).arg(str));
}
}
}
@@ -367,8 +369,8 @@ void Form_mainInterface::on_pbtn_pass_clicked()
QTableWidgetItem *item2 = ui->tableWidget->item(row, 2);
item2->setToolTip("");
- writeTestLog(tr("Serial number: %1, Test item: %2, Test result: Pass!")
- .arg(m_serialNum).arg(title));
+ writeTestLog(tr("Tester: %1, Test item: %2, Test result: Pass!")
+ .arg(m_accountName).arg(title));
on_pbtn_nextStep_clicked();
}
@@ -430,15 +432,9 @@ void Form_mainInterface::initTableWidgetUi()
ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
ui->tableWidget->setStyleSheet("selection-background-color:rgb(193,210,240)");
- HGChar cfgPath[512] = {0};
- HGBase_GetConfigPath(cfgPath, 512);
- HGBase_CreateDir(cfgPath);
- strcat(cfgPath, m_devType.toStdString().c_str());
- strcat(cfgPath, ".json");
-
//HGPdtToolDb_DownloadFile(m_pdtToolDbuserMgr, m_devType.toStdString().c_str(), cfgPath);
- AnalysisJson analysisJson(QString::fromStdString(cfgPath));
+ AnalysisJson analysisJson(m_profileName);
const QString stationStr[] = {"烧录工位", "初检工位", "图像测试工位", "压力测试工位"};
@@ -690,7 +686,7 @@ void Form_mainInterface::writeTestLog(QString logContent)
QString logPath = getLogPath();
HGBase_CreateDir(getStdString(logPath).c_str());
- QString fileName = logPath + m_accountName + ".log";
+ QString fileName = logPath + m_serialNum + ".log";
QFile file(fileName);
if(!file.open(QIODevice::ReadWrite | QIODevice::Append))
{
diff --git a/app/HGProductionTool/form_maininterface.h b/app/HGProductionTool/form_maininterface.h
index 99fbc1e..d5f8947 100644
--- a/app/HGProductionTool/form_maininterface.h
+++ b/app/HGProductionTool/form_maininterface.h
@@ -21,7 +21,7 @@ class Form_mainInterface : public QWidget
Q_OBJECT
public:
- explicit Form_mainInterface(class MainWindow *mainwnd, Dialog_logIn::LogInType logInType, const QString &accountName, SANE_Handle handle,
+ explicit Form_mainInterface(class MainWindow *mainwnd, Dialog_logIn::LogInType logInType, const QString &profileName, const QString &accountName, SANE_Handle handle,
const QString &serialNum, const QString &devType, const QString &devName, const QString &devFwNum);
~Form_mainInterface();
@@ -117,6 +117,7 @@ private:
class MainWindow *m_mainwnd;
Dialog_logIn::LogInType m_logInType;
QString m_accountName;
+ QString m_profileName;
hgscanner *m_hg;
SANE_Handle m_handle;
bool m_disconnect;
diff --git a/app/HGProductionTool/main.cpp b/app/HGProductionTool/main.cpp
index e46134f..729e9e0 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.GetLogInType(), login.GetAccountName(), login.GetFtpHost(), login.GetFtpPort());
+ MainWindow w(login.GetLogInType(), login.GetProfileName(), login.GetAccountName(), login.GetFtpHost(), login.GetFtpPort());
a.exec();
if (w.isExitApp())
{
diff --git a/app/HGProductionTool/mainwindow.cpp b/app/HGProductionTool/mainwindow.cpp
index 1212060..0439934 100644
--- a/app/HGProductionTool/mainwindow.cpp
+++ b/app/HGProductionTool/mainwindow.cpp
@@ -11,7 +11,7 @@
#include "dialog_inputserialnum.h"
#include "dialog_hgmessagebox.h"
-MainWindow::MainWindow(Dialog_logIn::LogInType loginType, const QString &accountName, const QString &ftpHost, unsigned short ftpPort, QWidget *parent)
+MainWindow::MainWindow(Dialog_logIn::LogInType loginType, const QString &profileName, const QString &accountName, const QString &ftpHost, unsigned short ftpPort, QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
, m_ftpHost(ftpHost)
@@ -20,6 +20,7 @@ MainWindow::MainWindow(Dialog_logIn::LogInType loginType, const QString &account
, m_testingRef(0)
, m_loginType(loginType)
, m_accountName(accountName)
+ , m_profileName(profileName)
, m_formBurnMode(nullptr)
, m_top_splitter(nullptr)
, m_bot_splitter(nullptr)
@@ -532,13 +533,13 @@ void MainWindow::on_update_userStatus()
void MainWindow::on_act_newDevice_triggered()
{
- m_inputSnDlg = new Dialog_InputSerialNum(this, "", nullptr, "", "");
+ m_inputSnDlg = new Dialog_InputSerialNum(this, "", m_profileName, nullptr, "", "");
if (m_inputSnDlg->exec())
{
//HGPdtToolDbDevice pdtToolDbDevice = nullptr;
//HGPdtToolDb_OpenDevice(m_pdtToolDbuserMgr, m_inputSnDlg->GetSn().toStdString().c_str(), &pdtToolDbDevice);
- Form_mainInterface *mainInterface = new Form_mainInterface(this, m_loginType, m_accountName, nullptr,
+ Form_mainInterface *mainInterface = new Form_mainInterface(this, m_loginType, m_profileName, m_accountName, nullptr,
m_inputSnDlg->GetSn(), m_inputSnDlg->GetDevType(), nullptr, nullptr);
if (!AddInterface(mainInterface))
{
@@ -660,13 +661,13 @@ 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(), devHandle, getDevSn(devHandle), getDevType(devHandle));
+ m_inputSnDlg = new Dialog_InputSerialNum(this, name[i].c_str(), m_profileName, devHandle, getDevSn(devHandle), getDevType(devHandle));
if (m_inputSnDlg->exec())
{
//HGPdtToolDbDevice pdtToolDbDevice = nullptr;
//HGPdtToolDb_OpenDevice(m_pdtToolDbuserMgr, m_inputSnDlg->GetSn().toStdString().c_str(), &pdtToolDbDevice);
- Form_mainInterface *mainInterface = new Form_mainInterface(this, m_loginType, m_accountName, devHandle,
+ Form_mainInterface *mainInterface = new Form_mainInterface(this, m_loginType, m_profileName, m_accountName, devHandle,
m_inputSnDlg->GetSn(), m_inputSnDlg->GetDevType(), name[i].c_str(), getDevFwNum(devHandle));
if (!AddInterface(mainInterface))
{
@@ -684,3 +685,19 @@ void MainWindow::on_act_refreshDevice_triggered()
}
}
}
+
+void MainWindow::on_act_openLog_triggered()
+{
+ HGChar logPath[512];
+ HGBase_GetDocumentsPath(logPath, 512);
+ HGChar procName[512];
+ HGBase_GetProcessName(procName, 512);
+ strcat(logPath, procName);
+ strcat(logPath, "/Test_Log/");
+
+ QString fileName = logPath + m_accountName + ".log";
+ QFileInfo fileInfo(getStdFileName(fileName));
+ auto pathDir = fileInfo.path();
+ QString strFilePath = "file:///" + pathDir;
+ QDesktopServices::openUrl(QUrl(strFilePath));
+}
diff --git a/app/HGProductionTool/mainwindow.h b/app/HGProductionTool/mainwindow.h
index 2c6e009..e0b02d3 100644
--- a/app/HGProductionTool/mainwindow.h
+++ b/app/HGProductionTool/mainwindow.h
@@ -21,7 +21,7 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
- MainWindow(Dialog_logIn::LogInType loginType, const QString &accountName, const QString &ftpHost, unsigned short ftpPort, QWidget *parent = nullptr);
+ MainWindow(Dialog_logIn::LogInType loginType, const QString &profileName, const QString &accountName, const QString &ftpHost, unsigned short ftpPort, QWidget *parent = nullptr);
~MainWindow();
static QString getLogInfo(HGResult ret);
bool isExitApp();
@@ -72,6 +72,8 @@ private slots:
void on_act_refreshDevice_triggered();
+ void on_act_openLog_triggered();
+
private:
QSplitter *m_top_splitter;
QSplitter *m_bot_splitter;
@@ -85,6 +87,7 @@ private:
int m_testingRef;
Dialog_logIn::LogInType m_loginType;
QString m_accountName;
+ QString m_profileName;
class Dialog_InputSerialNum *m_inputSnDlg;
Form_BurnMode *m_formBurnMode;
diff --git a/app/HGProductionTool/mainwindow.ui b/app/HGProductionTool/mainwindow.ui
index 2488f48..4c46ceb 100644
--- a/app/HGProductionTool/mainwindow.ui
+++ b/app/HGProductionTool/mainwindow.ui
@@ -44,6 +44,7 @@
+
@@ -89,6 +90,11 @@
act_refreshDevice
+
+
+ act_openLog
+
+