qt/LedOK/devicepanel.h
2024-08-07 18:18:37 +08:00

69 lines
1.5 KiB
C++

#ifndef DEVICEPANEL_H
#define DEVICEPANEL_H
#include "base/loqtreewidget.h"
#include "main.h"
#include "gutil/qgui.h"
#include <QTimer>
#include <QPushButton>
#include <QUdpSocket>
#include <QCheckBox>
#include <QComboBox>
#include <QTextEdit>
#include <QScrollArea>
#include <QSettings>
class DevicePanel : public QWidget {
Q_OBJECT
public:
explicit DevicePanel(QSettings &, QWidget *parent = nullptr);
~DevicePanel();
void sendGetInfo();
void newCtrl();
void init(DeviceItem *item);
QLabel *fdCardNumInfo;
LoQTreeWidget *mDeviceTable;
QUdpSocket mUdpSocket;
QTimer mUdpTimer;
QDialog *specifyIPDlg{0};
QTextEdit *fdIP{0};
int mainPanelIdx{0};
QWidget *mDeviceCtrlPanel{0};
QLabel *label_3, *nDeviceNum;
QComboBox *bnSpecifyIP;
QPushButton *btnRefresh;
QSplitter *splitter;
QTextEdit *fdInfo;
QButtonGroup *mBtnGrp;
QScrollArea *scrollArea;
QPushButton *btnClear;
QWidget *wgts[Setting_End]{};
int curIndex{-1};
protected:
void changeEvent(QEvent *) override;
void transUi();
void transCtrl();
signals:
void sigSelectedDeviceList();
};
class ImgDlg : public QDialog {
Q_OBJECT
public:
explicit ImgDlg(const QByteArray &, QWidget *parent = 0);
QImage mImg;
public:
void paintEvent(QPaintEvent *) override;
};
struct UDPPacket {
unsigned char SyncHead[3];
unsigned char ucCommType;
char serialCode[20];
unsigned int iLength;
};
#endif // DEVICEPANEL_H