TrackRecordingService: compute temporary TrackStatistics for UI.

Fixes #810.
This commit is contained in:
Dennis Guse
2021-06-06 14:03:05 +02:00
parent 21376cd3da
commit 2f0449c420
5 changed files with 61 additions and 30 deletions
@@ -48,7 +48,9 @@ public class TrackPoint {
private TrackPoint.Id id;
@NonNull
private Instant time;
private Double latitude;
private Double longitude;
private Float accuracy;
@@ -96,10 +98,16 @@ public class TrackPoint {
public TrackPoint(@NonNull Type type) {
this.type = type;
this.time = Instant.now(); //TODO This may result in #800
}
public TrackPoint(@NonNull Type type, Instant time) {
this(type);
this.time = time;
}
public TrackPoint(@NonNull Location location) {
this(Type.TRACKPOINT, location, Instant.now());
this(Type.TRACKPOINT, location, Instant.now()); //TODO This may result in #800
}
public TrackPoint(@NonNull Type type, @NonNull Location location, @NonNull Instant time) {
@@ -116,11 +124,6 @@ public class TrackPoint {
setTime(time);
}
public TrackPoint(@NonNull Type type, Instant time) {
this(type);
this.time = time;
}
public TrackPoint(double latitude, double longitude, Altitude altitude, Instant time) {
this(Type.TRACKPOINT);
this.latitude = latitude;