mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-31 09:05:14 +01:00
Improved pause detection
This commit is contained in:
parent
9309dd945b
commit
15af82ee49
@ -133,12 +133,19 @@ Track::Track(const TrackData &data) : _data(data), _pause(0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get stop-points + pause duration
|
// get stop-points + pause duration
|
||||||
|
int ss = 0, la = 0;
|
||||||
for (int j = 1; j < seg.time.size(); j++) {
|
for (int j = 1; j < seg.time.size(); j++) {
|
||||||
if (seg.time.at(j) > seg.time.at(j-1) + _pauseInterval
|
if (seg.speed.at(j) > _pauseSpeed)
|
||||||
&& seg.speed.at(j) < _pauseSpeed) {
|
ss = -1;
|
||||||
_pause += seg.time.at(j) - seg.time.at(j-1);
|
else if (ss < 0)
|
||||||
seg.stop.insert(j-1);
|
ss = j;
|
||||||
seg.stop.insert(j);
|
|
||||||
|
if (ss >= 0 && seg.time.at(j) > seg.time.at(ss) + _pauseInterval) {
|
||||||
|
int l = qMax(ss, la);
|
||||||
|
_pause += seg.time.at(j) - seg.time.at(l);
|
||||||
|
for (int k = l; k <= j; k++)
|
||||||
|
seg.stop.insert(k);
|
||||||
|
la = j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user