mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-23 14:08:40 +00:00
forcing a mark fix into the track for RaceLogTracking if it is the first or replaces an existing at the same time point
Change-Id: I352c05808e3dad0988a4507f3f13a4652ddc0b71
This commit is contained in:
+9
-1
@@ -532,7 +532,15 @@ public class RaceLogRaceTracker implements RaceTracker, GPSFixReceivedListener {
|
||||
for (DeviceMapping<Mark> mapping : markMappingsByDevices.get(device)) {
|
||||
Mark mark = mapping.getMappedTo();
|
||||
if (mapping.getTimeRange().includes(timePoint)) {
|
||||
trackedRace.recordFix(mark, fix);
|
||||
final DynamicGPSFixTrack<Mark, GPSFix> markTrack = trackedRace.getOrCreateTrack(mark);
|
||||
final GPSFix firstFixAtOrAfter;
|
||||
if (Util.isEmpty(markTrack.getRawFixes()) ||
|
||||
(firstFixAtOrAfter=markTrack.getFirstFixAtOrAfter(timePoint)) != null &&
|
||||
firstFixAtOrAfter.getTimePoint().equals(timePoint)) {
|
||||
trackedRace.recordFix(mark, fix, /* only when in tracking interval */ false); // force fix into track
|
||||
} else {
|
||||
trackedRace.recordFix(mark, fix);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user