code_production/app/HGProductionTool/form_burnmode.h

124 lines
2.5 KiB
C
Raw Normal View History

2023-01-04 06:28:44 +00:00
#ifndef FORM_BURNMODE_H
#define FORM_BURNMODE_H
#include <QWidget>
2023-01-04 09:27:24 +00:00
#include <QTableWidgetItem>
2023-01-04 06:28:44 +00:00
#include "sane/sane_ex.h"
#include "hgscanner.h"
2023-08-31 02:50:43 +00:00
//#include "HGPdtToolDb.h"
2023-01-04 06:28:44 +00:00
namespace Ui {
class Form_BurnMode;
}
class DeviceManager
{
public:
2023-09-01 10:42:28 +00:00
DeviceManager(class MainWindow *mainwnd, class Form_BurnMode *burnMode, SANE_Handle handle,
const QString &profileName, const QString &devName, const QString &serialNum);
2023-01-04 06:28:44 +00:00
~DeviceManager();
QString getDevName();
2023-09-01 10:42:28 +00:00
QString getSerialNum();
2023-01-04 06:28:44 +00:00
void setBurnMode();
2023-09-01 10:42:28 +00:00
void setSpeedMode();
void setSleepTime();
void setVidPid();
void rebootDevice();
QString getDevType();
int getSpeedMode();
int getSleepTime();
int getDevVid();
int getDevPid();
2023-01-04 06:28:44 +00:00
SANE_Handle m_handle;
private:
2023-01-04 12:48:53 +00:00
union VIDPID
{
struct
{
unsigned short VID;
unsigned short PID;
};
unsigned int Value;
};
2023-01-04 06:28:44 +00:00
2023-01-04 12:48:53 +00:00
private:
2023-01-04 06:28:44 +00:00
class MainWindow *m_mainwnd;
class Form_BurnMode *m_burnMode;
2023-01-04 12:48:53 +00:00
QString m_devName;
2023-09-01 10:42:28 +00:00
QString m_serialNum;
QString m_profileName;
2023-01-04 06:28:44 +00:00
hgscanner *m_hg;
};
class Form_BurnMode : public QWidget
{
Q_OBJECT
public:
2023-09-01 10:42:28 +00:00
explicit Form_BurnMode(class MainWindow *mainwnd, const QString &profileName, const QString &accountName, QWidget *parent = nullptr);
2023-01-04 06:28:44 +00:00
~Form_BurnMode();
void addDevice(DeviceManager *devManager);
void deleteDevice(QString devName);
2023-09-01 10:42:28 +00:00
DeviceManager *getDevManager();
private:
union VIDPID
{
struct
{
unsigned short VID;
unsigned short PID;
};
unsigned int Value;
};
2023-01-04 06:28:44 +00:00
signals:
2023-01-04 14:24:41 +00:00
void testResult(bool setStatus);
2023-01-04 06:28:44 +00:00
private slots:
2023-01-04 14:24:41 +00:00
void on_testResult(bool setStatus);
2023-01-04 06:28:44 +00:00
private slots:
2023-09-01 10:42:28 +00:00
//void on_cbox_selectAll_stateChanged(int arg1);
2023-01-04 06:28:44 +00:00
2023-09-01 10:42:28 +00:00
void on_pbtn_enterBurnMode_clicked();
2023-01-04 06:28:44 +00:00
2023-01-04 09:27:24 +00:00
void on_tableWidget_itemDoubleClicked(QTableWidgetItem *item);
2023-09-01 10:42:28 +00:00
//void on_pbtn_close_clicked();
void on_pbtn_confirmFinishBurn_clicked();
void on_pbtn_checkConfig_clicked();
void on_pbtn_complete_clicked();
void on_pbtn_abnormal_clicked();
2023-01-05 07:18:55 +00:00
2023-01-04 06:28:44 +00:00
private:
void initTableWidget();
2023-01-05 07:18:55 +00:00
void updatetablewidget();
2023-09-01 10:42:28 +00:00
void updateTargetCfg();
void updateCurDeviceCfg();
QString getLogPath();
void writeTestLog(QString logContent);
2023-01-04 06:28:44 +00:00
private:
Ui::Form_BurnMode *ui;
class MainWindow *m_mainwnd;
2023-09-01 10:42:28 +00:00
hgscanner *m_hg;
2023-01-04 06:28:44 +00:00
int m_curIndex;
2023-09-01 10:42:28 +00:00
QString m_profileName;
QString m_accountName;
2023-01-04 06:28:44 +00:00
};
#endif // FORM_BURNMODE_H