-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwidget.h
91 lines (71 loc) · 1.94 KB
/
widget.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
#include <QtSerialPort>
#include <QTimer>
#include "qcustomplot/qcustomplot.h"
#define MAXSUBPLOTS 3
#define MAXLINES 3
namespace Ui {
class Widget;
}
class Widget : public QWidget
{
Q_OBJECT
public:
explicit Widget(QWidget *parent = 0);
~Widget();
private slots:
void on_Initchar_lineEdit_textChanged(const QString &arg1);
void on_Serialavailable_comboBox_currentIndexChanged(const QString &arg1);
void on_Serialbaud_comboBox_currentIndexChanged(const QString &arg1);
void on_Start_pushButton_clicked();
void on_Stop_pushButton_clicked();
void on_Save_pushButton_clicked();
void readData();
void update_plot();
void selectionChanged();
void mousePress();
void mouseWheel();
void on_Numbersubplots_spinBox_valueChanged(int arg1);
void number_of_lines_changed(int val);
void color_changed(int val);
private:
Ui::Widget *ui;
QString serialportname;
QString serialbaud;
QString initchar;
QSerialPort serialport;
QStringList datalist_console;
QStringList datalist;
QString lastdatalistline;
QString firstdatalistline;
QString data;
QList<QList<double> > parseddatalist;
QTimer* timer;
int databefore;
double initialtime;
double finaltime;
bool isfirst;
// line struct
struct Line_struct_t{
QWidget* Line_Groupbox;
QSpinBox* Xdata_Spinbox;
QSpinBox* Ydata_Spinbox;
QComboBox* Color_Combobox;
QCPGraph* graph;
};
// struct Subplot
struct Subplot_struct_t {
QCPAxisRect* AxesRect;
QWidget* Subplot_Groupbox;
QSpinBox* NofLines_Spinbox;
Line_struct_t lines[MAXLINES];
};
Subplot_struct_t Subplots[MAXSUBPLOTS];
// QList<QCPAxisRect*> allAxesRect;
// QCPAxisRect* allAxesRect_[MAXSUBPLOTS];
void updateconsole(QByteArray incomingdata);
QColor getcolor(int idx);
};
#endif // WIDGET_H