mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-24 22:48:34 +00:00
Fixed up/to fix ranges for gps fix store (marks)
This commit is contained in:
+12
-1
@@ -184,7 +184,18 @@ public class RaceLogGPSFixTracker extends AbstractRaceLogFixTracker {
|
||||
protected void mappingAdded(DeviceMapping<Mark> mapping) {
|
||||
DynamicGPSFixTrack<Mark, GPSFix> track = trackedRace.getOrCreateTrack(mapping.getMappedTo());
|
||||
try {
|
||||
gpsFixStore.loadMarkTrack(track, mapping);
|
||||
TimePoint from = getStartOfTracking();
|
||||
TimePoint to = getEndOfTracking();
|
||||
gpsFixStore.loadMarkTrack(track, mapping, from, to);
|
||||
if (track.getFirstRawFix() == null) {
|
||||
logger.fine("Loading mark positions from outside of start/end of tracking interval (" + from + ".."
|
||||
+ to + ") because no fixes were found in that interval");
|
||||
// got an empty track for the mark; try again without constraining the mapping interval
|
||||
// by start/end of tracking to at least attempt to get fixes at all in case there were any
|
||||
// within the device mapping interval specified
|
||||
gpsFixStore.loadMarkTrack(track, mapping, /* startOfTimeWindowToLoad */ null,
|
||||
/* endOfTimeWindowToLoad */ null);
|
||||
}
|
||||
} catch (TransformationException | NoCorrespondingServiceRegisteredException e) {
|
||||
logger.log(Level.WARNING, "Could not load mark track " + mapping.getMappedTo());
|
||||
}
|
||||
|
||||
+5
-2
@@ -92,9 +92,12 @@ public class GPSFixStoreImpl implements GPSFixStore {
|
||||
|
||||
|
||||
@Override
|
||||
public void loadMarkTrack(DynamicGPSFixTrack<Mark, GPSFix> track, DeviceMapping<Mark> mapping)
|
||||
public void loadMarkTrack(DynamicGPSFixTrack<Mark, GPSFix> track, DeviceMapping<Mark> mapping, TimePoint start,
|
||||
TimePoint end)
|
||||
throws TransformationException, NoCorrespondingServiceRegisteredException {
|
||||
loadTrack(track, mapping.getDevice(), mapping.getTimeRange().from(), mapping.getTimeRange().to(), true /*inclusive*/);
|
||||
final TimePoint from = Util.getLatestOfTimePoints(start, mapping.getTimeRange().from());
|
||||
final TimePoint to = Util.getEarliestOfTimePoints(end, mapping.getTimeRange().to());
|
||||
loadTrack(track, mapping.getDevice(), from, to, true /* inclusive */);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public enum EmptyGPSFixStore implements GPSFixStore {
|
||||
|
||||
@Override
|
||||
public void loadMarkTrack(DynamicGPSFixTrack<Mark, GPSFix> track,
|
||||
DeviceMapping<Mark> mapping) {
|
||||
DeviceMapping<Mark> mapping, TimePoint start, TimePoint end) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -56,7 +56,8 @@ public interface GPSFixStore {
|
||||
/**
|
||||
* Load all fixes that correspond to the {@code mapping}.
|
||||
*/
|
||||
void loadMarkTrack(DynamicGPSFixTrack<Mark, GPSFix> track, DeviceMapping<Mark> mapping) throws TransformationException,
|
||||
void loadMarkTrack(DynamicGPSFixTrack<Mark, GPSFix> track, DeviceMapping<Mark> mapping, TimePoint start,
|
||||
TimePoint end) throws TransformationException,
|
||||
NoCorrespondingServiceRegisteredException;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user