mirror of
https://github.com/russok/FitoTrack.git
synced 2025-10-28 16:22:12 -07:00
#47 Wrong speed values after GPS-signal was lost for some time
This commit is contained in:
parent
1ed129778b
commit
a26d6a748b
@ -84,9 +84,7 @@ class WorkoutSaver {
|
|||||||
double length= 0;
|
double length= 0;
|
||||||
for(int i= 1; i < samples.size(); i++){
|
for(int i= 1; i < samples.size(); i++){
|
||||||
double sampleLength= samples.get(i - 1).toLatLong().sphericalDistance(samples.get(i).toLatLong());
|
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;
|
length+= sampleLength;
|
||||||
samples.get(i).speed= Math.abs(sampleLength / timeDiff);
|
|
||||||
}
|
}
|
||||||
workout.length= (int)length;
|
workout.length= (int)length;
|
||||||
workout.avgSpeed= ((double) workout.length) / ((double) workout.duration / 1000);
|
workout.avgSpeed= ((double) workout.length) / ((double) workout.duration / 1000);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user