SkyPulse UAV V0.1
Loading...
Searching...
No Matches
mainwindow.h
Go to the documentation of this file.
1#ifndef MAINWINDOW_H
2#define MAINWINDOW_H
3
4#include <QMainWindow>
5#include <QThread>
6#include <QDebug>
7#include <QNetworkInterface>
8#include <QCloseEvent>
9
10#include "TCP.h"
11#include "UDP.h"
12#include "Mahony_Plot.h"
13#include "MediatorInterface.h"
14
15QT_BEGIN_NAMESPACE
16namespace Ui {
17class MainWindow;
18}
19QT_END_NAMESPACE
20
21class MainWindow : public QMainWindow
22{
23 Q_OBJECT
24
25public:
26 MainWindow(QWidget *parent = nullptr);
28
29public slots:
30 void updateUI(const QString &message);
31 void displayReceivedMessage(const QString &message);
32
33private:
34 Ui::MainWindow *ui;
35
36 /*Network Protocol*/
37 TCP *TCPServer;
38 UDP *UDPServer;
39
40 /*Ploting*/
41 Mahony_Plot *MahonyPlotObject;
42
43 MediatorInterface* mediator; // 中介者成员变量
44
46 void initialBluetoothServer();
47
48 QString getLocalIP();
49
50private slots:
51 void on_pushButton_Network_Connect_clicked();
52 void on_pushButton_Network_Disconnect_clicked();
53 void on_pushButton_Mahony_Plot_Launch_clicked();
54
55 void onTCPConnectionSuccessful();
56 void onTCPDisconnectionSuccessful();
57 void onTCPConnectionError();
58
59 void onUDPServerStartSuccessful();
60 void onUDPServerStopSuccessful();
61
62 void on_pushButton_Mahony_Plot_Stop_clicked();
63
64 void on_horizontalSlider_P12PWM0_valueChanged(int duty_cycle);
65 void on_horizontalSlider_P13PWM1_valueChanged(int duty_cycle);
66 void on_horizontalSlider_P19PWM2_valueChanged(int duty_cycle);
67 void on_horizontalSlider_P18PWM3_valueChanged(int duty_cycle);
68
69 void on_toolButton_REG_READ_ALL_clicked();
70
71protected:
72 void closeEvent(QCloseEvent *event) override; // Rewrite the close event
73
74signals:
75 void sig_StartTCPServer(const QString &IPAddr, const quint16 &Port);
77 void sig_StartUDPServer(const quint16 &port);
81 void sig_sendMessageToTCP(const uint8_t &action, const uint8_t &data_length, const uint8_t &value);
82
83};
84#endif // MAINWINDOW_H
Definition Mahony_Plot.h:10
Definition mainwindow.h:37
void closeEvent(QCloseEvent *event) override
void sig_StopTCPServer()
void sig_StartUDPServer(const quint16 &port)
void sig_Mahony_PlottingStop()
void sig_StopUDPServer()
void displayReceivedMessage(const QString &message)
Definition mainwindow.cpp:56
MainWindow(QWidget *parent=nullptr)
void sig_StartTCPServer(const QString &IPAddr, const quint16 &Port)
void sig_Mahony_PlottingStart()
void sig_sendMessageToTCP(const uint8_t &action, const uint8_t &data_length, const uint8_t &value)
void updateUI(const QString &message)
Definition mainwindow.cpp:176
Definition MediatorInterface.h:6
TCP Server Class.
Definition TCP.h:14
Definition UDP.h:9
Definition mainwindow.h:33