forked from sqym/ALPHA-MODEL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chartview.h
292 lines (222 loc) · 7.66 KB
/
chartview.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
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
#ifndef CHARTVIEW_H
#define CHARTVIEW_H
#include <QWidget>
#include <QtCharts>
#include <QChartView>
#include <QtWidgets/QGraphicsView>
#include <QPoint>
#include <QToolTip>
#include <QLabel>
#include <QPainter>
#include <QRubberBand>
QT_CHARTS_USE_NAMESPACE
class chartview : public QChartView
{
Q_OBJECT
public:
explicit chartview(QWidget *parent = nullptr);
int model_type = 0;
int current_chart = 0;
double fitting3_SH[60];
double fitting3_kn[60];
double input_SH[60];
double input_kn[60];
double input_SH0[60];
double input_kn0[60];
double input_SH1[60];
double input_kn1[60];
double input_SH2[60];
double input_kn2[60];
double input_SH3[60];
double input_kn3[60];
QList<double*>input_SH_list;
QList<double*>input_kn_list;
double combine_SH0[120];
double combine_kn0[120];
double combine_SH1[120];
double combine_kn1[120];
double combine_SH2[120];
double combine_kn2[120];
int count_num = 0;
int filled_num = 0;
QList<double*>combine_SH_list;
QList<double*>combine_kn_list;
//Masuda
double Masuda_kn_group[60];
double Masuda_SH_group[60];
double Masuda_kn;
double Masuda_SH;
double Masuda_N = 3.5;
//Patchy
double Patchy_kr_group[60];
double Patchy_SH_group[60];
double Patchy_kr;
double Patchy_SH;
double Patchy_N = 2;
//G-C
double GC_kn_group[60];
double GC_SH_group[60];
double GC_kn;
double GC_SH;
//P-F
double PF_kn_group[60];
double PF_SH_group[60];
double PF_kn;
double PF_SH;
//Hybrid
double Hybrid_kn_group[60];
double Hybrid_SH_group[60];
double Hybrid_kn;
double Hybrid_SH;
double Hybrid_alpha = 0.35; //0 - 1
double Hybrid_Beta = 5; //-5 - 30
int click_trigger = 0;
double point_x;
double point_y;
int zoom_count = 0;
double zoom_point1_x;
double zoom_point1_y;
double zoom_point2_x;
double zoom_point2_y;
double rubberBand_start_x;
double rubberBand_start_y;
QRubberBand *rubberBand;
QPoint origin;
QString mouse_X = "X: ";
QString mouse_Y = "Y: ";
QString mouse_move_X = "X: %1";
QString mouse_move_Y = "Y: %1";
int Axis_trigger = 0;
QValueAxis *m_AxisY = new QValueAxis();
QValueAxis *m_AxisX = new QValueAxis();
QValueAxis *m_AxisY1 = new QValueAxis();
QValueAxis *m_AxisX1 = new QValueAxis();
void attach_Axis();
void attach_log_Axis();
QPen mark_Series;
QLineSeries *mark_Series1 = new QLineSeries();
QLineSeries *mark_Series2 = new QLineSeries();
QLineSeries *mark_Series3 = new QLineSeries();
QLineSeries *mark_Series4 = new QLineSeries();
QLineSeries *mark_Series5 = new QLineSeries();
QLineSeries *mark_Series6 = new QLineSeries();
QLineSeries *mark_Series1_ = new QLineSeries();
QLineSeries *mark_Series2_ = new QLineSeries();
QLineSeries *mark_Series3_ = new QLineSeries();
QLineSeries *mark_Series4_ = new QLineSeries();
QLineSeries *mark_Series5_ = new QLineSeries();
QLineSeries *mark_Series6_ = new QLineSeries();
QLineSeries *crossx_Series = new QLineSeries();
QLineSeries *crossy_Series = new QLineSeries();
QLineSeries *crossx__Series = new QLineSeries();
QLineSeries *crossy__Series = new QLineSeries();
int cross_trigger = 0;
QList<QLineSeries*>mark_Series_list;
QList<QLineSeries*>mark_Series_list_;
int list_count = 0;
int list_count_ = 0;
QLineSeries *fitting_Series3 = new QLineSeries();
QPen fitting_pen;
QPen m_Series0_pen;
QScatterSeries *m_Series0 = new QScatterSeries();
QPen m_Series1_pen;
QLineSeries *m_Series1 = new QLineSeries();
QPen m_Series2_pen;
QLineSeries *m_Series2 = new QLineSeries();
QPen m_Series3_pen;
QLineSeries *m_Series3 = new QLineSeries();
QPen m_Series4_pen;
QLineSeries *m_Series4 = new QLineSeries();
QPen m_Series5_pen;
QLineSeries *m_Series5 = new QLineSeries();
QScatterSeries *input_Series0 = new QScatterSeries();
QScatterSeries *input_Series1 = new QScatterSeries();
QScatterSeries *input_Series2 = new QScatterSeries();
QScatterSeries *input_Series3 = new QScatterSeries();
QScatterSeries *input_Series4 = new QScatterSeries();
QScatterSeries *input_Series5 = new QScatterSeries();
QScatterSeries *input_Series6 = new QScatterSeries();
QScatterSeries *input_Series7 = new QScatterSeries();
QScatterSeries *combine_Series0 = new QScatterSeries();
QScatterSeries *combine_Series1 = new QScatterSeries();
QScatterSeries *combine_Series2 = new QScatterSeries();
QChart *m_LineChart = new QChart();
QChart *m_LineChart1 = new QChart();
void setLineChartMargins(QChart *m_LineChart, int margin);
void addPointToChart_original_ver(QScatterSeries *targetSeries, double x[],double y[]);
void addPointToChart_model_ver(QLineSeries *targetSeries, double x[],double y[]);
void addPointToChart_combine_ver(QScatterSeries *targetSeries, double x[],double y[]);
void addFittingCurveToChart(QLineSeries *targetSeries, double x[],double y[]);
void calculate();
void mouseMoveEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
int tooltip_trigger = 0;
QToolTip *tip;
int click_point_trigger = 0;
double click_point_x;
double click_point_y;
int click_point_agreement = 0;
QLabel *showlabel1 = new QLabel(this);
QLabel *showlabel2 = new QLabel(this);
QLabel *showlabel3 = new QLabel(this);
QLabel *showlabel4 = new QLabel(this);
QLabel *showlabel5 = new QLabel(this);
QLabel *showlabel6 = new QLabel(this);
QLabel *colorlabel1 = new QLabel(this);
QLabel *colorlabel2 = new QLabel(this);
QLabel *colorlabel3 = new QLabel(this);
QLabel *colorlabel4 = new QLabel(this);
QLabel *colorlabel5 = new QLabel(this);
QLabel *colorlabel6 = new QLabel(this);
QPalette pe1;
QPalette pe2;
QPalette pe3;
QPalette pe4;
QPalette pe5;
QPalette pe6;
QLabel *showlabel7 = new QLabel(this);
QLabel *showlabel8 = new QLabel(this);
QLabel *showlabel9 = new QLabel(this);
QLabel *showlabel10 = new QLabel(this);
QLabel *showlabel11 = new QLabel(this);
QLabel *showlabel12 = new QLabel(this);
QLabel *showlabel13 = new QLabel(this);
QLabel *colorlabel7 = new QLabel(this);
QLabel *colorlabel8 = new QLabel(this);
QLabel *colorlabel9 = new QLabel(this);
QLabel *colorlabel10 = new QLabel(this);
QLabel *colorlabel11 = new QLabel(this);
QLabel *colorlabel12 = new QLabel(this);
QLabel *colorlabel13 = new QLabel(this);
QPalette pe7;
QPalette pe8;
QPalette pe9;
QPalette pe10;
QPalette pe11;
QPalette pe12;
QPalette pe13;
QString label_str1 = "font-family: 'Microsoft YaHei';"
"font-size: 22px;"
"font-style: normal;"
"font-weight: bold;"
"color: #000000;";
QString label_str2 = "font-family: 'Microsoft YaHei';"
"font-size: 18px;"
"font-style: normal;"
"font-weight: bold;"
"color: #000000;";
private slots:
void tooltip(QPointF point, bool state);
private:
QGraphicsSimpleTextItem *m_chartvalue_X;
QGraphicsSimpleTextItem *m_chartvalue_Y;
QGraphicsSimpleTextItem *m_chartvalue_X1;
QGraphicsSimpleTextItem *m_chartvalue_Y1;
QGraphicsSimpleTextItem *m_coordX;
QGraphicsSimpleTextItem *m_coordY;
QGraphicsSimpleTextItem *m_coordX1;
QGraphicsSimpleTextItem *m_coordY1;
signals:
};
#endif // CHARTVIEW_H