forked from upstream-mirrors/OpenTracks
Segments: only insert one trackpoint and set the type.
Existing data is not migrated. #316.
This commit is contained in:
@@ -80,7 +80,8 @@ public class TrackPoint {
|
||||
}
|
||||
}
|
||||
|
||||
private final Type type;
|
||||
@NonNull
|
||||
private Type type;
|
||||
|
||||
private Float heartRate_bpm = null;
|
||||
private Float cyclingCadence_rpm = null;
|
||||
@@ -92,7 +93,7 @@ public class TrackPoint {
|
||||
this(Type.TRACKPOINT, new Location(""));
|
||||
}
|
||||
|
||||
public TrackPoint(Type type) {
|
||||
public TrackPoint(@NonNull Type type) {
|
||||
this.type = type;
|
||||
this.location = new Location("");
|
||||
}
|
||||
@@ -108,18 +109,6 @@ public class TrackPoint {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public TrackPoint(@NonNull TrackPoint trackPoint) {
|
||||
this.type = trackPoint.getType();
|
||||
this.location = trackPoint.getLocation();
|
||||
|
||||
this.heartRate_bpm = trackPoint.getHeartRate_bpm();
|
||||
this.cyclingCadence_rpm = trackPoint.getCyclingCadence_rpm();
|
||||
this.power = trackPoint.getPower();
|
||||
|
||||
this.elevationGain = trackPoint.getElevationGain();
|
||||
this.elevationLoss = trackPoint.getElevationLoss();
|
||||
}
|
||||
|
||||
public TrackPoint(double latitude, double longitude, Double altitude, long time) {
|
||||
this.type = Type.TRACKPOINT;
|
||||
location = new Location(LocationManager.GPS_PROVIDER);
|
||||
@@ -172,6 +161,10 @@ public class TrackPoint {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(@NonNull Type type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public boolean isSegmentStart() {
|
||||
return type == Type.SEGMENT_START_AUTOMATIC || type == Type.SEGMENT_START_MANUAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user