#47 Wrong speed values after GPS-signal was lost for some time

This commit is contained in:
jannis 2020-03-03 16:00:54 +01:00
parent 1ed129778b
commit a26d6a748b

View File

@ -84,9 +84,7 @@ class WorkoutSaver {
double length= 0;
for(int i= 1; i < samples.size(); i++){
double sampleLength= samples.get(i - 1).toLatLong().sphericalDistance(samples.get(i).toLatLong());
long timeDiff= (samples.get(i).relativeTime - samples.get(i - 1).relativeTime) / 1000;
length+= sampleLength;
samples.get(i).speed= Math.abs(sampleLength / timeDiff);
}
workout.length= (int)length;
workout.avgSpeed= ((double) workout.length) / ((double) workout.duration / 1000);