TSI_Config/mainwindow.h

87 lines
2.0 KiB
C
Raw Normal View History

2024-12-17 18:53:41 +08:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QMap>
#include <QButtonGroup>
#include <QPushButton>
2025-03-13 15:10:35 +08:00
#include <QTcpSocket>
#include "MyTcpClient.h"
2025-02-11 19:54:22 +08:00
#include "data_config.h"
2025-03-13 15:10:35 +08:00
#include <QProgressBar>
2024-12-17 18:53:41 +08:00
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
2025-03-04 16:00:19 +08:00
2024-12-17 18:53:41 +08:00
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
Ui::MainWindow *ui;
QAction * action_menu_monitors;
QAction * action_menu_keyphasor;
QAction * action_menu_relays;
QAction * action_menu_reset;
//声明菜单
QMenu * button_menu;
2025-02-11 19:54:22 +08:00
QMap<int,SlotConfig> map_slot_config;
2025-03-11 16:42:00 +08:00
QList<QLabel*> list_label;
QButtonGroup * btnGroup_slot = nullptr;
2025-03-20 14:38:14 +08:00
MyTcpClient* m_tcpClient;
2025-03-04 16:00:19 +08:00
2025-03-13 15:10:35 +08:00
int slot_no = 0;
QTcpSocket *socket;
QProgressBar *progressBar;
CardType card_type;
2025-04-21 20:57:37 +08:00
int current_slot;
2025-05-06 10:17:16 +08:00
QString tsi_config_file;
2025-03-03 21:57:15 +08:00
void createMenu();
void createMenu(const QString& rootTitle, QPushButton* button = nullptr);
void createMenuSet(const QString& rootTitle, QPushButton* button = nullptr);
void clearMenuProperties(QMenu* menu);
2025-02-11 19:54:22 +08:00
void readJsonFile(const QString &filePath);
2025-03-01 13:40:11 +08:00
void sendUpgradePackage(int slot);
2025-03-03 21:57:15 +08:00
void getVersion(int slot);
2025-03-11 16:42:00 +08:00
void initStyle();
2025-03-13 15:10:35 +08:00
void connectServer();
2025-05-06 10:17:16 +08:00
private slots:
2025-03-13 15:10:35 +08:00
void onDisConnected();
2025-03-20 14:38:14 +08:00
void onConnected();
2025-03-13 15:10:35 +08:00
void readData(const QByteArray&);
2025-05-06 10:17:16 +08:00
void onerrorOccurred(const QString &errorMsg);
2025-03-04 16:00:19 +08:00
void onMenuAction_relay();
2025-02-11 19:54:22 +08:00
void OnButtonGroup(QAbstractButton *);
2025-04-17 14:06:21 +08:00
void onConnect();
void onDisconnect();
2025-04-22 20:55:40 +08:00
void onEthConfig();
void onMACConfig();
void onMenuActionTriggered();
void on_pushButton_slot_clicked();
void on_pushButton_chan_clicked();
void on_pushButton_alarm_clicked();
void on_pushButton_point_name_clicked();
2025-02-11 19:54:22 +08:00
void on_pushButton_save_clicked();
2025-02-18 10:55:51 +08:00
void on_pushButton_open_clicked();
2025-04-11 20:27:45 +08:00
void on_pushButton_download_clicked();
2025-05-06 10:17:16 +08:00
void on_pushButton_upload_clicked();
2024-12-17 18:53:41 +08:00
};
#endif // MAINWINDOW_H