forked from upstream-mirrors/OpenTracks
TrackRecordingManager: do not store altitude changes twice (previous …
…TrackPoint's storage was delayed). Fixes #969.
This commit is contained in:
@@ -208,7 +208,7 @@ class TrackRecordingManager {
|
||||
} else {
|
||||
insertTrackPointHelper(trackId, lastTrackPoint);
|
||||
// Remove the sensorDistance from trackPoint that is already going be stored with lastTrackPoint.
|
||||
trackPoint.minusSensorDistance(lastTrackPoint);
|
||||
trackPoint.minusCumulativeSensorData(lastTrackPoint);
|
||||
}
|
||||
lastTrackPoint = null;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,19 @@ public class AltitudeSumManager implements SensorEventListener {
|
||||
return isConnected ? altitudeGain_m : null;
|
||||
}
|
||||
|
||||
|
||||
@VisibleForTesting
|
||||
public void addAltitudeGain_m(float altitudeGain_m) {
|
||||
this.altitudeGain_m = this.altitudeGain_m == null ? 0f : this.altitudeGain_m;
|
||||
this.altitudeGain_m += altitudeGain_m ;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public void addAltitudeLoss_m(Float altitudeLoss_m) {
|
||||
this.altitudeLoss_m = this.altitudeLoss_m == null ? 0f : this.altitudeLoss_m;
|
||||
this.altitudeLoss_m += altitudeLoss_m ;
|
||||
}
|
||||
|
||||
public @Nullable
|
||||
Float getAltitudeLoss_m() {
|
||||
return isConnected ? altitudeLoss_m : null;
|
||||
|
||||
Reference in New Issue
Block a user