调整设备到达延时操作
This commit is contained in:
parent
1b2db2a7c3
commit
29da442fcf
|
@ -62,6 +62,7 @@ SOURCES += \
|
|||
dialog_accountmanage.cpp \
|
||||
dialog_changepwd.cpp \
|
||||
dialog_excepdesc.cpp \
|
||||
dialog_hgmessagebox.cpp \
|
||||
dialog_inputserialnum.cpp \
|
||||
dialog_login.cpp \
|
||||
dialog_rootfuntion.cpp \
|
||||
|
@ -84,6 +85,7 @@ HEADERS += \
|
|||
dialog_accountmanage.h \
|
||||
dialog_changepwd.h \
|
||||
dialog_excepdesc.h \
|
||||
dialog_hgmessagebox.h \
|
||||
dialog_inputserialnum.h \
|
||||
dialog_login.h \
|
||||
dialog_rootfuntion.h \
|
||||
|
@ -101,6 +103,7 @@ FORMS += \
|
|||
dialog_accountmanage.ui \
|
||||
dialog_changepwd.ui \
|
||||
dialog_excepdesc.ui \
|
||||
dialog_hgmessagebox.ui \
|
||||
dialog_inputserialnum.ui \
|
||||
dialog_login.ui \
|
||||
dialog_rootfuntion.ui \
|
||||
|
|
Binary file not shown.
|
@ -29,6 +29,29 @@
|
|||
<translation>请输入异常说明: </translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Dialog_HGMessageBox</name>
|
||||
<message>
|
||||
<location filename="dialog_hgmessagebox.ui" line="14"/>
|
||||
<source>Dialog</source>
|
||||
<translation>警告</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="dialog_hgmessagebox.ui" line="48"/>
|
||||
<source>TextLabel</source>
|
||||
<translation>警告</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="dialog_hgmessagebox.ui" line="104"/>
|
||||
<source>OK</source>
|
||||
<translation>确定</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="dialog_hgmessagebox.ui" line="117"/>
|
||||
<source>Cancel</source>
|
||||
<translation>取消</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Dialog_InputSerialNum</name>
|
||||
<message>
|
||||
|
@ -939,7 +962,7 @@
|
|||
<translation>刷新设备列表</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="495"/>
|
||||
<location filename="mainwindow.cpp" line="497"/>
|
||||
<source>Account login elsewhere</source>
|
||||
<translation>账户在其他地方登录</translation>
|
||||
</message>
|
||||
|
@ -948,63 +971,62 @@
|
|||
<translation type="vanished">网络连接断开</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="498"/>
|
||||
<location filename="mainwindow.cpp" line="500"/>
|
||||
<source>You have been forced offline by the administrator account</source>
|
||||
<translation>你已被管理员账户强制下线</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="501"/>
|
||||
<location filename="mainwindow.cpp" line="503"/>
|
||||
<source>Data base error</source>
|
||||
<translation>数据库错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="309"/>
|
||||
<location filename="mainwindow.cpp" line="441"/>
|
||||
<location filename="mainwindow.cpp" line="455"/>
|
||||
<location filename="mainwindow.cpp" line="511"/>
|
||||
<location filename="mainwindow.cpp" line="530"/>
|
||||
<location filename="mainwindow.cpp" line="557"/>
|
||||
<location filename="mainwindow.cpp" line="561"/>
|
||||
<location filename="mainwindow.cpp" line="570"/>
|
||||
<location filename="mainwindow.cpp" line="582"/>
|
||||
<location filename="mainwindow.cpp" line="642"/>
|
||||
<location filename="mainwindow.cpp" line="310"/>
|
||||
<location filename="mainwindow.cpp" line="433"/>
|
||||
<location filename="mainwindow.cpp" line="451"/>
|
||||
<location filename="mainwindow.cpp" line="513"/>
|
||||
<location filename="mainwindow.cpp" line="532"/>
|
||||
<location filename="mainwindow.cpp" line="559"/>
|
||||
<location filename="mainwindow.cpp" line="563"/>
|
||||
<location filename="mainwindow.cpp" line="572"/>
|
||||
<location filename="mainwindow.cpp" line="584"/>
|
||||
<location filename="mainwindow.cpp" line="644"/>
|
||||
<source>tips</source>
|
||||
<translation>提示</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="43"/>
|
||||
<location filename="mainwindow.cpp" line="44"/>
|
||||
<source>production tool-burn station</source>
|
||||
<translation>华高生产工具-烧录工位</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="89"/>
|
||||
<location filename="mainwindow.cpp" line="90"/>
|
||||
<source>production tool-init test station</source>
|
||||
<translation>华高生产工具-初检工位</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="91"/>
|
||||
<location filename="mainwindow.cpp" line="92"/>
|
||||
<source>production tool-image test station</source>
|
||||
<translation>华高生产工具-图像测试工位</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="93"/>
|
||||
<location filename="mainwindow.cpp" line="94"/>
|
||||
<source>production tool-pressure test station</source>
|
||||
<translation>华高生产工具-压力测试工位</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="309"/>
|
||||
<location filename="mainwindow.cpp" line="570"/>
|
||||
<location filename="mainwindow.cpp" line="582"/>
|
||||
<location filename="mainwindow.cpp" line="310"/>
|
||||
<location filename="mainwindow.cpp" line="572"/>
|
||||
<location filename="mainwindow.cpp" line="584"/>
|
||||
<source>Is testing, do not close!</source>
|
||||
<translation>测试中,请勿关闭!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="419"/>
|
||||
<source>warning</source>
|
||||
<translation>警告</translation>
|
||||
<translation type="vanished">警告</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="420"/>
|
||||
<location filename="mainwindow.cpp" line="421"/>
|
||||
<source>Confirm whether the device is reset</source>
|
||||
<oldsource>Are you sure to connect the new device</oldsource>
|
||||
<translation>检测到设备,请先确认是否已经复位,否则有可能导致获取序列号失败!</translation>
|
||||
|
@ -1014,14 +1036,13 @@
|
|||
<translation type="vanished">确定</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="423"/>
|
||||
<source>no</source>
|
||||
<translation>取消</translation>
|
||||
<translation type="vanished">取消</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="441"/>
|
||||
<location filename="mainwindow.cpp" line="530"/>
|
||||
<location filename="mainwindow.cpp" line="642"/>
|
||||
<location filename="mainwindow.cpp" line="451"/>
|
||||
<location filename="mainwindow.cpp" line="532"/>
|
||||
<location filename="mainwindow.cpp" line="644"/>
|
||||
<source>cannot create more table</source>
|
||||
<translation>不能创建更多项目</translation>
|
||||
</message>
|
||||
|
@ -1030,57 +1051,56 @@
|
|||
<translation type="vanished">设备已断开连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="422"/>
|
||||
<source>confirm</source>
|
||||
<translation>已复位</translation>
|
||||
<translation type="vanished">已复位</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="455"/>
|
||||
<location filename="mainwindow.cpp" line="433"/>
|
||||
<source>Open device failed</source>
|
||||
<translation>打开设备失败</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="552"/>
|
||||
<location filename="mainwindow.cpp" line="554"/>
|
||||
<source>save</source>
|
||||
<translation>保存</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="552"/>
|
||||
<location filename="mainwindow.cpp" line="554"/>
|
||||
<source>xls(*.xls)</source>
|
||||
<translation>xls表格(*.xls)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="557"/>
|
||||
<location filename="mainwindow.cpp" line="559"/>
|
||||
<source>export succeed</source>
|
||||
<translation>导出成功</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="561"/>
|
||||
<location filename="mainwindow.cpp" line="563"/>
|
||||
<source>export failed</source>
|
||||
<translation>导出失败</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="594"/>
|
||||
<location filename="mainwindow.cpp" line="596"/>
|
||||
<source>Illegal user</source>
|
||||
<translation>非法的用户</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="598"/>
|
||||
<location filename="mainwindow.cpp" line="600"/>
|
||||
<source>Wrong password</source>
|
||||
<translation>密码错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="602"/>
|
||||
<location filename="mainwindow.cpp" line="604"/>
|
||||
<source>Database error</source>
|
||||
<translation>数据库错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="606"/>
|
||||
<location filename="mainwindow.cpp" line="608"/>
|
||||
<source>connect error</source>
|
||||
<translation>连接错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.cpp" line="610"/>
|
||||
<location filename="mainwindow.cpp" line="612"/>
|
||||
<source>Failed</source>
|
||||
<translation>错误</translation>
|
||||
</message>
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
#include "dialog_hgmessagebox.h"
|
||||
#include "ui_dialog_hgmessagebox.h"
|
||||
|
||||
Dialog_HGMessageBox::Dialog_HGMessageBox(const QString &text, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::Dialog_HGMessageBox)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
|
||||
|
||||
QFont ft;
|
||||
ft.setPointSize(15);
|
||||
ft.setBold(true);
|
||||
ui->label->setFont(ft);
|
||||
|
||||
ui->label->setText(text);
|
||||
ui->label->setStyleSheet("color:red;");
|
||||
}
|
||||
|
||||
Dialog_HGMessageBox::~Dialog_HGMessageBox()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void Dialog_HGMessageBox::on_pbtn_ok_clicked()
|
||||
{
|
||||
accept();
|
||||
}
|
||||
|
||||
void Dialog_HGMessageBox::on_pbtn_cancel_clicked()
|
||||
{
|
||||
reject();
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#ifndef DIALOG_HGMESSAGEBOX_H
|
||||
#define DIALOG_HGMESSAGEBOX_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class Dialog_HGMessageBox;
|
||||
}
|
||||
|
||||
class Dialog_HGMessageBox : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Dialog_HGMessageBox(const QString &text, QWidget *parent = nullptr);
|
||||
~Dialog_HGMessageBox();
|
||||
|
||||
private slots:
|
||||
void on_pbtn_ok_clicked();
|
||||
|
||||
void on_pbtn_cancel_clicked();
|
||||
|
||||
private:
|
||||
Ui::Dialog_HGMessageBox *ui;
|
||||
};
|
||||
|
||||
#endif // DIALOG_HGMESSAGEBOX_H
|
|
@ -0,0 +1,127 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog_HGMessageBox</class>
|
||||
<widget class="QDialog" name="Dialog_HGMessageBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>462</width>
|
||||
<height>168</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>52</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<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>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>51</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbtn_ok">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OK</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pbtn_cancel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -9,6 +9,7 @@
|
|||
#include "dialog_accountmanage.h"
|
||||
#include "dialog_uploadcfgfile.h"
|
||||
#include "dialog_inputserialnum.h"
|
||||
#include "dialog_hgmessagebox.h"
|
||||
|
||||
MainWindow::MainWindow(HGPdtToolDbUserMgr pdtToolDbuserMgr, Dialog_logIn::LogInType loginType, const QString &ftpHost, unsigned short ftpPort, QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
|
@ -319,7 +320,6 @@ int MainWindow::sane_ex_callback(SANE_Handle hdev, int code, void *data, unsigne
|
|||
{
|
||||
SANE_Device_Ex* sane_dev = (SANE_Device_Ex*)data;
|
||||
|
||||
Sleep(5000);
|
||||
emit p->sane_dev_arrive(sane_dev->name);
|
||||
}
|
||||
else if (SANE_EVENT_DEVICE_LEFT == code)
|
||||
|
@ -406,6 +406,14 @@ QString MainWindow::getDevFwNum(SANE_Handle handle)
|
|||
|
||||
void MainWindow::on_sane_dev_arrive(QString devName)
|
||||
{
|
||||
ui->act_refreshDevice->setEnabled(false);
|
||||
QTime curTimer = QTime::currentTime().addMSecs(5000);
|
||||
while (QTime::currentTime() < curTimer)
|
||||
{
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
|
||||
}
|
||||
ui->act_refreshDevice->setEnabled(true);
|
||||
|
||||
if (m_loginType == Dialog_logIn::LogInType_Burn)
|
||||
{
|
||||
SANE_Handle devHandle = nullptr;
|
||||
|
@ -415,48 +423,48 @@ void MainWindow::on_sane_dev_arrive(QString devName)
|
|||
DeviceManager *devManager = new DeviceManager(this, m_formBurnMode, devHandle, devName);
|
||||
m_formBurnMode->addDevice(devManager);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
QString str = tr("Confirm whether the device is reset");
|
||||
Dialog_HGMessageBox dlg(str, this);
|
||||
if (!dlg.exec())
|
||||
{
|
||||
QMessageBox msg(QMessageBox::Warning, tr("warning"),
|
||||
tr("Confirm whether the device is reset"),
|
||||
QMessageBox::Yes | QMessageBox::No, this);
|
||||
msg.setButtonText(QMessageBox::Yes, tr("confirm"));
|
||||
msg.setButtonText(QMessageBox::No, tr("no"));
|
||||
msg.exec();
|
||||
if (msg.clickedButton() == msg.button(QMessageBox::Yes))
|
||||
{
|
||||
SANE_Handle devHandle = nullptr;
|
||||
sane_open(devName.toStdString().c_str(), &devHandle);
|
||||
if (nullptr != devHandle)
|
||||
{
|
||||
m_inputSnDlg = new Dialog_InputSerialNum(this, devName, m_pdtToolDbuserMgr, devHandle, getDevSn(devHandle), getDevType(devHandle));
|
||||
if (m_inputSnDlg->exec())
|
||||
{
|
||||
HGPdtToolDbDevice pdtToolDbDevice = nullptr;
|
||||
HGPdtToolDb_OpenDevice(m_pdtToolDbuserMgr, m_inputSnDlg->GetSn().toStdString().c_str(), &pdtToolDbDevice);
|
||||
return;
|
||||
}
|
||||
|
||||
Form_mainInterface *mainInterface = new Form_mainInterface(this, m_loginType, devHandle, m_pdtToolDbuserMgr, pdtToolDbDevice,
|
||||
m_inputSnDlg->GetSn(), m_inputSnDlg->GetDevType(), devName, getDevFwNum(devHandle));
|
||||
if (!AddInterface(mainInterface))
|
||||
{
|
||||
QMessageBox::information(this, tr("tips"), tr("cannot create more table"));
|
||||
delete mainInterface;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sane_close(devHandle);
|
||||
}
|
||||
SANE_Handle devHandle = nullptr;
|
||||
sane_open(devName.toStdString().c_str(), &devHandle);
|
||||
|
||||
delete m_inputSnDlg;
|
||||
m_inputSnDlg = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information(this, tr("tips"), tr("Open device failed"));
|
||||
}
|
||||
}
|
||||
if (nullptr == devHandle)
|
||||
{
|
||||
QMessageBox::information(this, tr("tips"), tr("Open device failed"));
|
||||
return;
|
||||
}
|
||||
|
||||
m_inputSnDlg = new Dialog_InputSerialNum(this, devName, m_pdtToolDbuserMgr, devHandle, getDevSn(devHandle), getDevType(devHandle));
|
||||
if (!m_inputSnDlg->exec())
|
||||
{
|
||||
sane_close(devHandle);
|
||||
return ;
|
||||
}
|
||||
|
||||
HGPdtToolDbDevice pdtToolDbDevice = nullptr;
|
||||
HGPdtToolDb_OpenDevice(m_pdtToolDbuserMgr, m_inputSnDlg->GetSn().toStdString().c_str(), &pdtToolDbDevice);
|
||||
|
||||
Form_mainInterface *mainInterface = new Form_mainInterface(this, m_loginType, devHandle, m_pdtToolDbuserMgr, pdtToolDbDevice,
|
||||
m_inputSnDlg->GetSn(), m_inputSnDlg->GetDevType(), devName, getDevFwNum(devHandle));
|
||||
if (!AddInterface(mainInterface))
|
||||
{
|
||||
QMessageBox::information(this, tr("tips"), tr("cannot create more table"));
|
||||
delete mainInterface;
|
||||
}
|
||||
|
||||
if (m_inputSnDlg != nullptr)
|
||||
{
|
||||
delete m_inputSnDlg;
|
||||
m_inputSnDlg = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue