-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.h
More file actions
51 lines (46 loc) · 1.23 KB
/
Copy pathmainwindow.h
File metadata and controls
51 lines (46 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "plane_packet.h"
#include <QMainWindow>
#include <QDebug>
#include <QDateTime>
#include "helpers.h"
#include <qlabel.h>
#include <qstyle.h>
#include <qtablewidget.h>
#include <QQuickItem>
#include "uart_mcu_comms.h"
#include "QtConcurrent"
QT_BEGIN_NAMESPACE
namespace Ui {
const int max_iterations = 25;
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
uart_mcu_comms* mcu_comms;
int update_packet_timer_id;
int update_rotation_timer_id;
Ui::MainWindow *ui;
QString initialStyleSheet_updateLabel;
QDateTime last_update;
QDateTime rot_last_update;
void set_physical_packet(plane_packet_physical *part1, float dt);
void set_electrical_packet(plane_packet_electrical *part2, float dt);
void update_packet_data_ui(bool result, QString last_update_text, QString stale_text, QString average_lag_text, float dt);
protected:
void timerEvent(QTimerEvent *event) override;
signals:
QString print();
private:
float x=0,y=0,z=0;
int iteration = 0;
float staleTimes[Ui::max_iterations];
bool hasPacketChanged;
};
#endif // MAINWINDOW_H