mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-19 20:25:31 +00:00
started with an implementation of the tracking APIs based on the new TracTrac Result API
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
- Create an alternative implementation of TrackedLeg, TrackedLegOfCompetitor, TrackedRace
|
||||
based on LiveResult and MarkResult
|
||||
|
||||
- Include declination stuff into processing of Expedition wind data
|
||||
- Include declination stuff into processing of Expedition wind data. Need smart caching,
|
||||
probably rounding to full degrees.
|
||||
|
||||
- Clarify deploy / install / upgrade process, maybe using "mvn deploy" and a maven
|
||||
"repository" on the target host
|
||||
@@ -12,9 +13,11 @@
|
||||
|
||||
- Open test server firewall ports or forward a specific DNS name to test server port
|
||||
|
||||
- Test fail-over in case one of the two Java VM fails
|
||||
|
||||
- Pass test server info to BeTomorrow so they can start their wind test. Include
|
||||
information about the query API by which they can determine the success of the
|
||||
wind update
|
||||
|
||||
|
||||
- Set up two Expedition machines with RF and UMTS transmission, test killing one
|
||||
|
||||
|
||||
Binary file not shown.
+38
@@ -0,0 +1,38 @@
|
||||
package com.sap.sailing.domain.tractracadapter.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Leg;
|
||||
import com.sap.sailing.domain.tracking.TrackedLeg;
|
||||
import com.sap.sailing.domain.tracking.TrackedLegOfCompetitor;
|
||||
|
||||
public class TracTracTrackedLegImpl implements TrackedLeg {
|
||||
private final Leg leg;
|
||||
private final Map<Competitor, TrackedLegOfCompetitor> trackedLegsOfCompetitors;
|
||||
|
||||
public TracTracTrackedLegImpl(TracTracTrackedRaceImpl trackedRace, Leg leg, Iterable<Competitor> competitors) {
|
||||
this.leg = leg;
|
||||
trackedLegsOfCompetitors = new HashMap<Competitor, TrackedLegOfCompetitor>();
|
||||
for (Competitor competitor : competitors) {
|
||||
trackedLegsOfCompetitors.put(competitor, new TracTracTrackedLegOfCompetitor(trackedRace, leg, competitor));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Leg getLeg() {
|
||||
return leg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<TrackedLegOfCompetitor> getTrackedLegsOfCompetitors() {
|
||||
return trackedLegsOfCompetitors.values();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TrackedLegOfCompetitor getTrackedLeg(Competitor competitor) {
|
||||
return trackedLegsOfCompetitors.get(competitor);
|
||||
}
|
||||
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
package com.sap.sailing.domain.tractracadapter.impl;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Distance;
|
||||
import com.sap.sailing.domain.base.Leg;
|
||||
import com.sap.sailing.domain.base.Speed;
|
||||
import com.sap.sailing.domain.base.TimePoint;
|
||||
import com.sap.sailing.domain.tracking.NoWindException;
|
||||
import com.sap.sailing.domain.tracking.TrackedLegOfCompetitor;
|
||||
|
||||
public class TracTracTrackedLegOfCompetitor implements TrackedLegOfCompetitor {
|
||||
|
||||
public TracTracTrackedLegOfCompetitor(TracTracTrackedRaceImpl trackedRace, Leg leg, Competitor competitor) {
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public Leg getLeg() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Competitor getCompetitor() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTimeInMilliSeconds() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getDistanceTraveled(TimePoint timePoint) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getWindwardDistanceToGo(TimePoint timePoint) throws NoWindException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Speed getAverageVelocityMadeGood(TimePoint timePoint) throws NoWindException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Speed getAverageSpeedOverGround(TimePoint timePoint) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Speed getMaximumSpeedOverGround() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumberOfTacks(TimePoint timePoint) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumberOfJibes(TimePoint timePoint) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumberOfDirectionChanges(TimePoint timePoint) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRank(TimePoint timePoint) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getGapToLeaderInSeconds(TimePoint timePoint) throws NoWindException {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasStartedLeg(TimePoint timePoint) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasFinishedLeg(TimePoint timePoint) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Speed getVelocityMadeGood(TimePoint timePoint) throws NoWindException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getEstimatedTimeToNextMarkInSeconds(TimePoint timePoint) throws NoWindException {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
package com.sap.sailing.domain.tractracadapter.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.sap.sailing.domain.base.Buoy;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Distance;
|
||||
import com.sap.sailing.domain.base.Leg;
|
||||
import com.sap.sailing.domain.base.Position;
|
||||
import com.sap.sailing.domain.base.RaceDefinition;
|
||||
import com.sap.sailing.domain.base.TimePoint;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
import com.sap.sailing.domain.tracking.DynamicTrackedRace;
|
||||
import com.sap.sailing.domain.tracking.GPSFix;
|
||||
import com.sap.sailing.domain.tracking.GPSFixTrack;
|
||||
import com.sap.sailing.domain.tracking.MarkPassing;
|
||||
import com.sap.sailing.domain.tracking.TrackedEvent;
|
||||
import com.sap.sailing.domain.tracking.TrackedLeg;
|
||||
import com.sap.sailing.domain.tracking.TrackedLegOfCompetitor;
|
||||
import com.sap.sailing.domain.tracking.Wind;
|
||||
import com.sap.sailing.domain.tracking.WindSource;
|
||||
import com.sap.sailing.domain.tracking.WindTrack;
|
||||
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRaceImpl;
|
||||
|
||||
public class TracTracTrackedRaceImpl extends DynamicTrackedRaceImpl implements DynamicTrackedRace {
|
||||
|
||||
public TracTracTrackedRaceImpl(TrackedEvent trackedEvent, RaceDefinition race,
|
||||
long millisecondsOverWhichToAverageWind, long millisecondsOverWhichToAverageSpeed) {
|
||||
super(trackedEvent, race, millisecondsOverWhichToAverageWind, millisecondsOverWhichToAverageSpeed);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TrackedLeg createTrackedLeg(RaceDefinition race, Leg leg) {
|
||||
return new TracTracTrackedLegImpl(this, leg, race.getCompetitors());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TrackedLegOfCompetitor getCurrentLeg(Competitor competitor) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TrackedLeg getCurrentLeg(TimePoint timePoint) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRankDifference(Competitor competitor, Leg leg, TimePoint timePoint) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRank(Competitor competitor) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRank(Competitor competitor, TimePoint timePoint) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Distance getStartAdvantage(Competitor competitor, double secondsIntoTheRace) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<MarkPassing> getMarkPassingsInOrder(Waypoint waypoint) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkPassing getMarkPassing(Competitor competitor, Waypoint waypoint) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GPSFixTrack<Buoy, GPSFix> getTrack(Buoy buoy) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Wind getWind(Position p, TimePoint at) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWindSource(WindSource windSource) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public WindSource getWindSource() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WindTrack getWindTrack(WindSource windSource) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void waitForNextUpdate(int sinceUpdate) throws InterruptedException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public TimePoint getStartOfTracking() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TimePoint getTimePointOfNewestEvent() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.sap.sailing.domain.tracking;
|
||||
|
||||
|
||||
|
||||
public interface DynamicTrackedLeg extends TrackedLeg {
|
||||
void completed(MarkPassing markPassing);
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.sap.sailing.domain.tracking;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.TimePoint;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
|
||||
public interface DynamicTrackedRace extends TrackedRace {
|
||||
void recordFix(Competitor competitor, GPSFixMoving fix);
|
||||
@@ -18,12 +17,6 @@ public interface DynamicTrackedRace extends TrackedRace {
|
||||
|
||||
// TODO need another listener protocol for general changes in ranking and leg completion
|
||||
|
||||
@Override
|
||||
DynamicTrackedLeg getTrackedLegFinishingAt(Waypoint endOfLeg);
|
||||
|
||||
@Override
|
||||
DynamicTrackedLeg getTrackedLegStartingAt(Waypoint startOfLeg);
|
||||
|
||||
/**
|
||||
* Updates all mark passings for <code>competitor</code> for this race. The
|
||||
* mark passings must be provided in the order of the race's course and in
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
package com.sap.sailing.domain.tracking.impl;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Leg;
|
||||
import com.sap.sailing.domain.tracking.DynamicTrackedLeg;
|
||||
import com.sap.sailing.domain.tracking.MarkPassing;
|
||||
|
||||
public class DynamicTrackedLegImpl extends TrackedLegImpl implements DynamicTrackedLeg {
|
||||
|
||||
public DynamicTrackedLegImpl(TrackedRaceImpl trackedRace, Leg leg, Iterable<Competitor> competitors) {
|
||||
super(trackedRace, leg, competitors);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void completed(MarkPassing passing) {
|
||||
// TODO implement DynamicTrackedLegImpl.completed
|
||||
}
|
||||
|
||||
}
|
||||
-17
@@ -7,12 +7,10 @@ import java.util.NavigableSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Leg;
|
||||
import com.sap.sailing.domain.base.RaceDefinition;
|
||||
import com.sap.sailing.domain.base.TimePoint;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
import com.sap.sailing.domain.tracking.DynamicTrack;
|
||||
import com.sap.sailing.domain.tracking.DynamicTrackedLeg;
|
||||
import com.sap.sailing.domain.tracking.DynamicTrackedRace;
|
||||
import com.sap.sailing.domain.tracking.GPSFixMoving;
|
||||
import com.sap.sailing.domain.tracking.MarkPassing;
|
||||
@@ -64,21 +62,6 @@ public class DynamicTrackedRaceImpl extends TrackedRaceImpl implements
|
||||
notifyListeners(fix, this, competitor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicTrackedLeg getTrackedLegFinishingAt(Waypoint endOfLeg) {
|
||||
return (DynamicTrackedLeg) super.getTrackedLegFinishingAt(endOfLeg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicTrackedLeg getTrackedLegStartingAt(Waypoint startOfLeg) {
|
||||
return (DynamicTrackedLeg) super.getTrackedLegStartingAt(startOfLeg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicTrackedLeg getTrackedLeg(Leg leg) {
|
||||
return (DynamicTrackedLeg) super.getTrackedLeg(leg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMarkPassings(Competitor competitor, Iterable<MarkPassing> markPassings) {
|
||||
clearMarkPassings(competitor);
|
||||
|
||||
+5
-1
@@ -76,7 +76,7 @@ public class TrackedRaceImpl implements TrackedRace {
|
||||
this.race = race;
|
||||
LinkedHashMap<Leg, TrackedLeg> trackedLegsMap = new LinkedHashMap<Leg, TrackedLeg>();
|
||||
for (Leg leg : race.getCourse().getLegs()) {
|
||||
trackedLegsMap.put(leg, new DynamicTrackedLegImpl(this, leg, race.getCompetitors()));
|
||||
trackedLegsMap.put(leg, createTrackedLeg(race, leg));
|
||||
}
|
||||
trackedLegs = trackedLegsMap;
|
||||
markPassingsForCompetitor = new HashMap<Competitor, NavigableSet<MarkPassing>>();
|
||||
@@ -95,6 +95,10 @@ public class TrackedRaceImpl implements TrackedRace {
|
||||
}
|
||||
currentWindSource = WindSource.EXPEDITION;
|
||||
}
|
||||
|
||||
protected TrackedLeg createTrackedLeg(RaceDefinition race, Leg leg) {
|
||||
return new TrackedLegImpl(this, leg, race.getCompetitors());
|
||||
}
|
||||
|
||||
protected NavigableSet<MarkPassing> getMarkPassings(Competitor competitor) {
|
||||
return markPassingsForCompetitor.get(competitor);
|
||||
|
||||
Reference in New Issue
Block a user