This commit is contained in:
13038267101 2022-12-28 21:04:19 +08:00
commit a462703a9d
14 changed files with 242 additions and 123 deletions

View File

@ -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
}
}
}

View File

@ -24,7 +24,7 @@
<translation></translation>
</message>
<message>
<location filename="dialog_excepdesc.cpp" line="9"/>
<location filename="dialog_excepdesc.cpp" line="14"/>
<source>input excep desc: </source>
<translation> </translation>
</message>
@ -85,18 +85,18 @@
<translation></translation>
</message>
<message>
<location filename="dialog_inputserialnum.cpp" line="47"/>
<location filename="dialog_inputserialnum.cpp" line="53"/>
<location filename="dialog_inputserialnum.cpp" line="51"/>
<location filename="dialog_inputserialnum.cpp" line="57"/>
<source>tips</source>
<translation></translation>
</message>
<message>
<location filename="dialog_inputserialnum.cpp" line="47"/>
<location filename="dialog_inputserialnum.cpp" line="51"/>
<source>Serial num is empty</source>
<translation></translation>
</message>
<message>
<location filename="dialog_inputserialnum.cpp" line="53"/>
<location filename="dialog_inputserialnum.cpp" line="57"/>
<source>The device is testing</source>
<translation></translation>
</message>
@ -114,25 +114,35 @@
<translation></translation>
</message>
<message>
<location filename="dialog_userinput.ui" line="46"/>
<location filename="dialog_userinput.ui" line="54"/>
<source>YES</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="dialog_userinput.ui" line="53"/>
<location filename="dialog_userinput.ui" line="67"/>
<source>NO</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="dialog_userinput.ui" line="80"/>
<location filename="dialog_userinput.ui" line="133"/>
<source>OK</source>
<translation></translation>
</message>
<message>
<location filename="dialog_userinput.ui" line="87"/>
<location filename="dialog_userinput.ui" line="140"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="dialog_userinput.cpp" line="73"/>
<source>tips</source>
<translation></translation>
</message>
<message>
<location filename="dialog_userinput.cpp" line="73"/>
<source>please input valid contents</source>
<translation></translation>
</message>
</context>
<context>
<name>Dialog_accountManage</name>
@ -162,50 +172,50 @@
<translation></translation>
</message>
<message>
<location filename="dialog_accountmanage.cpp" line="48"/>
<location filename="dialog_accountmanage.cpp" line="72"/>
<location filename="dialog_accountmanage.cpp" line="90"/>
<location filename="dialog_accountmanage.cpp" line="52"/>
<location filename="dialog_accountmanage.cpp" line="76"/>
<location filename="dialog_accountmanage.cpp" line="94"/>
<location filename="dialog_accountmanage.cpp" line="98"/>
<source>tips</source>
<translation></translation>
</message>
<message>
<location filename="dialog_accountmanage.cpp" line="48"/>
<location filename="dialog_accountmanage.cpp" line="52"/>
<source>create user failed: </source>
<translation> </translation>
</message>
<message>
<location filename="dialog_accountmanage.cpp" line="57"/>
<location filename="dialog_accountmanage.cpp" line="61"/>
<source>Question</source>
<translation></translation>
</message>
<message>
<location filename="dialog_accountmanage.cpp" line="58"/>
<location filename="dialog_accountmanage.cpp" line="62"/>
<source>Are you sure to destroy: </source>
<translation> </translation>
</message>
<message>
<location filename="dialog_accountmanage.cpp" line="60"/>
<location filename="dialog_accountmanage.cpp" line="64"/>
<source>yes</source>
<translation></translation>
</message>
<message>
<location filename="dialog_accountmanage.cpp" line="61"/>
<location filename="dialog_accountmanage.cpp" line="65"/>
<source>no</source>
<translation></translation>
</message>
<message>
<location filename="dialog_accountmanage.cpp" line="72"/>
<location filename="dialog_accountmanage.cpp" line="76"/>
<source>destroy user failed: </source>
<translation> </translation>
</message>
<message>
<location filename="dialog_accountmanage.cpp" line="90"/>
<location filename="dialog_accountmanage.cpp" line="94"/>
<source>change password succeed</source>
<translation></translation>
</message>
<message>
<location filename="dialog_accountmanage.cpp" line="94"/>
<location filename="dialog_accountmanage.cpp" line="98"/>
<source>change password failed: </source>
<translation> </translation>
</message>
@ -218,17 +228,17 @@
<translation></translation>
</message>
<message>
<location filename="dialog_changepwd.ui" line="58"/>
<location filename="dialog_changepwd.ui" line="93"/>
<source>old password:</source>
<translation></translation>
</message>
<message>
<location filename="dialog_changepwd.ui" line="96"/>
<location filename="dialog_changepwd.ui" line="131"/>
<source>new password:</source>
<translation></translation>
</message>
<message>
<location filename="dialog_changepwd.ui" line="134"/>
<location filename="dialog_changepwd.ui" line="77"/>
<source>cfm password:</source>
<translation></translation>
</message>
@ -247,18 +257,18 @@
<translation></translation>
</message>
<message>
<location filename="dialog_changepwd.cpp" line="33"/>
<location filename="dialog_changepwd.cpp" line="40"/>
<location filename="dialog_changepwd.cpp" line="37"/>
<location filename="dialog_changepwd.cpp" line="44"/>
<source>tips</source>
<translation></translation>
</message>
<message>
<location filename="dialog_changepwd.cpp" line="33"/>
<location filename="dialog_changepwd.cpp" line="37"/>
<source>The passwords entered twice are inconsistent</source>
<translation></translation>
</message>
<message>
<location filename="dialog_changepwd.cpp" line="40"/>
<location filename="dialog_changepwd.cpp" line="44"/>
<source>Change passwords failed: </source>
<translation> </translation>
</message>
@ -324,32 +334,32 @@
<translation>退</translation>
</message>
<message>
<location filename="dialog_login.cpp" line="19"/>
<location filename="dialog_login.cpp" line="23"/>
<source>Set host and port</source>
<translation>IP与端口</translation>
</message>
<message>
<location filename="dialog_login.cpp" line="20"/>
<location filename="dialog_login.cpp" line="24"/>
<source>Minimize</source>
<translation></translation>
</message>
<message>
<location filename="dialog_login.cpp" line="21"/>
<location filename="dialog_login.cpp" line="25"/>
<source>Close</source>
<translation></translation>
</message>
<message>
<location filename="dialog_login.cpp" line="23"/>
<location filename="dialog_login.cpp" line="27"/>
<source>LogIn</source>
<translation></translation>
</message>
<message>
<location filename="dialog_login.cpp" line="109"/>
<location filename="dialog_login.cpp" line="113"/>
<source>tips</source>
<translation></translation>
</message>
<message>
<location filename="dialog_login.cpp" line="109"/>
<location filename="dialog_login.cpp" line="113"/>
<source>Login failed: </source>
<translation> </translation>
</message>
@ -387,12 +397,12 @@
<translation></translation>
</message>
<message>
<location filename="dialog_rootfuntion.cpp" line="18"/>
<location filename="dialog_rootfuntion.cpp" line="22"/>
<source>Reset password</source>
<translation></translation>
</message>
<message>
<location filename="dialog_rootfuntion.cpp" line="19"/>
<location filename="dialog_rootfuntion.cpp" line="23"/>
<source>new password:</source>
<translation></translation>
</message>
@ -445,34 +455,34 @@
<translation></translation>
</message>
<message>
<location filename="dialog_uploadcfgfile.cpp" line="25"/>
<location filename="dialog_uploadcfgfile.cpp" line="29"/>
<source>Browse directory</source>
<translation></translation>
</message>
<message>
<location filename="dialog_uploadcfgfile.cpp" line="25"/>
<location filename="dialog_uploadcfgfile.cpp" line="29"/>
<source>config(*json)</source>
<translation>(*json)</translation>
</message>
<message>
<location filename="dialog_uploadcfgfile.cpp" line="37"/>
<location filename="dialog_uploadcfgfile.cpp" line="46"/>
<location filename="dialog_uploadcfgfile.cpp" line="51"/>
<location filename="dialog_uploadcfgfile.cpp" line="41"/>
<location filename="dialog_uploadcfgfile.cpp" line="50"/>
<location filename="dialog_uploadcfgfile.cpp" line="55"/>
<source>tips</source>
<translation></translation>
</message>
<message>
<location filename="dialog_uploadcfgfile.cpp" line="37"/>
<location filename="dialog_uploadcfgfile.cpp" line="41"/>
<source>empty filename</source>
<translation></translation>
</message>
<message>
<location filename="dialog_uploadcfgfile.cpp" line="46"/>
<location filename="dialog_uploadcfgfile.cpp" line="50"/>
<source>upload succeed</source>
<translation></translation>
</message>
<message>
<location filename="dialog_uploadcfgfile.cpp" line="51"/>
<location filename="dialog_uploadcfgfile.cpp" line="55"/>
<source>upload failed: </source>
<translation> </translation>
</message>
@ -535,88 +545,88 @@
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="81"/>
<location filename="form_maininterface.cpp" line="85"/>
<source>Device has connected</source>
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="83"/>
<location filename="form_maininterface.cpp" line="87"/>
<source>Device hasnot connected</source>
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="84"/>
<location filename="form_maininterface.cpp" line="88"/>
<source>Device type:</source>
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="84"/>
<location filename="form_maininterface.cpp" line="88"/>
<source> SerialNum:</source>
<translation> </translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="84"/>
<location filename="form_maininterface.cpp" line="88"/>
<source> connect status:</source>
<translation> </translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="93"/>
<location filename="form_maininterface.cpp" line="97"/>
<source>load last image which uploaded last time</source>
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="150"/>
<location filename="form_maininterface.cpp" line="494"/>
<location filename="form_maininterface.cpp" line="154"/>
<location filename="form_maininterface.cpp" line="500"/>
<source>tips</source>
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="181"/>
<location filename="form_maininterface.cpp" line="187"/>
<source>yes</source>
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="182"/>
<location filename="form_maininterface.cpp" line="188"/>
<source>no</source>
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="263"/>
<location filename="form_maininterface.cpp" line="269"/>
<source>ID</source>
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="263"/>
<location filename="form_maininterface.cpp" line="269"/>
<source>Test items</source>
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="263"/>
<location filename="form_maininterface.cpp" line="269"/>
<source>status</source>
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="411"/>
<location filename="form_maininterface.cpp" line="417"/>
<source>not test</source>
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="411"/>
<location filename="form_maininterface.cpp" line="417"/>
<source>not pass</source>
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="411"/>
<location filename="form_maininterface.cpp" line="417"/>
<source>not support</source>
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="411"/>
<location filename="form_maininterface.cpp" line="417"/>
<source>pass</source>
<translation></translation>
</message>
<message>
<location filename="form_maininterface.cpp" line="494"/>
<location filename="form_maininterface.cpp" line="500"/>
<source>no image</source>
<translation></translation>
</message>
@ -682,7 +692,7 @@
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="371"/>
<location filename="mainwindow.cpp" line="376"/>
<source>Account login elsewhere</source>
<translation></translation>
</message>
@ -691,94 +701,94 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="374"/>
<location filename="mainwindow.cpp" line="379"/>
<source>You have been forced offline by the administrator account</source>
<translation>线</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="377"/>
<location filename="mainwindow.cpp" line="382"/>
<source>Data base error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="320"/>
<location filename="mainwindow.cpp" line="341"/>
<location filename="mainwindow.cpp" line="357"/>
<location filename="mainwindow.cpp" line="385"/>
<location filename="mainwindow.cpp" line="402"/>
<location filename="mainwindow.cpp" line="427"/>
<location filename="mainwindow.cpp" line="431"/>
<location filename="mainwindow.cpp" line="325"/>
<location filename="mainwindow.cpp" line="346"/>
<location filename="mainwindow.cpp" line="362"/>
<location filename="mainwindow.cpp" line="390"/>
<location filename="mainwindow.cpp" line="407"/>
<location filename="mainwindow.cpp" line="432"/>
<location filename="mainwindow.cpp" line="436"/>
<source>tips</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="321"/>
<location filename="mainwindow.cpp" line="326"/>
<source>Are you sure to connect the new device</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="323"/>
<location filename="mainwindow.cpp" line="328"/>
<source>yes</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="324"/>
<location filename="mainwindow.cpp" line="329"/>
<source>no</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="341"/>
<location filename="mainwindow.cpp" line="402"/>
<location filename="mainwindow.cpp" line="346"/>
<location filename="mainwindow.cpp" line="407"/>
<source>cannot create more table</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="357"/>
<location filename="mainwindow.cpp" line="362"/>
<source>The device has disconnected</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="422"/>
<location filename="mainwindow.cpp" line="427"/>
<source>save</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="422"/>
<location filename="mainwindow.cpp" line="427"/>
<source>xls(*.xls)</source>
<translation>xls表格(*.xls)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="427"/>
<location filename="mainwindow.cpp" line="432"/>
<source>export succeed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="431"/>
<location filename="mainwindow.cpp" line="436"/>
<source>export failed</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="453"/>
<location filename="mainwindow.cpp" line="458"/>
<source>Illegal user</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="457"/>
<location filename="mainwindow.cpp" line="462"/>
<source>Wrong password</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="461"/>
<location filename="mainwindow.cpp" line="466"/>
<source>Database error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="465"/>
<location filename="mainwindow.cpp" line="470"/>
<source>connect error</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="469"/>
<location filename="mainwindow.cpp" line="474"/>
<source>Failed</source>
<translation></translation>
</message>
@ -787,8 +797,9 @@
<name>QObject</name>
<message>
<location filename="hgscanner.cpp" line="42"/>
<source>success</source>
<translation></translation>
<source>success: </source>
<oldsource>success</oldsource>
<translation>: </translation>
</message>
<message>
<location filename="hgscanner.cpp" line="44"/>

View File

@ -1,8 +1,9 @@
#include "dialog_userinput.h"
#include "ui_dialog_userinput.h"
#include <QRegExpValidator>
#include <QMessageBox>
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;

View File

@ -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

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>426</width>
<height>147</height>
<height>178</height>
</rect>
</property>
<property name="windowTitle">
@ -112,6 +112,33 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QComboBox" name="comboBox">
<property name="minimumSize">
<size>
<width>171</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>

View File

@ -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);
}

View File

@ -2,6 +2,7 @@
#include <QMessageBox>
#include "form_maininterface.h"
#include "dialog_userinput.h"
#include <QDebug>
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;

View File

@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>

View File

@ -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)
{

View File

@ -34,4 +34,5 @@ HGPdtToolDb_GetDeviceEntryExcepDesc
HGPdtToolDb_SetDeviceEntryStatus
HGPdtToolDb_SetDeviceEntryExcepDesc
HGPdtToolDb_DownloadDeviceEntryImage
HGPdtToolDb_CheckDeviceEntryImage
HGPdtToolDb_UploadDeviceEntryImage

View File

@ -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);

View File

@ -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)

View File

@ -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: