Elevation gain: make it optional as Float.

So if no sensor data is provided, it is not stored in the database and not exported.
This commit is contained in:
Dennis Guse
2020-09-05 11:45:54 +02:00
parent e0d1ad4b52
commit 6845ce4984
4 changed files with 38 additions and 9 deletions
@@ -32,7 +32,7 @@ public class TrackPoint {
private Float heartRate_bpm = null;
private Float cyclingCadence_rpm = null;
private Float power = null;
private float elevationGain = Float.NaN;
private Float elevationGain = null;
public TrackPoint() {
this.location = new Location("");
@@ -94,14 +94,14 @@ public class TrackPoint {
}
public boolean hasElevationGain() {
return !Float.isNaN(elevationGain);
return elevationGain != null;
}
public float getElevationGain() {
return elevationGain;
}
public void setElevationGain(float elevationGain) {
public void setElevationGain(Float elevationGain) {
this.elevationGain = elevationGain;
}