1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-19 04:02:09 +01:00
GPXSee/src/data/track.h

97 lines
2.6 KiB
C
Raw Normal View History

2015-10-05 01:43:48 +02:00
#ifndef TRACK_H
#define TRACK_H
#include <QVector>
2016-11-05 17:33:29 +01:00
#include <QSet>
#include <QDateTime>
#include <QDir>
#include "trackdata.h"
2016-09-19 00:56:10 +02:00
#include "graph.h"
2016-11-05 17:33:29 +01:00
#include "path.h"
2015-10-05 01:43:48 +02:00
class Track
2015-10-05 01:43:48 +02:00
{
public:
Track(const TrackData &data);
2015-10-05 01:43:48 +02:00
2016-11-13 09:49:31 +01:00
Path path() const;
GraphPair elevation() const;
GraphPair speed() const;
2016-09-19 00:56:10 +02:00
Graph heartRate() const;
Graph temperature() const;
2016-11-06 03:28:08 +01:00
Graph cadence() const;
Graph power() const;
Graph ratio() const;
qreal distance() const;
qreal time() const;
qreal movingTime() const;
QDateTime date() const;
2015-11-23 02:37:08 +01:00
2016-11-05 17:33:29 +01:00
const QString &name() const {return _data.name();}
const QString &description() const {return _data.description();}
const QString &comment() const {return _data.comment();}
2019-10-14 20:07:05 +02:00
const QVector<Link> &links() const {return _data.links();}
const LineStyle &style() const {return _data.style();}
2016-11-05 17:33:29 +01:00
2019-02-11 23:28:08 +01:00
bool isValid() const;
2017-05-22 14:54:22 +02:00
static void setElevationFilter(int window) {_elevationWindow = window;}
static void setSpeedFilter(int window) {_speedWindow = window;}
static void setHeartRateFilter(int window) {_heartRateWindow = window;}
static void setCadenceFilter(int window) {_cadenceWindow = window;}
static void setPowerFilter(int window) {_powerWindow = window;}
2019-11-13 08:27:54 +01:00
static void setAutomaticPause(bool set) {_automaticPause = set;}
2017-05-22 14:54:22 +02:00
static void setPauseSpeed(qreal speed) {_pauseSpeed = speed;}
static void setPauseInterval(int interval) {_pauseInterval = interval;}
static void setOutlierElimination(bool eliminate)
{_outlierEliminate = eliminate;}
2018-06-21 20:54:24 +02:00
static void useReportedSpeed(bool use) {_useReportedSpeed = use;}
static void useDEM(bool use) {_useDEM = use;}
2020-09-20 22:18:35 +02:00
static void showSecondaryElevation(bool show) {_show2ndElevation = show;}
static void showSecondarySpeed(bool show) {_show2ndSpeed = show;}
static void useSegments(bool use) {_useSegments = use;}
2017-05-22 14:54:22 +02:00
2015-10-05 01:43:48 +02:00
private:
2019-02-11 23:28:08 +01:00
struct Segment {
QDateTime start;
2019-02-11 23:28:08 +01:00
QVector<qreal> distance;
QVector<qreal> time;
QVector<qreal> speed;
QSet<int> outliers;
QSet<int> stop;
};
qreal lastDistance(int seg);
qreal lastTime(int seg);
2019-02-11 23:28:08 +01:00
bool discardStopPoint(const Segment &seg, int i) const;
Graph demElevation() const;
Graph gpsElevation() const;
Graph reportedSpeed() const;
Graph computedSpeed() const;
2019-02-11 23:28:08 +01:00
TrackData _data;
QList<Segment> _segments;
qreal _pause;
2017-05-22 14:54:22 +02:00
static bool _outlierEliminate;
static int _elevationWindow;
static int _speedWindow;
static int _heartRateWindow;
static int _cadenceWindow;
static int _powerWindow;
2019-11-13 08:27:54 +01:00
static bool _automaticPause;
2017-05-22 14:54:22 +02:00
static qreal _pauseSpeed;
static int _pauseInterval;
2018-06-21 20:54:24 +02:00
static bool _useReportedSpeed;
static bool _useDEM;
static bool _show2ndElevation;
static bool _show2ndSpeed;
2020-09-20 22:18:35 +02:00
static bool _useSegments;
2015-10-05 01:43:48 +02:00
};
#endif // TRACK_H