diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm
index a5af882..975f961 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 c021f6d..fbe89c4 100644
--- a/app/HGProductionTool/ProductionTool_zh_CN.ts
+++ b/app/HGProductionTool/ProductionTool_zh_CN.ts
@@ -354,14 +354,28 @@
登录
-
+
提示
-
+
+
+ 登录失败,是否进入单机测试模式?
+
+
+
+
+ 确定
+
+
+
+
+ 取消
+
+
- 登录失败:
+ 登录失败:
@@ -455,36 +469,40 @@
上传
-
+
打开文件
-
+
配置文件(*json)
-
-
-
+
+
+
提示
-
+
文件为空
-
+
上传成功
-
+
+
+ 上传至服务器失败,已保存至本地
+
+
- 上传失败:
+ 上传失败:
@@ -550,95 +568,94 @@
下一步
-
-
+
设备已连接
-
+
设备未连接
-
+
设备型号:
-
+
序列号:
-
-
+
+
设备连接状态:
-
+
加载上一次上传的图片
-
+
设备已断开
-
-
+
+
提示
-
+
确定
-
+
取消
-
+
序号
-
+
测试项
-
+
测试状态
-
+
未测试
-
+
不通过
-
+
不支持
-
+
通过
-
+
无图
@@ -704,7 +721,7 @@
上传配置文件
-
+
账户在其他地方登录
@@ -713,54 +730,54 @@
网络连接断开
-
+
你已被管理员账户强制下线
-
+
数据库错误
-
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
提示
-
-
+
+
测试中,请勿关闭!
-
+
检测到设备连接,是否启动测试?
-
+
确定
-
+
取消
-
-
+
+
不能创建更多项目
@@ -769,52 +786,52 @@
设备已断开连接
-
+
打开设备失败
-
+
保存
-
+
xls表格(*.xls)
-
+
导出成功
-
+
导出失败
-
+
非法的用户
-
+
密码错误
-
+
数据库错误
-
+
连接错误
-
+
错误
diff --git a/app/HGProductionTool/dialog_login.cpp b/app/HGProductionTool/dialog_login.cpp
index 00237fd..d93d563 100644
--- a/app/HGProductionTool/dialog_login.cpp
+++ b/app/HGProductionTool/dialog_login.cpp
@@ -110,7 +110,7 @@ void Dialog_logIn::on_pbtn_login_clicked()
saveCfgValue("login", "ftpPort", ftpPort);
HGPdtToolDbUserMgr pdtToolDbuserMgr = nullptr;
- HGResult ret = HGPdtToolDb_CreateUserMgr(dbHost.toStdString().c_str(), dbPort.toInt(), account.toStdString().c_str(), password.toStdString().c_str(),
+ HGPdtToolDb_CreateUserMgr(dbHost.toStdString().c_str(), dbPort.toInt(), account.toStdString().c_str(), password.toStdString().c_str(),
&pdtToolDbuserMgr);
if (NULL != pdtToolDbuserMgr)
{
@@ -119,8 +119,19 @@ void Dialog_logIn::on_pbtn_login_clicked()
}
else
{
- QMessageBox::information(this, tr("tips"), tr("Login failed: ") + MainWindow::getLogInfo(ret));
- return;
+ QMessageBox msg(QMessageBox::Question, tr("tips"), tr("Login failed, sure to enter offline mode?"), QMessageBox::Yes | QMessageBox::No, this);
+ msg.setButtonText(QMessageBox::Yes, tr("yes"));
+ msg.setButtonText(QMessageBox::No, tr("no"));
+ msg.exec();
+ if (msg.clickedButton() == msg.button(QMessageBox::Yes))
+ {
+ m_pdtToolDbuserMgr = nullptr;
+ accept();;
+ }
+ else
+ {
+ return;
+ }
}
}
diff --git a/app/HGProductionTool/dialog_uploadcfgfile.cpp b/app/HGProductionTool/dialog_uploadcfgfile.cpp
index 95418ed..42adf3a 100644
--- a/app/HGProductionTool/dialog_uploadcfgfile.cpp
+++ b/app/HGProductionTool/dialog_uploadcfgfile.cpp
@@ -5,6 +5,7 @@
#include
#include "mainwindow.h"
#include "HGUIGlobal.h"
+#include "base/HGBase.h"
Dialog_uploadCfgFile::Dialog_uploadCfgFile(HGPdtToolDbUserMgr pdtToolDbuserMgr, QWidget *parent) :
QDialog(parent),
@@ -44,6 +45,16 @@ void Dialog_uploadCfgFile::on_pbtn_upload_clicked()
QString tag = ui->comboBox_tag->currentText();
QString filename = ui->lineEdit_filename->text();
+
+ HGChar cfgPath[512] = {0};
+ HGBase_GetConfigPath(cfgPath, 512);
+ HGBase_CreateDir(cfgPath);
+ strcat(cfgPath, tag.toStdString().c_str());
+ strcat(cfgPath, ".json");
+
+ QFile file(filename);
+ file.copy(filename, cfgPath);
+
HGResult ret = HGPdtToolDb_UploadFile(m_pdtToolDbuserMgr, tag.toStdString().c_str(), getStdString(filename).c_str());
if(ret == HGBASE_ERR_OK)
{
@@ -52,7 +63,7 @@ void Dialog_uploadCfgFile::on_pbtn_upload_clicked()
}
else
{
- QMessageBox::information(this, tr("tips"), tr("upload failed: ") + MainWindow::getLogInfo(ret));
+ QMessageBox::information(this, tr("tips"), tr("upload to service failed, already save to local host"));
}
}
diff --git a/app/HGProductionTool/form_maininterface.cpp b/app/HGProductionTool/form_maininterface.cpp
index d0c271e..340b261 100644
--- a/app/HGProductionTool/form_maininterface.cpp
+++ b/app/HGProductionTool/form_maininterface.cpp
@@ -342,80 +342,78 @@ void Form_mainInterface::initTableWidgetUi()
strcat(cfgPath, m_devType.toStdString().c_str());
strcat(cfgPath, ".json");
- HGResult ret = HGPdtToolDb_DownloadFile(m_pdtToolDbuserMgr, m_devType.toStdString().c_str(), cfgPath);
- if(ret == HGBASE_ERR_OK)
+ HGPdtToolDb_DownloadFile(m_pdtToolDbuserMgr, m_devType.toStdString().c_str(), cfgPath);
+
+ AnalysisJson analysisJson(QString::fromStdString(cfgPath));
+
+ setGlobalCfg(analysisJson);
+
+ std::map dbEntryItems;
+ for (int i = HGPDTTOOLDB_ENTRYNAME_DIAL_SWITCH; i <= HGPDTTOOLDB_ENTRYNAME_SCANNING_SENSOR; ++i)
+ dbEntryItems[i] = false;
+ for (int i = HGPDTTOOLDB_ENTRYNAME_CONFIGURE_SPEED_MODE; i <= HGPDTTOOLDB_ENTRYNAME_MECH_PAPER_FEEDING_INCLINATION; ++i)
+ dbEntryItems[i] = false;
+ for (int i = HGPDTTOOLDB_ENTRYNAME_SINGLE_PAGE_TEST_1; i <= HGPDTTOOLDB_ENTRYNAME_CLEAR_ROLLER_COUNT; ++i)
+ dbEntryItems[i] = false;
+
+ std::vector list_jsonNode = analysisJson.GetNode();
+ int count = list_jsonNode.size();
+ ui->tableWidget->setRowCount(count);
+ for(int i = 0; i < count; ++i)
{
- AnalysisJson analysisJson(QString::fromStdString(cfgPath));
+ AnalysisJson::json_node node = list_jsonNode[i];
+ m_map_title_name.insert(node.title, node);
- setGlobalCfg(analysisJson);
+ ui->tableWidget->setItem(i, 0, new QTableWidgetItem(QString::number(i+1)));
+ ui->tableWidget->item(i, 0)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
- std::map dbEntryItems;
- for (int i = HGPDTTOOLDB_ENTRYNAME_DIAL_SWITCH; i <= HGPDTTOOLDB_ENTRYNAME_SCANNING_SENSOR; ++i)
- dbEntryItems[i] = false;
- for (int i = HGPDTTOOLDB_ENTRYNAME_CONFIGURE_SPEED_MODE; i <= HGPDTTOOLDB_ENTRYNAME_MECH_PAPER_FEEDING_INCLINATION; ++i)
- dbEntryItems[i] = false;
- for (int i = HGPDTTOOLDB_ENTRYNAME_SINGLE_PAGE_TEST_1; i <= HGPDTTOOLDB_ENTRYNAME_CLEAR_ROLLER_COUNT; ++i)
- dbEntryItems[i] = false;
+ ui->tableWidget->setItem(i, 1, new QTableWidgetItem(node.title));
+ ui->tableWidget->item(i, 1)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
- std::vector list_jsonNode = analysisJson.GetNode();
- int count = list_jsonNode.size();
- ui->tableWidget->setRowCount(count);
- for(int i = 0; i < count; ++i)
+ HGUInt status = getTestItemStatus(node.title);
+ QString statusStr = getItemStatusStr(status);
+ ui->tableWidget->setItem(i, 2, new QTableWidgetItem(statusStr));
+ ui->tableWidget->item(i, 2)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
+ if (HGPDTTOOLDB_ENTRYSTATUS_NOTPASS == status)
{
- AnalysisJson::json_node node = list_jsonNode[i];
- m_map_title_name.insert(node.title, node);
-
- ui->tableWidget->setItem(i, 0, new QTableWidgetItem(QString::number(i+1)));
- ui->tableWidget->item(i, 0)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
-
- ui->tableWidget->setItem(i, 1, new QTableWidgetItem(node.title));
- ui->tableWidget->item(i, 1)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
-
- HGUInt status = getTestItemStatus(node.title);
- QString statusStr = getItemStatusStr(status);
- ui->tableWidget->setItem(i, 2, new QTableWidgetItem(statusStr));
- ui->tableWidget->item(i, 2)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
- if (HGPDTTOOLDB_ENTRYSTATUS_NOTPASS == status)
- {
- ui->tableWidget->item(i, 2)->setBackgroundColor(QColor(255,0,0));
- }
- else if (HGPDTTOOLDB_ENTRYSTATUS_NOTSUPP == status)
- {
- ui->tableWidget->item(i, 2)->setBackgroundColor(QColor(255,255,0));
- }
- else if (HGPDTTOOLDB_ENTRYSTATUS_PASS == status)
- {
- ui->tableWidget->item(i, 2)->setBackgroundColor(QColor(0,255,0));
- }
-
- HGUInt entry = getTestItem(node.title);
- std::map::iterator iter;
- for (iter = dbEntryItems.begin(); iter != dbEntryItems.end(); ++iter)
- {
- if (entry == iter->first)
- {
- iter->second = true;
- break;
- }
- }
-
- HGChar desc[512] = {0};
- HGPdtToolDb_GetDeviceEntryExcepDesc(m_pdtToolDbDevice, getTestItem(node.title), desc, 512);
- QTableWidgetItem *item = ui->tableWidget->item(i, 2);
- item->setToolTip(desc);
+ ui->tableWidget->item(i, 2)->setBackgroundColor(QColor(255,0,0));
+ }
+ else if (HGPDTTOOLDB_ENTRYSTATUS_NOTSUPP == status)
+ {
+ ui->tableWidget->item(i, 2)->setBackgroundColor(QColor(255,255,0));
+ }
+ else if (HGPDTTOOLDB_ENTRYSTATUS_PASS == status)
+ {
+ ui->tableWidget->item(i, 2)->setBackgroundColor(QColor(0,255,0));
}
+ HGUInt entry = getTestItem(node.title);
std::map::iterator iter;
for (iter = dbEntryItems.begin(); iter != dbEntryItems.end(); ++iter)
{
- if (!iter->second)
+ if (entry == iter->first)
{
- HGPdtToolDb_SetDeviceEntryStatus(m_pdtToolDbDevice, iter->first, HGPDTTOOLDB_ENTRYSTATUS_NOTSUPP);
+ iter->second = true;
+ break;
}
}
- ui->tableWidget->selectRow(0);
+ HGChar desc[512] = {0};
+ HGPdtToolDb_GetDeviceEntryExcepDesc(m_pdtToolDbDevice, getTestItem(node.title), desc, 512);
+ QTableWidgetItem *item = ui->tableWidget->item(i, 2);
+ item->setToolTip(desc);
}
+
+ std::map::iterator iter;
+ for (iter = dbEntryItems.begin(); iter != dbEntryItems.end(); ++iter)
+ {
+ if (!iter->second)
+ {
+ HGPdtToolDb_SetDeviceEntryStatus(m_pdtToolDbDevice, iter->first, HGPDTTOOLDB_ENTRYSTATUS_NOTSUPP);
+ }
+ }
+
+ ui->tableWidget->selectRow(0);
}
HGUInt Form_mainInterface::getTestItem(const QString &title)
diff --git a/app/HGProductionTool/mainwindow.cpp b/app/HGProductionTool/mainwindow.cpp
index 2c12a31..3f5b972 100644
--- a/app/HGProductionTool/mainwindow.cpp
+++ b/app/HGProductionTool/mainwindow.cpp
@@ -61,7 +61,7 @@ MainWindow::MainWindow(HGPdtToolDbUserMgr pdtToolDbuserMgr, const QString &ftpHo
ui->act_upload->setVisible(false);
}
- HGChar userName[128];
+ HGChar userName[128] = {0};
HGPdtToolDb_GetUserName(m_pdtToolDbuserMgr, userName, 128);
setWindowTitle(userName);
@@ -418,7 +418,7 @@ void MainWindow::on_sane_dev_remove(QString devName)
void MainWindow::on_update_userStatus()
{
QString tips;
- HGUInt userStatus;
+ HGUInt userStatus = 0;
HGPdtToolDb_GetUserStatus(m_pdtToolDbuserMgr, &userStatus);
switch (userStatus)