2022-12-14 06:39:22 +00:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include "form_texttips.h"
|
2023-01-04 06:28:44 +00:00
|
|
|
#include "form_burnmode.h"
|
|
|
|
#include "form_maininterface.h"
|
2022-12-14 06:39:22 +00:00
|
|
|
#include <QtWidgets>
|
|
|
|
#include <QSplitter>
|
|
|
|
#include "HGPdtToolDb.h"
|
2022-12-15 03:00:46 +00:00
|
|
|
#include "sane/sane_ex.h"
|
2022-12-26 10:38:34 +00:00
|
|
|
#include "base/HGLock.h"
|
2022-12-15 12:16:43 +00:00
|
|
|
#include "hgscanner.h"
|
2023-01-04 06:28:44 +00:00
|
|
|
#include "dialog_login.h"
|
2022-12-15 12:16:43 +00:00
|
|
|
|
2022-12-14 06:39:22 +00:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
namespace Ui { class MainWindow; }
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2022-12-15 06:05:53 +00:00
|
|
|
class MainWindow : public QMainWindow
|
2022-12-22 02:48:06 +00:00
|
|
|
{
|
2022-12-14 06:39:22 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2023-01-04 06:28:44 +00:00
|
|
|
MainWindow(HGPdtToolDbUserMgr pdtToolDbuserMgr, Dialog_logIn::LogInType loginType, const QString &ftpHost, unsigned short ftpPort, QWidget *parent = nullptr);
|
2022-12-14 06:39:22 +00:00
|
|
|
~MainWindow();
|
|
|
|
static QString getLogInfo(HGResult ret);
|
|
|
|
bool isExitApp();
|
2022-12-15 07:00:12 +00:00
|
|
|
|
2022-12-16 11:01:30 +00:00
|
|
|
void updateSplitter();
|
|
|
|
Form_mainInterface* FindInterface(const QString &sn);
|
2022-12-23 10:32:57 +00:00
|
|
|
Form_mainInterface* FindInterfaceByDevName(const QString &devName);
|
2022-12-26 10:38:34 +00:00
|
|
|
Form_mainInterface* FindInterface(SANE_Handle handle);
|
2023-01-04 06:28:44 +00:00
|
|
|
bool AddInterface(Form_mainInterface * mainInterface);
|
|
|
|
bool RemoveInterface(Form_mainInterface *mainInterface);
|
2022-12-30 10:30:02 +00:00
|
|
|
void addTestingRef();
|
|
|
|
void releaseTesting();
|
2022-12-29 09:54:32 +00:00
|
|
|
bool isTesting();
|
2023-01-04 12:48:53 +00:00
|
|
|
QString getDevSn(SANE_Handle handle);
|
2022-12-29 09:54:32 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void closeEvent(QCloseEvent *event);
|
2022-12-15 07:00:12 +00:00
|
|
|
private:
|
2022-12-15 03:00:46 +00:00
|
|
|
static int sane_ex_callback(SANE_Handle hdev, int code, void* data, unsigned int* len, void* param);
|
2022-12-15 07:00:12 +00:00
|
|
|
|
|
|
|
std::vector<std::string> getDevices();
|
2022-12-16 11:01:30 +00:00
|
|
|
QString getDevType(SANE_Handle handle);
|
2022-12-23 10:32:57 +00:00
|
|
|
QString getDevFwNum(SANE_Handle handle);
|
2022-12-15 07:00:12 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void sane_dev_arrive(QString devName);
|
|
|
|
void sane_dev_remove(QString devName);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_sane_dev_arrive(QString devName);
|
|
|
|
void on_sane_dev_remove(QString devName);
|
2022-12-22 02:48:06 +00:00
|
|
|
void on_update_userStatus();
|
2022-12-15 06:05:53 +00:00
|
|
|
|
2022-12-14 06:39:22 +00:00
|
|
|
private slots:
|
|
|
|
void on_act_newDevice_triggered();
|
|
|
|
|
|
|
|
void on_act_manage_triggered();
|
|
|
|
|
|
|
|
void on_act_changePwd_triggered();
|
|
|
|
|
|
|
|
void on_act_export_triggered();
|
|
|
|
|
|
|
|
void on_act_logOut_triggered();
|
|
|
|
|
|
|
|
void on_act_close_triggered();
|
|
|
|
|
2022-12-16 11:01:30 +00:00
|
|
|
void on_act_upload_triggered();
|
2022-12-14 12:28:25 +00:00
|
|
|
|
2023-01-05 11:16:17 +00:00
|
|
|
void on_act_refreshDevice_triggered();
|
|
|
|
|
2022-12-14 06:39:22 +00:00
|
|
|
private:
|
|
|
|
QSplitter *m_top_splitter;
|
|
|
|
QSplitter *m_bot_splitter;
|
|
|
|
|
|
|
|
bool m_isLogOut;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::MainWindow *ui;
|
|
|
|
HGPdtToolDbUserMgr m_pdtToolDbuserMgr;
|
2022-12-26 10:38:34 +00:00
|
|
|
HGLock m_lock;
|
2022-12-30 10:30:02 +00:00
|
|
|
int m_testingRef;
|
2023-01-04 06:28:44 +00:00
|
|
|
Dialog_logIn::LogInType m_loginType;
|
2023-01-06 05:39:49 +00:00
|
|
|
class Dialog_InputSerialNum *m_inputSnDlg;
|
2023-01-04 06:28:44 +00:00
|
|
|
|
|
|
|
Form_BurnMode *m_formBurnMode;
|
2022-12-27 08:25:47 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
QString m_ftpHost;
|
|
|
|
unsigned short m_ftpPort;
|
2022-12-14 06:39:22 +00:00
|
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|