mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-02-13 19:06:49 +01:00
Garmin: Fix workouts step count
1 cycle = 2 steps. This is most likely true for other activities, but we do not currently have a clear split (eg. strokes in rowing matches cycles, but not in swimming).
This commit is contained in:
parent
b49fe1730c
commit
96d07bb58a
@ -181,7 +181,12 @@ public class GarminWorkoutParser implements ActivitySummaryParser {
|
|||||||
summaryData.add(SWOLF_AVG, session.getAvgSwolf(), UNIT_NONE);
|
summaryData.add(SWOLF_AVG, session.getAvgSwolf(), UNIT_NONE);
|
||||||
}
|
}
|
||||||
if (session.getTotalCycles() != null) {
|
if (session.getTotalCycles() != null) {
|
||||||
summaryData.addTotal(session.getTotalCycles(), cycleUnit);
|
if (cycleUnit == ActivityKind.CycleUnit.STEPS) {
|
||||||
|
summaryData.addTotal(session.getTotalCycles() * 2, cycleUnit);
|
||||||
|
} else {
|
||||||
|
// FIXME some of the rest might also need adjusting...
|
||||||
|
summaryData.addTotal(session.getTotalCycles(), cycleUnit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (session.getTotalCalories() != null) {
|
if (session.getTotalCalories() != null) {
|
||||||
summaryData.add(CALORIES_BURNT, session.getTotalCalories(), UNIT_KCAL);
|
summaryData.add(CALORIES_BURNT, session.getTotalCalories(), UNIT_KCAL);
|
||||||
@ -217,10 +222,20 @@ public class GarminWorkoutParser implements ActivitySummaryParser {
|
|||||||
summaryData.add(STRESS_AVG, session.getAvgStress(), UNIT_NONE);
|
summaryData.add(STRESS_AVG, session.getAvgStress(), UNIT_NONE);
|
||||||
}
|
}
|
||||||
if (session.getAverageCadence() != null) {
|
if (session.getAverageCadence() != null) {
|
||||||
summaryData.addCadenceAvg(session.getAverageCadence(), cycleUnit);
|
if (cycleUnit == ActivityKind.CycleUnit.STEPS) {
|
||||||
|
summaryData.addCadenceAvg(session.getAverageCadence() * 2, cycleUnit);
|
||||||
|
} else {
|
||||||
|
// FIXME some of the rest might also need adjusting...
|
||||||
|
summaryData.addCadenceAvg(session.getAverageCadence(), cycleUnit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (session.getMaxCadence() != null) {
|
if (session.getMaxCadence() != null) {
|
||||||
summaryData.addCadenceMax(session.getMaxCadence(), cycleUnit);
|
if (cycleUnit == ActivityKind.CycleUnit.STEPS) {
|
||||||
|
summaryData.addCadenceMax(session.getMaxCadence() * 2, cycleUnit);
|
||||||
|
} else {
|
||||||
|
// FIXME some of the rest might also need adjusting...
|
||||||
|
summaryData.addCadenceMax(session.getMaxCadence(), cycleUnit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (session.getTotalAscent() != null) {
|
if (session.getTotalAscent() != null) {
|
||||||
summaryData.add(ASCENT_DISTANCE, session.getTotalAscent(), UNIT_METERS);
|
summaryData.add(ASCENT_DISTANCE, session.getTotalAscent(), UNIT_METERS);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user