88 lines
2.1 KiB
C++
88 lines
2.1 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
#include <QMainWindow>
|
|
#include "form_maininterface.h"
|
|
#include "form_texttips.h"
|
|
#include <QtWidgets>
|
|
#include <QSplitter>
|
|
#include "HGPdtToolDb.h"
|
|
#include "sane/sane_ex.h"
|
|
#include "base/HGLock.h"
|
|
#include "hgscanner.h"
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui { class MainWindow; }
|
|
QT_END_NAMESPACE
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MainWindow(HGPdtToolDbUserMgr pdtToolDbuserMgr, const QString &ftpHost, unsigned short ftpPort, QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
static QString getLogInfo(HGResult ret);
|
|
bool isExitApp();
|
|
|
|
void updateSplitter();
|
|
Form_mainInterface* FindInterface(const QString &sn);
|
|
Form_mainInterface* FindInterfaceByDevName(const QString &devName);
|
|
Form_mainInterface* FindInterface(SANE_Handle handle);
|
|
bool AddInterface(Form_mainInterface *interface);
|
|
bool RemoveInterface(Form_mainInterface *interface);
|
|
void addTestingRef();
|
|
void releaseTesting();
|
|
bool isTesting();
|
|
|
|
protected:
|
|
void closeEvent(QCloseEvent *event);
|
|
private:
|
|
static int sane_ex_callback(SANE_Handle hdev, int code, void* data, unsigned int* len, void* param);
|
|
|
|
std::vector<std::string> getDevices();
|
|
QString getDevSn(SANE_Handle handle);
|
|
QString getDevType(SANE_Handle handle);
|
|
QString getDevFwNum(SANE_Handle handle);
|
|
|
|
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);
|
|
void on_update_userStatus();
|
|
|
|
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();
|
|
|
|
void on_act_upload_triggered();
|
|
|
|
private:
|
|
QSplitter *m_top_splitter;
|
|
QSplitter *m_bot_splitter;
|
|
|
|
bool m_isLogOut;
|
|
|
|
private:
|
|
Ui::MainWindow *ui;
|
|
HGPdtToolDbUserMgr m_pdtToolDbuserMgr;
|
|
HGLock m_lock;
|
|
int m_testingRef;
|
|
|
|
public:
|
|
QString m_ftpHost;
|
|
unsigned short m_ftpPort;
|
|
};
|
|
#endif // MAINWINDOW_H
|