qt/LedOK/devicepanel.h

69 lines
1.5 KiB
C
Raw Normal View History

2022-08-25 18:37:24 +08:00
#ifndef DEVICEPANEL_H
#define DEVICEPANEL_H
2023-05-15 16:06:10 +08:00
#include "base/loqtreewidget.h"
2024-08-07 18:18:37 +08:00
#include "main.h"
2023-10-23 11:44:22 +08:00
#include "gutil/qgui.h"
2023-05-15 16:06:10 +08:00
#include <QTimer>
#include <QPushButton>
2022-09-28 18:21:57 +08:00
#include <QUdpSocket>
2022-08-25 18:37:24 +08:00
#include <QCheckBox>
#include <QComboBox>
2022-09-28 18:21:57 +08:00
#include <QTextEdit>
2023-08-01 11:42:41 +08:00
#include <QScrollArea>
2022-09-30 18:08:39 +08:00
#include <QSettings>
2022-08-25 18:37:24 +08:00
class DevicePanel : public QWidget {
Q_OBJECT
public:
2022-09-30 18:08:39 +08:00
explicit DevicePanel(QSettings &, QWidget *parent = nullptr);
2022-08-25 18:37:24 +08:00
~DevicePanel();
void sendGetInfo();
2023-08-01 11:42:41 +08:00
void newCtrl();
2023-10-23 11:44:22 +08:00
void init(DeviceItem *item);
2022-08-25 18:37:24 +08:00
QLabel *fdCardNumInfo;
LoQTreeWidget *mDeviceTable;
2022-09-28 18:21:57 +08:00
QUdpSocket mUdpSocket;
QTimer mUdpTimer;
QDialog *specifyIPDlg{0};
QTextEdit *fdIP{0};
2023-05-15 16:06:10 +08:00
int mainPanelIdx{0};
2023-08-01 11:42:41 +08:00
QWidget *mDeviceCtrlPanel{0};
2022-08-25 18:37:24 +08:00
QLabel *label_3, *nDeviceNum;
QComboBox *bnSpecifyIP;
2022-09-28 18:21:57 +08:00
QPushButton *btnRefresh;
2024-08-07 18:18:37 +08:00
QSplitter *splitter;
2023-08-01 11:42:41 +08:00
QTextEdit *fdInfo;
QButtonGroup *mBtnGrp;
QScrollArea *scrollArea;
QPushButton *btnClear;
QWidget *wgts[Setting_End]{};
int curIndex{-1};
2023-05-15 16:06:10 +08:00
protected:
void changeEvent(QEvent *) override;
void transUi();
2023-08-01 11:42:41 +08:00
void transCtrl();
2023-05-15 16:06:10 +08:00
signals:
void sigSelectedDeviceList();
2022-08-25 18:37:24 +08:00
};
2023-10-23 11:44:22 +08:00
class ImgDlg : public QDialog {
Q_OBJECT
public:
explicit ImgDlg(const QByteArray &, QWidget *parent = 0);
QImage mImg;
public:
void paintEvent(QPaintEvent *) override;
};
2023-05-19 18:50:21 +08:00
struct UDPPacket {
unsigned char SyncHead[3];
unsigned char ucCommType;
char serialCode[20];
unsigned int iLength;
};
2022-08-25 18:37:24 +08:00
#endif // DEVICEPANEL_H