1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-12-01 07:01:16 +01:00
GPXSee/src/data/track.h

80 lines
2.0 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"
#include "dem.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;
2016-09-19 00:56:10 +02:00
Graph elevation() const;
Graph speed() const;
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();}
2016-09-19 23:35:04 +02:00
bool isNull() const {return (_data.size() < 2);}
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;}
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 useDEMElevation(bool use) {_useDEMElevation = use;}
2019-01-07 22:07:03 +01:00
static void setDEMDir(const QString &path) {_dem = DEM(path);}
2017-05-22 14:54:22 +02:00
2015-10-05 01:43:48 +02:00
private:
bool discardStopPoint(int i) const;
const TrackData &_data;
2016-11-05 17:33:29 +01:00
2016-09-19 23:35:04 +02:00
QVector<qreal> _distance;
QVector<qreal> _time;
2016-11-05 17:33:29 +01:00
QVector<qreal> _speed;
QSet<int> _outliers;
QSet<int> _stop;
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;
static qreal _pauseSpeed;
static int _pauseInterval;
2018-06-21 20:54:24 +02:00
static bool _useReportedSpeed;
static bool _useDEMElevation;
static DEM _dem;
2015-10-05 01:43:48 +02:00
};
#endif // TRACK_H