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>
|
2016-02-11 20:58:52 +01:00
|
|
|
#include <QDateTime>
|
2019-01-06 18:45:09 +01:00
|
|
|
#include <QDir>
|
2016-10-28 14:33:36 +02:00
|
|
|
#include "trackdata.h"
|
2016-09-19 00:56:10 +02:00
|
|
|
#include "graph.h"
|
2019-01-06 18:45:09 +01:00
|
|
|
#include "dem.h"
|
2016-11-05 17:33:29 +01:00
|
|
|
#include "path.h"
|
2015-10-05 01:43:48 +02:00
|
|
|
|
2016-10-28 14:33:36 +02:00
|
|
|
|
2016-02-11 20:58:52 +01:00
|
|
|
class Track
|
2015-10-05 01:43:48 +02:00
|
|
|
{
|
|
|
|
public:
|
2016-10-28 14:33:36 +02:00
|
|
|
Track(const TrackData &data);
|
2015-10-05 01:43:48 +02:00
|
|
|
|
2016-11-13 09:49:31 +01:00
|
|
|
Path path() const;
|
2017-03-18 01:30:31 +01:00
|
|
|
|
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;
|
2018-07-03 01:29:14 +02:00
|
|
|
Graph ratio() const;
|
2016-08-09 23:08:49 +02:00
|
|
|
|
|
|
|
qreal distance() const;
|
2016-02-11 20:58:52 +01:00
|
|
|
qreal time() const;
|
2017-01-31 09:37:01 +01:00
|
|
|
qreal movingTime() const;
|
2016-02-11 20:58:52 +01:00
|
|
|
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);}
|
2016-07-28 00:23:22 +02:00
|
|
|
|
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;}
|
2019-01-06 18:45:09 +01:00
|
|
|
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:
|
2017-01-31 09:37:01 +01:00
|
|
|
bool discardStopPoint(int i) const;
|
|
|
|
|
2016-10-28 14:33:36 +02:00
|
|
|
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;
|
2017-01-31 09:37:01 +01:00
|
|
|
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;
|
2019-01-06 18:45:09 +01:00
|
|
|
static bool _useDEMElevation;
|
|
|
|
static DEM _dem;
|
2015-10-05 01:43:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TRACK_H
|