Merge branch 'master' into leaderboardCache

Conflicts:
	java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/impl/DynamicTrackedRaceImpl.java
This commit is contained in:
Axel Uhl committed 2013-03-07 09:58:48 +04:00
commit 8c19e622e2
2 files changed
+14 -3

No files matched your search

@@ -568,10 +568,13 @@ DynamicTrackedRace, GPSTrackListener<Competitor, GPSFixMoving> {
@Override
public void recordWind(Wind wind, WindSource windSource) {
// TODO check what a good filter is; remember that start/end of tracking may change over time; what if we have discarded valuable wind fixes?
TimePoint startOfTracking = getStartOfTracking();
TimePoint endOfTracking = getEndOfTracking();
// record wind fix only if it's still within reasonable time after the tracking for the race has ended or the race tracking hasn't ended yet
if (endOfTracking == null
|| endOfTracking.plus(TimingConstants.IS_LIVE_GRACE_PERIOD_IN_MILLIS).before(wind.getTimePoint())) {
if (startOfTracking == null || endOfTracking == null
|| (startOfTracking.before(wind.getTimePoint()) &&
endOfTracking.plus(TimingConstants.IS_LIVE_GRACE_PERIOD_IN_MILLIS).before(wind.getTimePoint()))) {
getOrCreateWindTrack(windSource).add(wind);
updated(/* time point */null); // wind events shouldn't advance race time
triggerManeuverCacheRecalculationForAllCompetitors();
@@ -1604,7 +1604,15 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
getRace().getCourse().lockForRead(); // ensure the course doesn't change, particularly lose the leg we're interested in, while we're running
try {
for (Competitor competitor : getRace().getCompetitors()) {
TrackedLegOfCompetitor leg = getTrackedLeg(competitor, timePoint);
TrackedLegOfCompetitor leg;
try {
leg = getTrackedLeg(competitor, timePoint);
} catch (IllegalArgumentException iae) {
logger.warning("Caught "+iae+" during wind estimation; ignoring seemingly broken leg");
logger.throwing(TrackedRaceImpl.class.getName(), "clusterBearingsByLegType", iae);
// supposedly, we got a "Waypoint X isn't start of any leg in Y" exception; leg not found
leg = null;
}
// if bearings was set to null this indicates there was an exception; no need for further calculations, return null
if (bearings != null && leg != null) {
TrackedLeg trackedLeg = getTrackedLeg(leg.getLeg());