1 #ifndef SPEEDGRAPH_H 2 #define SPEEDGRAPH_H 3 4 #include <QList> 5 #include "graphtab.h" 6 7 class SpeedGraphItem; 8 class Track; 9 10 class SpeedGraph : public GraphTab 11 { 12 Q_OBJECT 13 14 public: 15 SpeedGraph(QWidget *parent = 0); 16 ~SpeedGraph(); 17 label()18 QString label() const {return tr("Speed");} 19 QList<GraphItem*> loadData(const Data &data); 20 void clear(); 21 void setUnits(Units units); 22 void setTimeType(TimeType type); 23 void showTracks(bool show); 24 25 private: 26 GraphItem *loadGraph(const Graph &graph, const Track &track, 27 const QColor &color, bool primary); 28 qreal avg() const; max()29 qreal max() const {return bounds().bottom();} 30 void setYUnits(); 31 void setInfo(); 32 33 QVector<QPointF> _avg; 34 QVector<QPointF> _mavg; 35 36 Units _units; 37 TimeType _timeType; 38 39 bool _showTracks; 40 QList<SpeedGraphItem *> _tracks; 41 }; 42 43 #endif // SPEEDGRAPH_H 44