1
0
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:
Arjan Schrijver 2023-06-19 15:57:09 +02:00
parent a5868f8f00
commit 7c5cd4c032

View File

@ -53,7 +53,7 @@ public class WorkoutRequestHandler {
addStateResponse(workoutResponse, "success", "");
OpenTracksController.startRecording(context, activityKind);
} 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;
LOG.info("Workout distance requested, returning " + distanceCM + " cm, " + timeSecs + " sec");
workoutResponse.put("workoutApp._.config.gps", new JSONObject()