1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-09 03:37:03 +01:00

Garmin: add GENERIC activity and use it for imported GPX files

This commit is contained in:
Daniele Gobbetti 2024-08-18 12:40:16 +02:00
parent 8a72bf8895
commit 51a0745b06
2 changed files with 2 additions and 1 deletions

View File

@ -21,7 +21,7 @@ import nodomain.freeyourgadget.gadgetbridge.util.gpx.model.GpxTrackSegment;
public class GpxRouteFileConverter { public class GpxRouteFileConverter {
private static final Logger LOG = LoggerFactory.getLogger(GpxRouteFileConverter.class); private static final Logger LOG = LoggerFactory.getLogger(GpxRouteFileConverter.class);
final double speed = 1.4; // m/s // TODO: make this configurable (and activity dependent?) final double speed = 1.4; // m/s // TODO: make this configurable (and activity dependent?)
final int activity = GarminSport.RUN.getType(); //TODO: make this configurable final int activity = GarminSport.GENERIC.getType(); //TODO: make this configurable
private final long timestamp; private final long timestamp;
private final GpxFile gpxFile; private final GpxFile gpxFile;
private FitFile convertedFile; private FitFile convertedFile;

View File

@ -8,6 +8,7 @@ import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
// Garmin API doc (https://developer.garmin.com/connect-iq/api-docs/Toybox/Activity.html) // Garmin API doc (https://developer.garmin.com/connect-iq/api-docs/Toybox/Activity.html)
// and FIT files // and FIT files
public enum GarminSport { public enum GarminSport {
GENERIC(0, 0, ActivityKind.ACTIVITY),
NAVIGATE(0, 50, ActivityKind.NAVIGATE), NAVIGATE(0, 50, ActivityKind.NAVIGATE),
RUN(1, 0, ActivityKind.RUNNING), RUN(1, 0, ActivityKind.RUNNING),
TREADMILL(1, 1, ActivityKind.TREADMILL), TREADMILL(1, 1, ActivityKind.TREADMILL),