-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharttabpage.hpp
executable file
·173 lines (157 loc) · 5.33 KB
/
charttabpage.hpp
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/*
* Copyright (C) 2016
* Author: Stelmach Rostislav <stelmach.ro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef CHARTTABPAGE_HPP
#define CHARTTABPAGE_HPP
#include <QWidget>
#include <QTimer>
class QCustomPlot;
class QLabel;
class QPushButton;
class ChartTabPage : public QWidget
{
Q_OBJECT
public:
ChartTabPage();
private slots:
void realTimeDataSlot();
void yAxisRangeMinSet(int min);
void yAxisRangeMaxSet(int max);
void xAxisSpeedSet(int speed);
void xAxisTickSet(int ticks);
/* Set new color from QColorDialog
* and emit changeColorPlot*n function */
void cColorSet1(bool);
void cColorSet2(bool);
void cColorSet3(bool);
void cColorSet4(bool);
void cColorSet5(bool);
void cColorSet6(bool);
void cColorSet7(bool);
void cColorSet8(bool);
void cColorSet9(bool);
void cColorSet10(bool);
void cColorSet11(bool);
void cColorSet12(bool);
void cColorSet13(bool);
void cColorSet14(bool);
void cColorSet15(bool);
/* mPlotSet works with checkBoxes , if user select
* the specific checkBox, then the specific yAxis should
* enabled */
void mPlotSet1(bool value) { mPlotEnabled1 = value; }
void mPlotSet2(bool value) { mPlotEnabled2 = value; }
void mPlotSet3(bool value) { mPlotEnabled3 = value; }
void mPlotSet4(bool value) { mPlotEnabled4 = value; }
void mPlotSet5(bool value) { mPlotEnabled5 = value; }
void mPlotSet6(bool value) { mPlotEnabled6 = value; }
void mPlotSet7(bool value) { mPlotEnabled7 = value; }
void mPlotSet8(bool value) { mPlotEnabled8 = value; }
void mPlotSet9(bool value) { mPlotEnabled9 = value; }
void mPlotSet10(bool value) { mPlotEnabled10 = value; }
void mPlotSet11(bool value) { mPlotEnabled11 = value; }
void mPlotSet12(bool value) { mPlotEnabled12 = value; }
void mPlotSet13(bool value) { mPlotEnabled13 = value; }
void mPlotSet14(bool value) { mPlotEnabled14 = value; }
void mPlotSet15(bool value) { mPlotEnabled15 = value; }
/* change the actual color of the yAxis in the plot */
void changePlotColor1(const QColor& color);
void changePlotColor2(const QColor& color);
void changePlotColor3(const QColor& color);
void changePlotColor4(const QColor& color);
void changePlotColor5(const QColor& color);
void changePlotColor6(const QColor& color);
void changePlotColor7(const QColor& color);
void changePlotColor8(const QColor& color);
void changePlotColor9(const QColor& color);
void changePlotColor10(const QColor& color);
void changePlotColor11(const QColor& color);
void changePlotColor12(const QColor& color);
void changePlotColor13(const QColor& color);
void changePlotColor14(const QColor& color);
void changePlotColor15(const QColor& color);
signals:
void cColor1Changed(const QColor& color);
void cColor2Changed(const QColor& color);
void cColor3Changed(const QColor& color);
void cColor4Changed(const QColor& color);
void cColor5Changed(const QColor& color);
void cColor6Changed(const QColor& color);
void cColor7Changed(const QColor& color);
void cColor8Changed(const QColor& color);
void cColor9Changed(const QColor& color);
void cColor10Changed(const QColor& color);
void cColor11Changed(const QColor& color);
void cColor12Changed(const QColor& color);
void cColor13Changed(const QColor& color);
void cColor14Changed(const QColor& color);
void cColor15Changed(const QColor& color);
private:
QString getColorString(const QColor& color);
QCustomPlot* mPlot;
QTimer dataTimer;
int yAxisLowerRange;
int yAxisUpperRange;
int xAxisSpeed;
int xAxisTicks;
bool mPlotEnabled1;
bool mPlotEnabled2;
bool mPlotEnabled3;
bool mPlotEnabled4;
bool mPlotEnabled5;
bool mPlotEnabled6;
bool mPlotEnabled7;
bool mPlotEnabled8;
bool mPlotEnabled9;
bool mPlotEnabled10;
bool mPlotEnabled11;
bool mPlotEnabled12;
bool mPlotEnabled13;
bool mPlotEnabled14;
bool mPlotEnabled15;
QColor ccolor1;
QColor ccolor2;
QColor ccolor3;
QColor ccolor4;
QColor ccolor5;
QColor ccolor6;
QColor ccolor7;
QColor ccolor8;
QColor ccolor9;
QColor ccolor10;
QColor ccolor11;
QColor ccolor12;
QColor ccolor13;
QColor ccolor14;
QColor ccolor15;
QPushButton *cbutton1;
QPushButton *cbutton2;
QPushButton *cbutton3;
QPushButton *cbutton4;
QPushButton *cbutton5;
QPushButton *cbutton6;
QPushButton *cbutton7;
QPushButton *cbutton8;
QPushButton *cbutton9;
QPushButton *cbutton10;
QPushButton *cbutton11;
QPushButton *cbutton12;
QPushButton *cbutton13;
QPushButton *cbutton14;
QPushButton *cbutton15;
};
#endif // CHARTTABPAGE_HPP