-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
77 lines (58 loc) · 1.77 KB
/
mainwindow.h
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QString>
#include <QTextCursor>
#include <QtCharts/QLineSeries>
#include <QtCharts/QChartView>
#include <QtCharts/QChart>
#include <QTimer>
#include <QTabWidget>
#include <QLayout>
#include <QVBoxLayout>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include "chart.h"
#include "messageprocessor.h"
using namespace QtCharts;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
//Chart creation and management
void AddTab(QString TabName);
QLineSeries* AddSeries(QString SeriesName);
void AddChart(QString ChartName);
int GetChartIndex(Chart* ChartPointer);
public slots:
void DeleteChart(Chart* ChartPointer);
void AddReceivedSeries(int SeriesID, QString SeriesName);
void AddDataPoints(int SeriesID, QList<float> DataPoints);
private slots:
void on_TerminalEntry_returnPressed();
void on_AddChartButton_released();
void on_ConnectButton_released();
void on_RefreshButton_released();
void SerialDataAvailable();
private:
Ui::MainWindow *ui;
QString OldTerminalText;
QList<Chart*> Charts;
QList<QLineSeries*> DataSeries;
QList<int> SeriesIDs;
MessageProcessor *MessageHandler = nullptr;
int GetIndexFromID(int SeriesID);
QSerialPort *ComPort;
QString GetPortName(bool &Ok);
int32_t GetBaudRate(bool &Ok);
QSerialPort::DataBits GetDataBits(bool &Ok);
QSerialPort::Parity GetParity(bool &Ok);
QSerialPort::StopBits GetStopBits(bool &Ok);
QByteArray SerialBuffer;
};
#endif // MAINWINDOW_H