mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-30 17:36:40 +00:00
Merge branch 'master' of ssh://195.227.10.246/home/trac/git
This commit is contained in:
commit
b5a896184f
4 files changed
+22
-2
No files matched your search
@@ -137,8 +137,7 @@ public interface TrackedRace {
|
||||
WindTrack getWindTrack(WindSource windSource);
|
||||
|
||||
/**
|
||||
* Waits until {@link #getUpdateCount()} is after <code>since</code>.
|
||||
* @param sinceUpdate TODO
|
||||
* Waits until {@link #getUpdateCount()} is after <code>sinceUpdate</code>.
|
||||
*/
|
||||
void waitForNextUpdate(int sinceUpdate) throws InterruptedException;
|
||||
|
||||
@@ -149,4 +148,10 @@ public interface TrackedRace {
|
||||
NavigableSet<MarkPassing> getMarkPassings(Competitor competitor);
|
||||
|
||||
void removeWind(Wind wind, WindSource windSource);
|
||||
|
||||
/**
|
||||
* Time stamp that the last event received from the underlying push service carried on it.
|
||||
* Note that these times may not increase monotonically.
|
||||
*/
|
||||
TimePoint getTimePointOfLastEvent();
|
||||
}
|
||||
+7
@@ -46,6 +46,7 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
|
||||
private TimePoint start;
|
||||
private TimePoint finish;
|
||||
private TimePoint timePointOfNewestEvent;
|
||||
private TimePoint timePointOfLastEvent;
|
||||
private int updateCount;
|
||||
|
||||
private final Map<TimePoint, TreeSet<Competitor>> competitorRankings;
|
||||
@@ -352,6 +353,11 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
|
||||
public TimePoint getTimePointOfNewestEvent() {
|
||||
return timePointOfNewestEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TimePoint getTimePointOfLastEvent() {
|
||||
return timePointOfLastEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param timeOfEvent may be <code>null</code> meaning to only unblock waiters but not update any time points
|
||||
@@ -366,6 +372,7 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
|
||||
if (startOfTracking == null || startOfTracking.compareTo(timeOfEvent) > 0) {
|
||||
startOfTracking = timeOfEvent;
|
||||
}
|
||||
timePointOfLastEvent = timeOfEvent;
|
||||
}
|
||||
notifyAll();
|
||||
}
|
||||
|
||||
+6
@@ -243,4 +243,10 @@ public class MockedTrackedRace implements DynamicTrackedRace {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public TimePoint getTimePointOfLastEvent() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -200,6 +200,8 @@ public class ModeratorApp extends Servlet {
|
||||
.asMillis());
|
||||
jsonRace.put("timeofnewestevent", trackedRace.getTimePointOfNewestEvent() == null ? 0l : trackedRace
|
||||
.getTimePointOfNewestEvent().asMillis());
|
||||
jsonRace.put("timeoflastevent", trackedRace.getTimePointOfLastEvent() == null ? 0l : trackedRace
|
||||
.getTimePointOfLastEvent().asMillis());
|
||||
jsonRace.put("updatecount", trackedRace.getUpdateCount());
|
||||
Position positionForWind = null;
|
||||
TrackedLeg currentLeg = trackedRace.getCurrentLeg(timePoint);
|
||||
|
||||
Reference in new issue
Block a user