fixing bug 3332 by loading mark fixes outside of start/end of tracking from the entire device mapping interval if no fixes are found otherwise

This commit is contained in:
Axel Uhl committed 2015-10-15 19:57:52 +02:00
1 parent 63ae032bfd
commit f83116c667
1 file changed
+12 -2
@@ -3175,8 +3175,8 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
if (log != null) {
// Use the new log, that possibly contains device mappings, to load GPSFix tracks from the DB
// When this tracked race is to be serialized, wait for the loading from stores to complete.
final TimePoint startOfTimeWindowToLoad = getStartOfTracking();
final TimePoint endOfTimeWindowToLoad = getEndOfTracking();
final TimePoint startOfTimeWindowToLoad = getStartOfTracking(); // TODO consider race log's startOfTracking event
final TimePoint endOfTimeWindowToLoad = getEndOfTracking(); // TODO consider race log's endOfTracking event
loadFixesForLog(log, addLogToMap, startOfTimeWindowToLoad, endOfTimeWindowToLoad, waitForGPSFixesToLoad);
} else {
logger.severe("Got a request to attach log for an empty log!");
@@ -3235,6 +3235,16 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
try {
gpsFixStore.loadMarkTrack((DynamicGPSFixTrack<Mark, GPSFix>) getOrCreateTrack(mark),
log, mark, startOfTimeWindowToLoad, endOfTimeWindowToLoad);
if (getOrCreateTrack(mark).getFirstRawFix() == null) {
logger.fine("Loading mark positions from outside of start/end of tracking interval ("+
startOfTimeWindowToLoad+".."+endOfTimeWindowToLoad+
") 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((DynamicGPSFixTrack<Mark, GPSFix>) getOrCreateTrack(mark),
log, mark, /* startOfTimeWindowToLoad */ null, /* endOfTimeWindowToLoad */ null);
}
} catch (TransformationException | NoCorrespondingServiceRegisteredException e) {
logger.log(Level.WARNING, "Could not load track for " + mark, e);
}