mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-25 19:36:50 +01:00
Fossil/Skagen Hybrids: Increase accuracy of workout distance calculation
This commit is contained in:
parent
a5868f8f00
commit
7c5cd4c032
@ -53,7 +53,7 @@ public class WorkoutRequestHandler {
|
|||||||
addStateResponse(workoutResponse, "success", "");
|
addStateResponse(workoutResponse, "success", "");
|
||||||
OpenTracksController.startRecording(context, activityKind);
|
OpenTracksController.startRecording(context, activityKind);
|
||||||
} else if (workoutRequest.optString("type").equals("req_distance")) {
|
} else if (workoutRequest.optString("type").equals("req_distance")) {
|
||||||
long timeSecs = GBApplication.app().getOpenTracksObserver().getTimeMillisChange() / 1000;
|
long timeSecs = Math.round(GBApplication.app().getOpenTracksObserver().getTimeMillisChange() / 1000f);
|
||||||
float distanceCM = GBApplication.app().getOpenTracksObserver().getDistanceMeterChange() * 100;
|
float distanceCM = GBApplication.app().getOpenTracksObserver().getDistanceMeterChange() * 100;
|
||||||
LOG.info("Workout distance requested, returning " + distanceCM + " cm, " + timeSecs + " sec");
|
LOG.info("Workout distance requested, returning " + distanceCM + " cm, " + timeSecs + " sec");
|
||||||
workoutResponse.put("workoutApp._.config.gps", new JSONObject()
|
workoutResponse.put("workoutApp._.config.gps", new JSONObject()
|
||||||
|
Loading…
Reference in New Issue
Block a user