-
Notifications
You must be signed in to change notification settings - Fork 1
/
TourDataPlot.h
74 lines (66 loc) · 1.57 KB
/
TourDataPlot.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
#ifndef TOURDATAPLOT_H
#define TOURDATAPLOT_H
#include "qcustomplot/qcustomplot.h"
#include "TourData.h"
enum ePlotXType{
Distance = 0,
Time
};
enum ePlotYType{
Speed = 0,
DeviceBattery,
Cadence,
Temperature,
Grade,
HeartRate,
Calories,
Power,
LRBalance,
GearInfo,
GpsAccuracy
};
enum eGraph{
AltitudeCurve = 0,
Free2ndCurve,
Free3rdCurve,
Free4thCurve,
AverageLine,
TrackerLine,
LapOneLine
};
class TourDataPlot : public QCustomPlot
{
Q_OBJECT
public:
TourDataPlot( QWidget *parent );
void drawPlots( TourData *pTourData, ePlotXType xType, ePlotYType yType );
void setAverageLineVisible( bool on );
double tourTimeToPlotTime( double time );
QVector<double> getTourTimeStamp( void ) const;
QVector<double> getGearTimeStamp( void ) const;
private slots:
void mouseOverPlot( QMouseEvent *event );
void onXRangeChanged( QCPRange range );
void onY1RangeChanged( QCPRange range );
void onY2RangeChanged( QCPRange range );
private:
void init( void );
void setStartDate( double time );
ePlotXType m_xType{ Distance };
ePlotYType m_yType{ Speed };
bool m_avgOn{ false };
QCPLayer* m_trackerLayer;
QVector<QCPItemText*> m_lapLabels;
double m_xLimU;
double m_xLimL;
double m_y1LimU;
double m_y1LimL;
double m_y2LimU;
double m_y2LimL;
bool m_plotted{false};
const double m_graphWidth{1.0};
const double m_lineWidth{1.05};
QVector<double> m_tourTimeStamp;
QVector<double> m_gearTimeStamp;
};
#endif // TOURDATAPLOT_H