1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-12-02 23:49:09 +01:00
GPXSee/src/GUI/speedgraph.h

44 lines
807 B
C
Raw Normal View History

2015-10-12 01:12:12 +02:00
#ifndef SPEEDGRAPH_H
#define SPEEDGRAPH_H
#include <QList>
2016-06-24 00:55:44 +02:00
#include "graphtab.h"
2015-10-12 01:12:12 +02:00
class SpeedGraphItem;
class Track;
2016-06-24 00:55:44 +02:00
class SpeedGraph : public GraphTab
2015-10-12 01:12:12 +02:00
{
2015-10-13 00:27:49 +02:00
Q_OBJECT
2015-10-12 01:12:12 +02:00
public:
2015-10-17 01:33:02 +02:00
SpeedGraph(QWidget *parent = 0);
~SpeedGraph();
2015-10-12 01:12:12 +02:00
2016-06-24 00:55:44 +02:00
QString label() const {return tr("Speed");}
QList<GraphItem*> loadData(const Data &data);
2015-10-12 01:12:12 +02:00
void clear();
void setUnits(Units units);
void setTimeType(TimeType type);
void showTracks(bool show);
2015-10-12 01:12:12 +02:00
2016-06-24 00:55:44 +02:00
private:
GraphItem *loadGraph(const Graph &graph, const Track &track,
const QColor &color, bool primary);
qreal avg() const;
2016-03-27 13:23:00 +02:00
qreal max() const {return bounds().bottom();}
2018-03-10 20:25:13 +01:00
void setYUnits();
2016-08-09 01:16:19 +02:00
void setInfo();
2015-12-19 20:23:07 +01:00
2019-03-15 19:43:17 +01:00
QVector<QPointF> _avg;
QVector<QPointF> _mavg;
2016-08-19 19:48:44 +02:00
2018-03-10 20:25:13 +01:00
Units _units;
TimeType _timeType;
2016-08-19 19:48:44 +02:00
bool _showTracks;
QList<SpeedGraphItem *> _tracks;
2015-10-12 01:12:12 +02:00
};
#endif // SPEEDGRAPH_H