qt/LedOK/devicepanel.h

63 lines
1.6 KiB
C
Raw Normal View History

2022-08-25 18:37:24 +08:00
#ifndef DEVICEPANEL_H
#define DEVICEPANEL_H
#include "deviceitem.h"
#include <QFile>
#include <QBoxLayout>
#include <QPainter>
#include <QStyledItemDelegate>
2022-09-28 18:21:57 +08:00
#include <QUdpSocket>
2022-08-25 18:37:24 +08:00
#include <QTreeWidgetItem>
#include <QCheckBox>
#include <QComboBox>
2022-09-28 18:21:57 +08:00
#include <QTextEdit>
2022-09-30 18:08:39 +08:00
#include <QSettings>
2022-08-25 18:37:24 +08:00
class DeviceCtrlPanel;
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();
QLabel *fdCardNumInfo;
LoQTreeWidget *mDeviceTable;
2022-09-28 18:21:57 +08:00
QUdpSocket mUdpSocket;
QTimer mUdpTimer;
QDialog *specifyIPDlg{0};
QTextEdit *fdIP{0};
void addLedCard(LedCard *);
void clearUdpHeartbeat(LedCard *);
void parseInfo(const QJsonObject &subObj,const QString &strIp);
void RestoreLedCardIpByUdpCmd();
QList<LedCard *> LedCardList;
2022-08-25 18:37:24 +08:00
protected:
void changeEvent(QEvent *) override;
void transUi();
public slots:
void ShowDevicesInfoOrControlWidget(int index);
protected slots:
void onCheckStateChanged(int f);
void FilterProgram(const QString &strtemp);
void OnControlSendJson(QJsonObject &json,QString strFanYi);
void OnControlTcpSend(int iProgramIndex);
void OnOutputInfo(QString);
signals:
void sigSelectedDeviceList(QList<LedCard *> *);
private:
QLabel *label_3, *nDeviceNum;
QComboBox *bnSpecifyIP;
2022-09-28 18:21:57 +08:00
QPushButton *btnRefresh;
2022-08-25 18:37:24 +08:00
QTreeWidgetItem *m_headerItem;
QHBoxLayout *mHBox{0};
DeviceCtrlPanel *mDeviceCtrlPanel{0};
int m_intIndexFlagOfInfoOrControl{0};
int GetSelectDeviceNum();
QList<LedCard*> mSelCards;
};
#endif // DEVICEPANEL_H