1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-06-27 03:29:16 +02:00

Added configurable segments usage

This commit is contained in:
2020-09-20 22:18:35 +02:00
parent d738ad7b5a
commit 50f483663c
6 changed files with 33 additions and 6 deletions

View File

@ -17,7 +17,7 @@ bool Track::_useReportedSpeed = false;
bool Track::_useDEM = false;
bool Track::_show2ndElevation = false;
bool Track::_show2ndSpeed = false;
bool Track::_useSegments = true;
static qreal avg(const QVector<qreal> &v)
{
@ -88,10 +88,18 @@ static GraphSegment filter(const GraphSegment &g, int window)
}
Track::Track(const TrackData &data) : _data(data), _pause(0)
Track::Track(const TrackData &data) : _pause(0)
{
qreal ds, dt;
if (_useSegments)
_data = data;
else {
_data.append(SegmentData());
for (int i = 0; i < data.size(); i++)
_data[0].append(data.at(i));
}
for (int i = 0; i < _data.size(); i++) {
const SegmentData &sd = _data.at(i);
_segments.append(Segment());

View File

@ -49,10 +49,9 @@ public:
{_outlierEliminate = eliminate;}
static void useReportedSpeed(bool use) {_useReportedSpeed = use;}
static void useDEM(bool use) {_useDEM = use;}
static void showSecondaryElevation(bool show)
{_show2ndElevation = show;}
static void showSecondarySpeed(bool show)
{_show2ndSpeed = show;}
static void showSecondaryElevation(bool show) {_show2ndElevation = show;}
static void showSecondarySpeed(bool show) {_show2ndSpeed = show;}
static void useSegments(bool use) {_useSegments = use;}
private:
struct Segment {
@ -87,6 +86,7 @@ private:
static bool _useDEM;
static bool _show2ndElevation;
static bool _show2ndSpeed;
static bool _useSegments;
};
#endif // TRACK_H