diff --git a/app/HGProductionTool/HGProductionTool.pro b/app/HGProductionTool/HGProductionTool.pro
index c953320..bb705ff 100644
--- a/app/HGProductionTool/HGProductionTool.pro
+++ b/app/HGProductionTool/HGProductionTool.pro
@@ -25,13 +25,14 @@ win32 {
contains(QT_ARCH, i386) {
LIBS += -L../../../sdk/lib/win/x86/Release -lHGBase -lHGImgFmt -lHGImgProc
LIBS += -L../../../sdk/lib/win/x86/OEM/huagao -lsane
- LIBS += -L../../code/base/Debug/ -ltest
CONFIG(release, debug|release) {
LIBS += -L../../db/Release -lHGPdtToolDb
+ LIBS += -L../../code/base/Release/ -ltest
DESTDIR = ../../../release/win/x86/Release
}
CONFIG(debug, debug|release) {
LIBS += -L../../db/Debug -lHGPdtToolDb
+ LIBS += -L../../code/base/Debug/ -ltest
}
}
contains(QT_ARCH, x86_64){
@@ -39,10 +40,12 @@ win32 {
LIBS += -L../../../sdk/lib/win/x64/OEM/huagao -lsane
CONFIG(release, debug|release) {
LIBS += -L../../db/x64/Release -lHGPdtToolDb
+ LIBS += -L../../code/base/x64/Release/ -ltest
DESTDIR = ../../../release/win/x64/Release
}
CONFIG(debug, debug|release) {
LIBS += -L../../db/x64/Debug -lHGPdtToolDb
+ LIBS += -L../../code/base/x64/Debug/ -ltest
}
}
}
diff --git a/app/HGProductionTool/ProductionTool_zh_CN.qm b/app/HGProductionTool/ProductionTool_zh_CN.qm
index 5712cb7..69bc9ae 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 0b805fd..2a69151 100644
--- a/app/HGProductionTool/ProductionTool_zh_CN.ts
+++ b/app/HGProductionTool/ProductionTool_zh_CN.ts
@@ -24,7 +24,7 @@
取消
-
+
请输入异常说明:
@@ -85,18 +85,18 @@
取消
-
-
+
+
提示
-
+
序列号为空
-
+
该设备正在进行测试
@@ -114,25 +114,35 @@
-
+
- 确定
+ 是
-
+
-
+ 否
-
+
确定
-
+
取消
+
+
+
+ 提示
+
+
+
+
+ 请输入有效内容
+
Dialog_accountManage
@@ -162,50 +172,50 @@
重置密码
-
-
-
+
+
+
提示
-
+
创建账户失败:
-
+
询问
-
+
请确认是否删除账户:
-
+
确定
-
+
取消
-
+
销毁账户失败:
-
+
修改密码成功
-
+
修改密码失败:
@@ -218,17 +228,17 @@
修改密码
-
+
旧密码:
-
+
新密码:
-
+
确认新密码:
@@ -247,18 +257,18 @@
取消
-
-
+
+
提示
-
+
两次输入的密码不一致
-
+
修改密码失败:
@@ -324,32 +334,32 @@
退出
-
+
设置IP与端口
-
+
最小化
-
+
关闭
-
+
登录
-
+
提示
-
+
登录失败:
@@ -387,12 +397,12 @@
创建账户
-
+
重置密码
-
+
新密码:
@@ -445,34 +455,34 @@
上传
-
+
打开文件
-
+
配置文件(*json)
-
-
-
+
+
+
提示
-
+
文件为空
-
+
上传成功
-
+
上传失败:
@@ -535,88 +545,88 @@
下一步
-
+
设备已连接
-
+
设备未连接
-
+
设备型号:
-
+
序列号:
-
+
设备连接状态:
-
+
加载上一次上传的图片
-
-
+
+
提示
-
+
确定
-
+
取消
-
+
序号
-
+
测试项
-
+
测试状态
-
+
未测试
-
+
不通过
-
+
不支持
-
+
通过
-
+
无图
@@ -682,7 +692,7 @@
上传配置文件
-
+
账户在其他地方登录
@@ -691,94 +701,94 @@
网络连接断开
-
+
你已被管理员账户强制下线
-
+
数据库错误
-
-
-
-
-
-
-
+
+
+
+
+
+
+
提示
-
+
检测到设备连接,是否启动测试?
-
+
确定
-
+
取消
-
-
+
+
不能创建更多项目
-
+
设备已断开连接
-
+
保存
-
+
xls表格(*.xls)
-
+
导出成功
-
+
导出失败
-
+
非法的用户
-
+
密码错误
-
+
数据库错误
-
+
连接错误
-
+
错误
@@ -787,8 +797,9 @@
QObject
-
- 成功
+
+ success
+ 成功:
diff --git a/app/HGProductionTool/dialog_userinput.cpp b/app/HGProductionTool/dialog_userinput.cpp
index fbeb7ed..a83e524 100644
--- a/app/HGProductionTool/dialog_userinput.cpp
+++ b/app/HGProductionTool/dialog_userinput.cpp
@@ -1,8 +1,9 @@
#include "dialog_userinput.h"
#include "ui_dialog_userinput.h"
#include
+#include
-Dialog_UserInput::Dialog_UserInput(ui_helper::value_type type, const QString &title, const QString &desc, QWidget *parent) :
+Dialog_UserInput::Dialog_UserInput(ui_helper::value_type type, const QString &title, const wchar_t* desc, QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog_UserInput),
m_type(type),
@@ -11,18 +12,31 @@ Dialog_UserInput::Dialog_UserInput(ui_helper::value_type type, const QString &ti
{
ui->setupUi(this);
+ ui->radioButton_yes->setVisible(false);
+ ui->radioButton_no->setVisible(false);
+ ui->lineEdit->setVisible(false);
+ ui->comboBox->setVisible(false);
if (type == ui_helper::VAL_TYPE_BOOL)
{
+ ui->label->setText(QString::fromStdWString(m_desc));
ui->radioButton_yes->setVisible(true);
ui->radioButton_no->setVisible(true);
- ui->lineEdit->setVisible(false);
}
else if (type == ui_helper::VAL_TYPE_INT || type == ui_helper::VAL_TYPE_FLOAT || type == ui_helper::VAL_TYPE_STRING)
{
- ui->radioButton_yes->setVisible(false);
- ui->radioButton_no->setVisible(false);
+ ui->label->setText(QString::fromStdWString(m_desc));
ui->lineEdit->setVisible(true);
}
+ else if (type == ui_helper::VAL_TYPE_RANGE)
+ {
+ while(*m_desc != '\0')
+ {
+ ui->comboBox->addItem(QString::number(*m_desc));
+ m_desc++;
+ }
+
+ ui->comboBox->setVisible(true);
+ }
setWindowTitle(m_title);
@@ -30,7 +44,7 @@ Dialog_UserInput::Dialog_UserInput(ui_helper::value_type type, const QString &ti
ft.setPointSize(15);
this->setFont(ft);
- ui->label->setText(m_desc);
+
ui->lineEdit->setValidator(new QRegExpValidator(QRegExp("[0-9]+$")));
}
@@ -61,12 +75,22 @@ parameter *Dialog_UserInput::getParam()
{
param->m_sData = ui->lineEdit->text().toStdWString();
}
+ else if (m_type == ui_helper::VAL_TYPE_RANGE)
+ {
+ param->m_iData = ui->comboBox->currentText().toInt();
+ }
return param;
}
void Dialog_UserInput::on_pbtn_yes_clicked()
{
+ if (ui->lineEdit->text().isEmpty() && (m_type == ui_helper::VAL_TYPE_INT || m_type == ui_helper::VAL_TYPE_FLOAT || m_type == ui_helper::VAL_TYPE_STRING))
+ {
+ QMessageBox::information(this, tr("tips"), tr("please input valid contents"));
+ return;
+ }
+
getParam();
accept();
}
@@ -91,7 +115,7 @@ size_t UserInputParams::get_size()
{
if (m_type == ui_helper::VAL_TYPE_BOOL)
return sizeof(bool);
- if (m_type == ui_helper::VAL_TYPE_INT)
+ if (m_type == ui_helper::VAL_TYPE_INT || m_type == ui_helper::VAL_TYPE_RANGE)
return sizeof(int);
if (m_type == ui_helper::VAL_TYPE_FLOAT)
return sizeof(double);
@@ -104,7 +128,7 @@ void *UserInputParams::get_data()
{
if (m_type == ui_helper::VAL_TYPE_BOOL)
return &m_bData;
- if (m_type == ui_helper::VAL_TYPE_INT)
+ if (m_type == ui_helper::VAL_TYPE_INT || m_type == ui_helper::VAL_TYPE_RANGE)
return &m_iData;
if (m_type == ui_helper::VAL_TYPE_FLOAT)
return &m_fData;
diff --git a/app/HGProductionTool/dialog_userinput.h b/app/HGProductionTool/dialog_userinput.h
index f6bb535..52a156f 100644
--- a/app/HGProductionTool/dialog_userinput.h
+++ b/app/HGProductionTool/dialog_userinput.h
@@ -30,7 +30,7 @@ class Dialog_UserInput : public QDialog
Q_OBJECT
public:
- explicit Dialog_UserInput(ui_helper::value_type type, const QString &title, const QString &desc, QWidget *parent = nullptr);
+ explicit Dialog_UserInput(ui_helper::value_type type, const QString &title, const wchar_t* desc, QWidget *parent = nullptr);
~Dialog_UserInput();
parameter *getParam();
@@ -45,7 +45,7 @@ private:
ui_helper::value_type m_type;
QString m_title;
- QString m_desc;
+ const wchar_t *m_desc;
};
#endif // DIALOG_USERINPUT_H
diff --git a/app/HGProductionTool/dialog_userinput.ui b/app/HGProductionTool/dialog_userinput.ui
index af70dee..8ef5c31 100644
--- a/app/HGProductionTool/dialog_userinput.ui
+++ b/app/HGProductionTool/dialog_userinput.ui
@@ -7,7 +7,7 @@
0
0
426
- 147
+ 178
@@ -112,6 +112,33 @@
+ -
+
+
-
+
+
+
+ 171
+ 0
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
-
-
diff --git a/app/HGProductionTool/form_maininterface.cpp b/app/HGProductionTool/form_maininterface.cpp
index cf1fdd6..a4b4683 100644
--- a/app/HGProductionTool/form_maininterface.cpp
+++ b/app/HGProductionTool/form_maininterface.cpp
@@ -162,21 +162,6 @@ void Form_mainInterface::on_testResultImg(void *img)
ui->pbtn_leftRotate->setVisible(true);
ui->pbtn_rightRotate->setVisible(true);
- QString fileName = getCacheFileName();
- HGResult ret = HGImgFmt_SaveImage(image, 0, 0, getStdString(fileName).c_str());
- if(ret == HGBASE_ERR_OK)
- {
- int row = ui->tableWidget->currentRow();
- QTableWidgetItem *item = ui->tableWidget->item(row, 1);
- QString title = item->text();
- HGUInt entryName = getTestItem(title);
-
- ret = HGPdtToolDb_UploadDeviceEntryImage(m_pdtToolDbDevice, entryName, m_mainwnd->m_ftpHost.toStdString().c_str(),
- m_mainwnd->m_ftpPort, fileName.toStdString().c_str());
- QFile file(fileName);
- file.remove();
- }
-
HGBase_DestroyImage(image);
}
@@ -249,6 +234,27 @@ void Form_mainInterface::on_pbtn_pass_clicked()
QTableWidgetItem *item2 = ui->tableWidget->item(row, 2);
item2->setToolTip("");
+ HGImage img = nullptr;
+ m_view->getImage(&img);
+
+ if (img != nullptr)
+ {
+ QString fileName = getCacheFileName();
+ HGResult ret = HGImgFmt_SaveImage(img, 0, 0, getStdString(fileName).c_str());
+ if(ret == HGBASE_ERR_OK)
+ {
+ int row = ui->tableWidget->currentRow();
+ QTableWidgetItem *item = ui->tableWidget->item(row, 1);
+ QString title = item->text();
+ HGUInt entryName = getTestItem(title);
+
+ ret = HGPdtToolDb_UploadDeviceEntryImage(m_pdtToolDbDevice, entryName, m_mainwnd->m_ftpHost.toStdString().c_str(),
+ m_mainwnd->m_ftpPort, fileName.toStdString().c_str());
+ QFile file(fileName);
+ file.remove();
+ }
+ }
+
on_pbtn_nextStep_clicked();
}
@@ -458,9 +464,10 @@ void Form_mainInterface::on_tableWidget_currentItemChanged(QTableWidgetItem *cur
m_textTips->setViewContent(m_map_title_name.value(title).desc);
ui->stackedWidget->setCurrentWidget(m_textTips);
+ m_view->clearImage();
HGUInt entryName = getTestItem(title);
- if (entryName <= HGPDTTOOLDB_ENTRYNAME_MECH_PAPER_FEEDING_INCLINATION && entryName >= HGPDTTOOLDB_ENTRYNAME_CONFIGURE_SPEED_MODE)
+ if (HGBASE_ERR_OK == HGPdtToolDb_CheckDeviceEntryImage(m_pdtToolDbDevice, entryName))
{
ui->pbtn_showImg->setVisible(true);
}
diff --git a/app/HGProductionTool/hgscanner.cpp b/app/HGProductionTool/hgscanner.cpp
index 7b7da71..cb49541 100644
--- a/app/HGProductionTool/hgscanner.cpp
+++ b/app/HGProductionTool/hgscanner.cpp
@@ -2,6 +2,7 @@
#include
#include "form_maininterface.h"
#include "dialog_userinput.h"
+#include
hgscanner::hgscanner(Form_mainInterface *form, SANE_Handle h)
: m_interface(form)
@@ -18,7 +19,7 @@ parameter* hgscanner::get_user_input(data_from from, value_type type, const wcha
{
if (from == DATA_FROM_USER)
{
- Dialog_UserInput dlg(type, QString::fromStdWString(title), QString::fromStdWString(desc), m_interface);
+ Dialog_UserInput dlg(type, QString::fromStdWString(title), desc, m_interface);
if (dlg.exec())
{
return dlg.getParam();
@@ -39,7 +40,7 @@ void hgscanner::test_callback(const wchar_t* name, test_event ev, void* data, si
QString ret;
QString info = QString::fromStdWString((const wchar_t*)data);
if (flag)
- ret = QObject::tr("success");
+ ret = QObject::tr("success: ") + info;
else
ret = QObject::tr("failed: ") + info;
diff --git a/code/base/test.vcxproj b/code/base/test.vcxproj
index a1c42c9..ea9003d 100644
--- a/code/base/test.vcxproj
+++ b/code/base/test.vcxproj
@@ -29,26 +29,26 @@
DynamicLibrary
true
- v143
+ v142
Unicode
DynamicLibrary
false
- v143
+ v142
true
Unicode
DynamicLibrary
true
- v143
+ v142
Unicode
DynamicLibrary
false
- v143
+ v142
true
Unicode
diff --git a/db/HGPdtToolDb/HGPdtToolDb.cpp b/db/HGPdtToolDb/HGPdtToolDb.cpp
index 9d9e897..fbad352 100644
--- a/db/HGPdtToolDb/HGPdtToolDb.cpp
+++ b/db/HGPdtToolDb/HGPdtToolDb.cpp
@@ -374,6 +374,17 @@ HGResult HGAPI HGPdtToolDb_DownloadDeviceEntryImage(HGPdtToolDbDevice device, HG
return deviceImpl->DownloadEntryImage(entryName, ftpHost, ftpPort, fileName);
}
+HGResult HGAPI HGPdtToolDb_CheckDeviceEntryImage(HGPdtToolDbDevice device, HGUInt entryName)
+{
+ if (NULL == device)
+ {
+ return HGBASE_ERR_INVALIDARG;
+ }
+
+ HGPdtToolDbDeviceImpl* deviceImpl = (HGPdtToolDbDeviceImpl*)device;
+ return deviceImpl->CheckEntryImage(entryName);
+}
+
HGResult HGAPI HGPdtToolDb_UploadDeviceEntryImage(HGPdtToolDbDevice device, HGUInt entryName,
const HGChar* ftpHost, HGUShort ftpPort, const HGChar* fileName)
{
diff --git a/db/HGPdtToolDb/HGPdtToolDb.def b/db/HGPdtToolDb/HGPdtToolDb.def
index ef70870..54fce4e 100644
--- a/db/HGPdtToolDb/HGPdtToolDb.def
+++ b/db/HGPdtToolDb/HGPdtToolDb.def
@@ -34,4 +34,5 @@ HGPdtToolDb_GetDeviceEntryExcepDesc
HGPdtToolDb_SetDeviceEntryStatus
HGPdtToolDb_SetDeviceEntryExcepDesc
HGPdtToolDb_DownloadDeviceEntryImage
+HGPdtToolDb_CheckDeviceEntryImage
HGPdtToolDb_UploadDeviceEntryImage
diff --git a/db/HGPdtToolDb/HGPdtToolDb.h b/db/HGPdtToolDb/HGPdtToolDb.h
index 4e912b9..584818a 100644
--- a/db/HGPdtToolDb/HGPdtToolDb.h
+++ b/db/HGPdtToolDb/HGPdtToolDb.h
@@ -202,6 +202,9 @@ HGEXPORT HGResult HGAPI HGPdtToolDb_SetDeviceEntryExcepDesc(HGPdtToolDbDevice de
HGEXPORT HGResult HGAPI HGPdtToolDb_DownloadDeviceEntryImage(HGPdtToolDbDevice device, HGUInt entryName,
const HGChar* ftpHost, HGUShort ftpPort, const HGChar* fileName);
+/* 检查某个测试项关联的图像 */
+HGEXPORT HGResult HGAPI HGPdtToolDb_CheckDeviceEntryImage(HGPdtToolDbDevice device, HGUInt entryName);
+
/* 上传/更新某个测试项关联的图像 */
HGEXPORT HGResult HGAPI HGPdtToolDb_UploadDeviceEntryImage(HGPdtToolDbDevice device, HGUInt entryName,
const HGChar* ftpHost, HGUShort ftpPort, const HGChar* fileName);
diff --git a/db/HGPdtToolDb/HGPdtToolDbImpl.cpp b/db/HGPdtToolDb/HGPdtToolDbImpl.cpp
index f22bcb4..0785dbf 100644
--- a/db/HGPdtToolDb/HGPdtToolDbImpl.cpp
+++ b/db/HGPdtToolDb/HGPdtToolDbImpl.cpp
@@ -1565,6 +1565,36 @@ HGResult HGPdtToolDbDeviceImpl::DownloadEntryImage(HGUInt entryName, const HGCha
return DownloadFile(ftpHost, ftpPort, remotePath.c_str(), fileName);
}
+HGResult HGPdtToolDbDeviceImpl::CheckEntryImage(HGUInt entryName)
+{
+ if (NULL == m_userMgr->m_sql)
+ {
+ return HGBASE_ERR_FAIL;
+ }
+
+ const HGChar* entryNameStr = NULL;
+ if (entryName >= HGPDTTOOLDB_ENTRYNAME_CONFIGURE_SPEED_MODE && entryName <= HGPDTTOOLDB_ENTRYNAME_MECH_PAPER_FEEDING_INCLINATION)
+ entryNameStr = IMAGE_INSPECTION[entryName - HGPDTTOOLDB_ENTRYNAME_CONFIGURE_SPEED_MODE];
+ if (NULL == entryNameStr)
+ {
+ return HGBASE_ERR_INVALIDARG;
+ }
+
+ std::string remotePath;
+ HGResult res = GetEntryImageRemotePath(entryNameStr, remotePath);
+ if (HGBASE_ERR_OK != res)
+ {
+ return res;
+ }
+
+ if (remotePath.empty())
+ {
+ return HGBASE_ERR_FAIL;
+ }
+
+ return HGBASE_ERR_OK;
+}
+
HGResult HGPdtToolDbDeviceImpl::UploadEntryImage(HGUInt entryName, const HGChar* ftpHost, HGUShort ftpPort, const HGChar* fileName)
{
if (NULL == m_userMgr->m_sql)
diff --git a/db/HGPdtToolDb/HGPdtToolDbImpl.hpp b/db/HGPdtToolDb/HGPdtToolDbImpl.hpp
index d0c3fc9..ca35cc8 100644
--- a/db/HGPdtToolDb/HGPdtToolDbImpl.hpp
+++ b/db/HGPdtToolDb/HGPdtToolDbImpl.hpp
@@ -87,6 +87,7 @@ public:
HGResult GetEntryExcepDesc(HGUInt entryName, HGChar* excepDesc, HGUInt maxLen);
HGResult SetEntryExcepDesc(HGUInt entryName, const HGChar* excepDesc);
HGResult DownloadEntryImage(HGUInt entryName, const HGChar *ftpHost, HGUShort ftpPort, const HGChar* fileName);
+ HGResult CheckEntryImage(HGUInt entryName);
HGResult UploadEntryImage(HGUInt entryName, const HGChar* ftpHost, HGUShort ftpPort, const HGChar *fileName);
private: