fixed an issue with interpolated fixes shipped to client but not marked as such (bug3378)

Change-Id: I618bb8956c1a7f711ee4465c72e034f89d68e3a7
This commit is contained in:
Axel Uhl committed 2015-12-15 16:37:28 +01:00
1 parent 0a1d53202a
commit c4e63f2a1d
2 files changed
+9 -2

No files matched your search

@@ -2079,6 +2079,8 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
return vPanel;
}
// FIXME bug3378: only fetch those competitors relevant to the race displayed by this RaceMap; see http://bugzilla.sapsailing.com/bugzilla/show_bug.cgi?id=3378#c20
// could be a method on CompetitorSelectionProvider, parameterized by a RaceIdentifier, and if nothing is known about the race association, all competitors are returned as a safe default
private Iterable<CompetitorDTO> getCompetitorsToShow() {
Iterable<CompetitorDTO> result;
Iterable<CompetitorDTO> selection = competitorSelection.getSelectedCompetitors();
@@ -1733,6 +1733,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
} finally {
track.unlockAfterRead();
}
final Set<GPSFixMoving> extrapolatedFixes;
if (fixes.isEmpty()) {
// then there was no (smoothened) fix between fromTimePoint and toTimePointExcluding; estimate...
TimePoint middle = new MillisecondsTimePoint((toTimePointExcluding.asMillis()+fromTimePoint.asMillis())/2);
@@ -1744,7 +1745,12 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
logger.finest(""+competitor.getName()+": " + estimatedFix+" (estimated)");
}
fixes.add(estimatedFix);
extrapolatedFixes = Collections.singleton(estimatedFix);
} else {
extrapolatedFixes = Collections.emptySet();
}
} else {
extrapolatedFixes = Collections.emptySet();
}
Iterator<GPSFixMoving> fixIter = fixes.iterator();
if (fixIter.hasNext()) {
@@ -1774,8 +1780,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
legType = null;
}
WindDTO windDTO = wind == null ? null : createWindDTOFromAlreadyAveraged(wind, toTimePointExcluding);
GPSFixDTO fixDTO = createGPSFixDTO(fix, estimatedSpeed, windDTO, tack, legType, /* extrapolate */
false);
GPSFixDTO fixDTO = createGPSFixDTO(fix, estimatedSpeed, windDTO, tack, legType, /* extrapolate */ extrapolatedFixes.contains(fix));
fixesForCompetitor.add(fixDTO);
if (fixIter.hasNext()) {
fix = fixIter.next();