mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-16 07:10:48 +00:00
Merge branch 'master' of ssh://sapsailing.com/home/trac/git into bug4412
This commit is contained in:
commit
2ed23d73a6
17 files changed
+174
-141
No files matched your search
+3
-2
@@ -558,7 +558,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
.size()];
|
||||
int i = 0;
|
||||
for (Object discardingThresholdAsObject : dbDiscardIndexResultsStartingWithHowManyRaces) {
|
||||
discardIndexResultsStartingWithHowManyRaces[i++] = (Integer) discardingThresholdAsObject;
|
||||
discardIndexResultsStartingWithHowManyRaces[i++] = ((Number) discardingThresholdAsObject).intValue();
|
||||
}
|
||||
result = new ThresholdBasedResultDiscardingRuleImpl(discardIndexResultsStartingWithHowManyRaces);
|
||||
}
|
||||
@@ -1266,8 +1266,9 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
logger.log(Level.WARNING, "Error loading racing procedure configration for regatta.", e);
|
||||
}
|
||||
}
|
||||
final Double buoyZoneRadiusInHullLengths = (Double) dbRegatta
|
||||
final Number buoyZoneRadiusInHullLengthsAsNumber = (Number) dbRegatta
|
||||
.get(FieldNames.REGATTA_BUOY_ZONE_RADIUS_IN_HULL_LENGTHS.name());
|
||||
final Double buoyZoneRadiusInHullLengths = buoyZoneRadiusInHullLengthsAsNumber==null?null:(Double) buoyZoneRadiusInHullLengthsAsNumber.doubleValue();
|
||||
final Boolean useStartTimeInference = (Boolean) dbRegatta
|
||||
.get(FieldNames.REGATTA_USE_START_TIME_INFERENCE.name());
|
||||
final Boolean controlTrackingFromStartAndFinishTimes = (Boolean) dbRegatta
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@ import com.sap.sailing.domain.base.Regatta;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
import com.sap.sailing.domain.base.impl.CourseImpl;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFix;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFixMoving;
|
||||
import com.sap.sailing.domain.tracking.DynamicTrackedRace;
|
||||
import com.sap.sailing.domain.tracking.DynamicTrackedRegatta;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
@@ -55,7 +56,7 @@ public class MarkPassingCalculatorTest {
|
||||
mpc.suspend();
|
||||
mpc.enqueueUpdate(new StorePositionUpdateStrategy() {
|
||||
@Override
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes, Map<Mark, List<GPSFix>> markFixes,
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes, Map<Mark, List<GPSFix>> markFixes,
|
||||
List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints, IntHolder smallestChangedWaypointIndex,
|
||||
List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings,
|
||||
List<Pair<Competitor, Integer>> removedMarkPassings, List<Pair<Competitor, Integer>> suppressedMarkPassings,
|
||||
|
||||
+1
-2
@@ -25,7 +25,6 @@ import com.sap.sailing.domain.common.WindSourceType;
|
||||
import com.sap.sailing.domain.common.impl.KnotSpeedWithBearingImpl;
|
||||
import com.sap.sailing.domain.common.impl.WindImpl;
|
||||
import com.sap.sailing.domain.common.impl.WindSourceImpl;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFix;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFixMoving;
|
||||
import com.sap.sailing.domain.markpassingcalculation.Candidate;
|
||||
import com.sap.sailing.domain.markpassingcalculation.CandidateChooser;
|
||||
@@ -277,7 +276,7 @@ public abstract class AbstractMarkPassingTest extends OnlineTracTracBasedTest {
|
||||
|
||||
protected void calculateMarkPassingsForPartialTrack(Competitor c, final TimePoint upToTimePoint,
|
||||
CandidateFinder finder, CandidateChooser chooser) {
|
||||
List<GPSFix> fixes = new ArrayList<GPSFix>();
|
||||
List<GPSFixMoving> fixes = new ArrayList<>();
|
||||
try {
|
||||
getTrackedRace().getTrack(c).lockForRead();
|
||||
for (GPSFixMoving fix : getTrackedRace().getTrack(c).getFixes()) {
|
||||
|
||||
+1
-2
@@ -14,7 +14,6 @@ import org.junit.Test;
|
||||
import com.sap.sailing.domain.common.SpeedWithBearing;
|
||||
import com.sap.sailing.domain.common.impl.DegreePosition;
|
||||
import com.sap.sailing.domain.common.impl.KnotSpeedWithBearingImpl;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFix;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFixMoving;
|
||||
import com.sap.sailing.domain.common.tracking.impl.GPSFixMovingImpl;
|
||||
import com.sap.sailing.domain.markpassingcalculation.Candidate;
|
||||
@@ -56,7 +55,7 @@ public class MarkPassingCalculatorPerformanceTest extends AbstractMockedRaceMark
|
||||
@Test
|
||||
public void testFinder() {
|
||||
CandidateFinder f = new CandidateFinderImpl(race);
|
||||
List<GPSFix> fixesAdded = new ArrayList<>();
|
||||
List<GPSFixMoving> fixesAdded = new ArrayList<>();
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
GPSFixMoving fix = rndFix();
|
||||
race.recordFix(ron, fix);
|
||||
|
||||
+5
-6
@@ -8,8 +8,8 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.NavigableSet;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.domain.base.Course;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
@@ -17,7 +17,6 @@ import com.sap.sailing.domain.base.impl.WaypointImpl;
|
||||
import com.sap.sailing.domain.common.PassingInstruction;
|
||||
import com.sap.sailing.domain.common.impl.DegreePosition;
|
||||
import com.sap.sailing.domain.common.impl.KnotSpeedWithBearingImpl;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFix;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFixMoving;
|
||||
import com.sap.sailing.domain.common.tracking.impl.GPSFixMovingImpl;
|
||||
import com.sap.sailing.domain.markpassingcalculation.Candidate;
|
||||
@@ -53,7 +52,7 @@ public class MarkPassingWhiteBoxTest extends AbstractMockedRaceMarkPassingTest {
|
||||
race.recordFix(ron, fix2);
|
||||
CandidateFinder finder = new CandidateFinderImpl(race);
|
||||
CandidateChooser chooser = new CandidateChooserImpl(race);
|
||||
List<GPSFix> fixes = new ArrayList<GPSFix>();
|
||||
List<GPSFixMoving> fixes = new ArrayList<>();
|
||||
fixes.add(fix1);
|
||||
fixes.add(fix2);
|
||||
Util.Pair<Iterable<Candidate>, Iterable<Candidate>> candidateDeltas = finder.getCandidateDeltas(ron, fixes);
|
||||
@@ -95,7 +94,7 @@ public class MarkPassingWhiteBoxTest extends AbstractMockedRaceMarkPassingTest {
|
||||
|
||||
race.recordFix(tom, fix1);
|
||||
race.recordFix(tom, fix3);
|
||||
List<GPSFix> fixes = new ArrayList<>();
|
||||
List<GPSFixMoving> fixes = new ArrayList<>();
|
||||
fixes.add(fix1);
|
||||
fixes.add(fix3);
|
||||
Util.Pair<Iterable<Candidate>, Iterable<Candidate>> cans = finder.getCandidateDeltas(tom, fixes);
|
||||
@@ -126,7 +125,7 @@ public class MarkPassingWhiteBoxTest extends AbstractMockedRaceMarkPassingTest {
|
||||
CandidateFinderImpl finder = new CandidateFinderImpl(race);
|
||||
race.recordFix(tom, fix1);
|
||||
race.recordFix(tom, fix2);
|
||||
List<GPSFix> fixes = new ArrayList<>();
|
||||
List<GPSFixMoving> fixes = new ArrayList<>();
|
||||
fixes.addAll(Arrays.asList(fix1, fix2));
|
||||
Util.Pair<Iterable<Candidate>, Iterable<Candidate>> cans = finder.getCandidateDeltas(tom, fixes);
|
||||
Double inFront = cans.getA().iterator().next().getProbability();
|
||||
@@ -194,7 +193,7 @@ public class MarkPassingWhiteBoxTest extends AbstractMockedRaceMarkPassingTest {
|
||||
race.recordFix(ben, fix1);
|
||||
race.recordFix(ben, fix2);
|
||||
race.recordFix(ben, fix3);
|
||||
List<GPSFix> fixes = new ArrayList<>();
|
||||
List<GPSFixMoving> fixes = new ArrayList<>();
|
||||
fixes.addAll(Arrays.asList(fix1, fix2, fix3));
|
||||
Util.Pair<Iterable<Candidate>, Iterable<Candidate>> cans = finder.getCandidateDeltas(ben, fixes);
|
||||
Candidate inFront = Util.get(cans.getA(), 0);
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@ import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFix;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFixMoving;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
@@ -24,7 +25,7 @@ public interface CandidateFinder {
|
||||
* fixes.
|
||||
* @return new {@link Candidate}s and those that should be removed.
|
||||
*/
|
||||
Util.Pair<Iterable<Candidate>, Iterable<Candidate>> getCandidateDeltas(Competitor c, Iterable<GPSFix> fixes);
|
||||
Util.Pair<Iterable<Candidate>, Iterable<Candidate>> getCandidateDeltas(Competitor c, Iterable<GPSFixMoving> fixes);
|
||||
|
||||
/**
|
||||
* When initializing or refreshing the calculator, the whole race until now is evaluated. For that purpose all of the
|
||||
@@ -40,7 +41,7 @@ public interface CandidateFinder {
|
||||
* @return The fixes for each Competitor that may have changed their status as a {@link Candidate} because of new
|
||||
* mark fixes..
|
||||
*/
|
||||
Map<Competitor, List<GPSFix>> calculateFixesAffectedByNewMarkFixes(Map<Mark, List<GPSFix>> newMarkFixes);
|
||||
Map<Competitor, List<GPSFixMoving>> calculateFixesAffectedByNewMarkFixes(Map<Mark, List<GPSFix>> newMarkFixes);
|
||||
|
||||
/**
|
||||
* Notifies this finder about the race's start time having changed. The finder is only interested in the non-inferred
|
||||
|
||||
+13
-12
@@ -18,6 +18,7 @@ import com.sap.sailing.domain.base.Course;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFix;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFixMoving;
|
||||
import com.sap.sailing.domain.markpassingcalculation.impl.CandidateChooserImpl;
|
||||
import com.sap.sailing.domain.markpassingcalculation.impl.CandidateFinderImpl;
|
||||
import com.sap.sailing.domain.tracking.DynamicTrackedRace;
|
||||
@@ -61,7 +62,7 @@ public class MarkPassingCalculator {
|
||||
*/
|
||||
private final StorePositionUpdateStrategy endMarker = new StorePositionUpdateStrategy() {
|
||||
@Override
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes,
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes,
|
||||
Map<Mark, List<GPSFix>> markFixes, List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints,
|
||||
IntHolder smallestChangedWaypointIndex, List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings,
|
||||
List<Pair<Competitor, Integer>> removedMarkPassings,
|
||||
@@ -229,7 +230,7 @@ public class MarkPassingCalculator {
|
||||
try {
|
||||
logger.fine("MarkPassingCalculator is listening on race "+raceName);
|
||||
boolean finished = false;
|
||||
final Map<Competitor, List<GPSFix>> competitorFixes = new HashMap<>();
|
||||
final Map<Competitor, List<GPSFixMoving>> competitorFixes = new HashMap<>();
|
||||
final Map<Mark, List<GPSFix>> markFixes = new HashMap<>();
|
||||
final List<Waypoint> addedWaypoints = new ArrayList<>();
|
||||
final List<Waypoint> removedWaypoints = new ArrayList<>();
|
||||
@@ -361,22 +362,22 @@ public class MarkPassingCalculator {
|
||||
* {@link CandidateChooser} to calculate any new {@link MarkPassing}s (see {@link ComputeMarkPassings}).
|
||||
*
|
||||
*/
|
||||
private void computeMarkPasses(Map<Competitor, List<GPSFix>> newCompetitorFixes,
|
||||
private void computeMarkPasses(Map<Competitor, List<GPSFixMoving>> newCompetitorFixes,
|
||||
Map<Mark, List<GPSFix>> newMarkFixes) {
|
||||
logger.finer("Calculating markpassings for race "+raceName+" with " + newCompetitorFixes.size() + " new competitor Fixes and "
|
||||
+ newMarkFixes.size() + " new mark fixes.");
|
||||
Map<Competitor, Set<GPSFix>> combinedCompetitorFixes = new HashMap<>();
|
||||
Map<Competitor, Set<GPSFixMoving>> combinedCompetitorFixes = new HashMap<>();
|
||||
|
||||
for (Entry<Competitor, List<GPSFix>> competitorEntry : newCompetitorFixes.entrySet()) {
|
||||
Set<GPSFix> fixesForCompetitor = new HashSet<>();
|
||||
for (Entry<Competitor, List<GPSFixMoving>> competitorEntry : newCompetitorFixes.entrySet()) {
|
||||
Set<GPSFixMoving> fixesForCompetitor = new HashSet<>();
|
||||
combinedCompetitorFixes.put(competitorEntry.getKey(), fixesForCompetitor);
|
||||
fixesForCompetitor.addAll(competitorEntry.getValue());
|
||||
}
|
||||
if (!newMarkFixes.isEmpty()) {
|
||||
// FIXME bug 2745 use new mark fixes to invalidate chooser's mark position and mutual mark/waypoint distance cache
|
||||
for (Entry<Competitor, List<GPSFix>> fixesAffectedByNewMarkFixes : finder
|
||||
for (Entry<Competitor, List<GPSFixMoving>> fixesAffectedByNewMarkFixes : finder
|
||||
.calculateFixesAffectedByNewMarkFixes(newMarkFixes).entrySet()) {
|
||||
Set<GPSFix> fixes = combinedCompetitorFixes.get(fixesAffectedByNewMarkFixes.getKey());
|
||||
Set<GPSFixMoving> fixes = combinedCompetitorFixes.get(fixesAffectedByNewMarkFixes.getKey());
|
||||
if (fixes == null) {
|
||||
fixes = new HashSet<>();
|
||||
combinedCompetitorFixes.put(fixesAffectedByNewMarkFixes.getKey(), fixes);
|
||||
@@ -385,7 +386,7 @@ public class MarkPassingCalculator {
|
||||
}
|
||||
}
|
||||
List<Callable<Void>> tasks = new ArrayList<>();
|
||||
for (final Entry<Competitor, Set<GPSFix>> c : combinedCompetitorFixes.entrySet()) {
|
||||
for (final Entry<Competitor, Set<GPSFixMoving>> c : combinedCompetitorFixes.entrySet()) {
|
||||
final Runnable runnable = new ComputeMarkPassings(c.getKey(), c.getValue());
|
||||
tasks.add(new Callable<Void>() {
|
||||
@Override
|
||||
@@ -412,9 +413,9 @@ public class MarkPassingCalculator {
|
||||
|
||||
private class ComputeMarkPassings implements Runnable {
|
||||
final Competitor c;
|
||||
final Iterable<GPSFix> fixes;
|
||||
final Iterable<GPSFixMoving> fixes;
|
||||
|
||||
public ComputeMarkPassings(Competitor c, Iterable<GPSFix> fixes) {
|
||||
public ComputeMarkPassings(Competitor c, Iterable<GPSFixMoving> fixes) {
|
||||
this.c = c;
|
||||
this.fixes = fixes;
|
||||
}
|
||||
@@ -462,7 +463,7 @@ public class MarkPassingCalculator {
|
||||
suspended = false;
|
||||
enqueueUpdate(new StorePositionUpdateStrategy() {
|
||||
@Override
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes,
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes,
|
||||
Map<Mark, List<GPSFix>> markFixes, List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints,
|
||||
IntHolder smallestChangedWaypointIndex,
|
||||
List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings,
|
||||
|
||||
+12
-12
@@ -44,13 +44,13 @@ public class MarkPassingUpdateListener extends AbstractRaceChangeListener {
|
||||
public void competitorPositionChanged(final GPSFixMoving fix, final Competitor competitor) {
|
||||
markPassingCalculator.enqueueUpdate(new StorePositionUpdateStrategy() {
|
||||
@Override
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes,
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes,
|
||||
Map<Mark, List<GPSFix>> markFixes, List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints,
|
||||
IntHolder smallestChangedWaypointIndex,
|
||||
List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings,
|
||||
List<Pair<Competitor, Integer>> removedMarkPassings,
|
||||
List<Pair<Competitor, Integer>> suppressedMarkPassings, List<Competitor> unSuppressedMarkPassings, CandidateFinder candidateFinder, CandidateChooser candidateChooser) {
|
||||
List<GPSFix> list = competitorFixes.get(competitor);
|
||||
List<GPSFixMoving> list = competitorFixes.get(competitor);
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
competitorFixes.put(competitor, list);
|
||||
@@ -64,7 +64,7 @@ public class MarkPassingUpdateListener extends AbstractRaceChangeListener {
|
||||
public void markPositionChanged(final GPSFix fix, final Mark mark, boolean firstInTrack) {
|
||||
markPassingCalculator.enqueueUpdate(new StorePositionUpdateStrategy() {
|
||||
@Override
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes,
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes,
|
||||
Map<Mark, List<GPSFix>> markFixes, List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints,
|
||||
IntHolder smallestChangedWaypointIndex,
|
||||
List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings,
|
||||
@@ -84,7 +84,7 @@ public class MarkPassingUpdateListener extends AbstractRaceChangeListener {
|
||||
public void waypointAdded(final int zeroBasedIndex, final Waypoint waypointThatGotAdded) {
|
||||
markPassingCalculator.enqueueUpdate(new StorePositionUpdateStrategy() {
|
||||
@Override
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes,
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes,
|
||||
Map<Mark, List<GPSFix>> markFixes, List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints,
|
||||
IntHolder smallestChangedWaypointIndex,
|
||||
List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings,
|
||||
@@ -102,7 +102,7 @@ public class MarkPassingUpdateListener extends AbstractRaceChangeListener {
|
||||
public void waypointRemoved(final int zeroBasedIndex, final Waypoint waypointThatGotRemoved) {
|
||||
markPassingCalculator.enqueueUpdate(new StorePositionUpdateStrategy() {
|
||||
@Override
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes,
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes,
|
||||
Map<Mark, List<GPSFix>> markFixes, List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints,
|
||||
IntHolder smallestChangedWaypointIndex,
|
||||
List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings,
|
||||
@@ -120,7 +120,7 @@ public class MarkPassingUpdateListener extends AbstractRaceChangeListener {
|
||||
final TimePoint timePointOfFixedPassing) {
|
||||
markPassingCalculator.enqueueUpdate(new StorePositionUpdateStrategy() {
|
||||
@Override
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes,
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes,
|
||||
Map<Mark, List<GPSFix>> markFixes, List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints,
|
||||
IntHolder smallestChangedWaypointIndex,
|
||||
List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings,
|
||||
@@ -135,7 +135,7 @@ public class MarkPassingUpdateListener extends AbstractRaceChangeListener {
|
||||
public void removeFixedPassing(final Competitor c, final Integer zeroBasedIndexOfWaypoint) {
|
||||
markPassingCalculator.enqueueUpdate(new StorePositionUpdateStrategy() {
|
||||
@Override
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes,
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes,
|
||||
Map<Mark, List<GPSFix>> markFixes, List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints,
|
||||
IntHolder smallestChangedWaypointIndex,
|
||||
List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings,
|
||||
@@ -150,7 +150,7 @@ public class MarkPassingUpdateListener extends AbstractRaceChangeListener {
|
||||
public void addSuppressedPassing(final Competitor c, final Integer zeroBasedIndexOfWaypoint) {
|
||||
markPassingCalculator.enqueueUpdate(new StorePositionUpdateStrategy() {
|
||||
@Override
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes,
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes,
|
||||
Map<Mark, List<GPSFix>> markFixes, List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints,
|
||||
IntHolder smallestChangedWaypointIndex,
|
||||
List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings,
|
||||
@@ -165,7 +165,7 @@ public class MarkPassingUpdateListener extends AbstractRaceChangeListener {
|
||||
public void removeSuppressedPassing(final Competitor c) {
|
||||
markPassingCalculator.enqueueUpdate(new StorePositionUpdateStrategy() {
|
||||
@Override
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes,
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes,
|
||||
Map<Mark, List<GPSFix>> markFixes, List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints,
|
||||
IntHolder smallestChangedWaypointIndex,
|
||||
List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings,
|
||||
@@ -180,7 +180,7 @@ public class MarkPassingUpdateListener extends AbstractRaceChangeListener {
|
||||
public void startOfRaceChanged(TimePoint oldStartOfRace, TimePoint newStartOfRace) {
|
||||
markPassingCalculator.enqueueUpdate(new StorePositionUpdateStrategy() {
|
||||
@Override
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes,
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes,
|
||||
Map<Mark, List<GPSFix>> markFixes, List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints,
|
||||
IntHolder smallestChangedWaypointIndex,
|
||||
List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings,
|
||||
@@ -199,7 +199,7 @@ public class MarkPassingUpdateListener extends AbstractRaceChangeListener {
|
||||
public void startOfTrackingChanged(TimePoint oldStartOfTracking, TimePoint newStartOfTracking) {
|
||||
markPassingCalculator.enqueueUpdate(new StorePositionUpdateStrategy() {
|
||||
@Override
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes,
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes,
|
||||
Map<Mark, List<GPSFix>> markFixes, List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints,
|
||||
IntHolder smallestChangedWaypointIndex,
|
||||
List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings,
|
||||
@@ -218,7 +218,7 @@ public class MarkPassingUpdateListener extends AbstractRaceChangeListener {
|
||||
public void finishedTimeChanged(TimePoint oldFinishedTime, TimePoint newFinishedTime) {
|
||||
markPassingCalculator.enqueueUpdate(new StorePositionUpdateStrategy() {
|
||||
@Override
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes,
|
||||
public void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes,
|
||||
Map<Mark, List<GPSFix>> markFixes, List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints,
|
||||
IntHolder smallestChangedWaypointIndex,
|
||||
List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings,
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@ import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFix;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFixMoving;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
import com.sap.sse.common.Util.Triple;
|
||||
@@ -21,7 +22,7 @@ public interface StorePositionUpdateStrategy {
|
||||
* Adds its fix either to <code>competitorFixes</code> or <code>markFixes</code>, depending what the fix is for. If
|
||||
* no fixes exist yet for that object, a new entry is created.
|
||||
*/
|
||||
void storePositionUpdate(Map<Competitor, List<GPSFix>> competitorFixes, Map<Mark, List<GPSFix>> markFixes,
|
||||
void storePositionUpdate(Map<Competitor, List<GPSFixMoving>> competitorFixes, Map<Mark, List<GPSFix>> markFixes,
|
||||
List<Waypoint> addedWaypoints, List<Waypoint> removedWaypoints, IntHolder smallestChangedWaypointIndex,
|
||||
List<Triple<Competitor, Integer, TimePoint>> fixedMarkPassings, List<Pair<Competitor, Integer>> removedMarkPassings,
|
||||
List<Pair<Competitor, Integer>> suppressedMarkPassings, List<Competitor> unSuppressedMarkPassings, CandidateFinder candidateFinder, CandidateChooser candidateChooser);
|
||||
|
||||
+102
-96
@@ -223,7 +223,7 @@ public class CandidateFinderImpl implements CandidateFinder {
|
||||
}
|
||||
} else {
|
||||
for (final Competitor competitor : race.getRace().getCompetitors()) {
|
||||
final List<GPSFix> newFixesForCompetitor = new ArrayList<>();
|
||||
final List<GPSFixMoving> newFixesForCompetitor = new ArrayList<>();
|
||||
final DynamicGPSFixTrack<Competitor, GPSFixMoving> track = race.getTrack(competitor);
|
||||
if (track != null) {
|
||||
track.lockForRead();
|
||||
@@ -289,7 +289,7 @@ public class CandidateFinderImpl implements CandidateFinder {
|
||||
|
||||
@Override
|
||||
public Util.Pair<Iterable<Candidate>, Iterable<Candidate>> getAllCandidates(Competitor c) {
|
||||
Set<GPSFix> fixes = getAllFixes(c);
|
||||
Set<GPSFixMoving> fixes = getAllFixes(c);
|
||||
distanceCache.get(c).clear();
|
||||
xteCache.get(c).clear();
|
||||
synchronized (xteCandidates) {
|
||||
@@ -302,9 +302,9 @@ public class CandidateFinderImpl implements CandidateFinder {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Competitor, List<GPSFix>> calculateFixesAffectedByNewMarkFixes(Map<Mark, List<GPSFix>> markFixes) {
|
||||
public Map<Competitor, List<GPSFixMoving>> calculateFixesAffectedByNewMarkFixes(Map<Mark, List<GPSFix>> markFixes) {
|
||||
// TODO Right now creates on time stretch between the 2 outside markfixes
|
||||
Map<Competitor, List<GPSFix>> affectedFixes = new HashMap<>();
|
||||
Map<Competitor, List<GPSFixMoving>> affectedFixes = new HashMap<>();
|
||||
TimePoint start = null;
|
||||
TimePoint end = null;
|
||||
for (Entry<Mark, List<GPSFix>> fixes : markFixes.entrySet()) {
|
||||
@@ -317,9 +317,9 @@ public class CandidateFinderImpl implements CandidateFinder {
|
||||
}
|
||||
}
|
||||
for (Competitor c : race.getRace().getCompetitors()) {
|
||||
List<GPSFix> competitorFixes = new ArrayList<>();
|
||||
List<GPSFixMoving> competitorFixes = new ArrayList<>();
|
||||
DynamicGPSFixTrack<Competitor, GPSFixMoving> track = race.getTrack(c);
|
||||
GPSFix comFix = track.getFirstFixAtOrAfter(start);
|
||||
GPSFixMoving comFix = track.getFirstFixAtOrAfter(start);
|
||||
if (comFix != null) {
|
||||
if (end != null) {
|
||||
while (comFix != null && !comFix.getTimePoint().after(end)) {
|
||||
@@ -345,7 +345,7 @@ public class CandidateFinderImpl implements CandidateFinder {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Util.Pair<Iterable<Candidate>, Iterable<Candidate>> getCandidateDeltas(Competitor c, Iterable<GPSFix> fixes) {
|
||||
public Util.Pair<Iterable<Candidate>, Iterable<Candidate>> getCandidateDeltas(Competitor c, Iterable<GPSFixMoving> fixes) {
|
||||
List<Candidate> newCans = new ArrayList<>();
|
||||
List<Candidate> wrongCans = new ArrayList<>();
|
||||
Course course = race.getRace().getCourse();
|
||||
@@ -408,7 +408,7 @@ public class CandidateFinderImpl implements CandidateFinder {
|
||||
badCans.addAll(distanceCans.values());
|
||||
distanceCans.clear();
|
||||
}
|
||||
Set<GPSFix> allFixes = getAllFixes(c);
|
||||
Set<GPSFixMoving> allFixes = getAllFixes(c);
|
||||
newCans.addAll(checkForDistanceCandidateChanges(c, allFixes, changedWaypoints).getA());
|
||||
newCans.addAll(checkForXTECandidatesChanges(c, allFixes, changedWaypoints).getA());
|
||||
result.put(c, new Util.Pair<List<Candidate>, List<Candidate>>(newCans, badCans));
|
||||
@@ -525,13 +525,13 @@ public class CandidateFinderImpl implements CandidateFinder {
|
||||
return instruction;
|
||||
}
|
||||
|
||||
private Set<GPSFix> getAllFixes(Competitor c) {
|
||||
Set<GPSFix> fixes = new TreeSet<GPSFix>(comp);
|
||||
private Set<GPSFixMoving> getAllFixes(Competitor c) {
|
||||
Set<GPSFixMoving> fixes = new TreeSet<>(comp);
|
||||
if (timeRangeForValidCandidates.getTimeRangeOrNull() != null) {
|
||||
DynamicGPSFixTrack<Competitor, GPSFixMoving> track = race.getTrack(c);
|
||||
track.lockForRead();
|
||||
try {
|
||||
for (GPSFix fix : track.getFixes(
|
||||
for (GPSFixMoving fix : track.getFixes(
|
||||
timeRangeForValidCandidates.getTimeRangeOrNull().from(), /* fromInclusive */ true,
|
||||
timeRangeForValidCandidates.getTimeRangeOrNull().to(), /* toInclusive */ true)) {
|
||||
fixes.add(fix);
|
||||
@@ -549,7 +549,7 @@ public class CandidateFinderImpl implements CandidateFinder {
|
||||
* probability exceeds {@link #penaltyForSkipping}, the fix is considered a candidate.
|
||||
*/
|
||||
private Util.Pair<List<Candidate>, List<Candidate>> checkForDistanceCandidateChanges(Competitor c,
|
||||
Iterable<GPSFix> fixes, Iterable<Waypoint> waypoints) {
|
||||
Iterable<GPSFixMoving> fixes, Iterable<Waypoint> waypoints) {
|
||||
Util.Pair<List<Candidate>, List<Candidate>> result = new Util.Pair<List<Candidate>, List<Candidate>>(
|
||||
new ArrayList<Candidate>(), new ArrayList<Candidate>());
|
||||
TreeSet<GPSFix> affectedFixes = new TreeSet<GPSFix>(comp);
|
||||
@@ -705,116 +705,122 @@ public class CandidateFinderImpl implements CandidateFinder {
|
||||
* @param waypointAsList
|
||||
*/
|
||||
private Util.Pair<List<Candidate>, List<Candidate>> checkForXTECandidatesChanges(Competitor c,
|
||||
Iterable<GPSFix> fixes, Iterable<Waypoint> waypoints) {
|
||||
Iterable<GPSFixMoving> fixes, Iterable<Waypoint> waypoints) {
|
||||
Util.Pair<List<Candidate>, List<Candidate>> result = new Util.Pair<List<Candidate>, List<Candidate>>(
|
||||
new ArrayList<Candidate>(), new ArrayList<Candidate>());
|
||||
DynamicGPSFixTrack<Competitor, GPSFixMoving> track = race.getTrack(c);
|
||||
for (GPSFix fix : fixes) {
|
||||
for (GPSFixMoving fix : fixes) {
|
||||
if (timeRangeForValidCandidates.getTimeRangeOrNull() != null && timeRangeForValidCandidates.getTimeRangeOrNull().includes(fix.getTimePoint())) {
|
||||
TimePoint t = fix.getTimePoint();
|
||||
GPSFix fixBefore;
|
||||
GPSFix fixAfter;
|
||||
GPSFix fixBefore = null;
|
||||
GPSFix fixAfter = null;
|
||||
final boolean fixIsValid;
|
||||
track.lockForRead();
|
||||
try {
|
||||
fixBefore = track.getLastFixBefore(t);
|
||||
fixAfter = track.getFirstFixAfter(t);
|
||||
fixIsValid = track.isValid(fix);
|
||||
if (fixIsValid) {
|
||||
fixBefore = track.getLastFixBefore(t);
|
||||
fixAfter = track.getFirstFixAfter(t);
|
||||
}
|
||||
} finally {
|
||||
track.unlockAfterRead();
|
||||
}
|
||||
Map<Waypoint, List<Distance>> xtesBefore = null;
|
||||
Map<Waypoint, List<Distance>> xtesAfter = null;
|
||||
TimePoint tBefore = null;
|
||||
TimePoint tAfter = null;
|
||||
if (fixBefore != null) {
|
||||
xtesBefore = getXTE(c, fixBefore);
|
||||
tBefore = fixBefore.getTimePoint();
|
||||
}
|
||||
if (fixAfter != null) {
|
||||
xtesAfter = getXTE(c, fixAfter);
|
||||
tAfter = fixAfter.getTimePoint();
|
||||
}
|
||||
Map<Waypoint, List<Distance>> xtes = getXTE(c, fix);
|
||||
for (Waypoint w : waypoints) {
|
||||
List<List<GPSFix>> oldCandidates = new ArrayList<>();
|
||||
Map<List<GPSFix>, Candidate> newCandidates = new HashMap<List<GPSFix>, Candidate>();
|
||||
Map<List<GPSFix>, Candidate> waypointCandidates = getXteCandidates(c, w);
|
||||
for (List<GPSFix> fixPair : waypointCandidates.keySet()) {
|
||||
if (fixPair.contains(fix)) {
|
||||
oldCandidates.add(fixPair);
|
||||
}
|
||||
if (fixIsValid) {
|
||||
Map<Waypoint, List<Distance>> xtesBefore = null;
|
||||
Map<Waypoint, List<Distance>> xtesAfter = null;
|
||||
TimePoint tBefore = null;
|
||||
TimePoint tAfter = null;
|
||||
if (fixBefore != null) {
|
||||
xtesBefore = getXTE(c, fixBefore);
|
||||
tBefore = fixBefore.getTimePoint();
|
||||
}
|
||||
List<Distance> wayPointXTEs = xtes.get(w);
|
||||
final int size = wayPointXTEs == null ? 0 : wayPointXTEs.size();
|
||||
if (size > 0) {
|
||||
Double xte = wayPointXTEs.get(0).getMeters();
|
||||
if (xte == 0) {
|
||||
newCandidates.put(Arrays.asList(fix, fix), createCandidate(c, 0, 0, t, t, w, true));
|
||||
} else {
|
||||
if (fixAfter != null && xtesAfter != null && !xtesAfter.get(w).isEmpty()) {
|
||||
Double xteAfter = xtesAfter.get(w).get(0).getMeters();
|
||||
if (xteAfter != null && xte < 0 != xteAfter <= 0) {
|
||||
newCandidates.put(Arrays.asList(fix, fixAfter),
|
||||
createCandidate(c, xte, xteAfter, t, tAfter, w, true));
|
||||
}
|
||||
if (fixAfter != null) {
|
||||
xtesAfter = getXTE(c, fixAfter);
|
||||
tAfter = fixAfter.getTimePoint();
|
||||
}
|
||||
Map<Waypoint, List<Distance>> xtes = getXTE(c, fix);
|
||||
for (Waypoint w : waypoints) {
|
||||
List<List<GPSFix>> oldCandidates = new ArrayList<>();
|
||||
Map<List<GPSFix>, Candidate> newCandidates = new HashMap<List<GPSFix>, Candidate>();
|
||||
Map<List<GPSFix>, Candidate> waypointCandidates = getXteCandidates(c, w);
|
||||
for (List<GPSFix> fixPair : waypointCandidates.keySet()) {
|
||||
if (fixPair.contains(fix)) {
|
||||
oldCandidates.add(fixPair);
|
||||
}
|
||||
if (fixBefore != null && !xtesBefore.get(w).isEmpty()) {
|
||||
Double xteBefore = xtesBefore.get(w).get(0).getMeters();
|
||||
if (xte < 0 != xteBefore <= 0) {
|
||||
newCandidates.put(Arrays.asList(fixBefore, fix),
|
||||
createCandidate(c, xteBefore, xte, tBefore, t, w, true));
|
||||
}
|
||||
List<Distance> wayPointXTEs = xtes.get(w);
|
||||
final int size = wayPointXTEs == null ? 0 : wayPointXTEs.size();
|
||||
if (size > 0) {
|
||||
Double xte = wayPointXTEs.get(0).getMeters();
|
||||
if (xte == 0) {
|
||||
newCandidates.put(Arrays.asList(fix, fix), createCandidate(c, 0, 0, t, t, w, true));
|
||||
} else {
|
||||
if (fixAfter != null && xtesAfter != null && !xtesAfter.get(w).isEmpty()) {
|
||||
Double xteAfter = xtesAfter.get(w).get(0).getMeters();
|
||||
if (xteAfter != null && xte < 0 != xteAfter <= 0) {
|
||||
newCandidates.put(Arrays.asList(fix, fixAfter),
|
||||
createCandidate(c, xte, xteAfter, t, tAfter, w, true));
|
||||
}
|
||||
}
|
||||
if (fixBefore != null && !xtesBefore.get(w).isEmpty()) {
|
||||
Double xteBefore = xtesBefore.get(w).get(0).getMeters();
|
||||
if (xte < 0 != xteBefore <= 0) {
|
||||
newCandidates.put(Arrays.asList(fixBefore, fix),
|
||||
createCandidate(c, xteBefore, xte, tBefore, t, w, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (size > 1) {
|
||||
Double xte = wayPointXTEs.get(1).getMeters();
|
||||
if (xte == 0) {
|
||||
newCandidates.put(Arrays.asList(fix, fix), createCandidate(c, 0, 0, t, t, w, false));
|
||||
} else {
|
||||
if (fixAfter != null && xtesAfter != null && xtesAfter.get(w).size() >= 2) {
|
||||
Double xteAfter = xtesAfter.get(w).get(1).getMeters();
|
||||
if (xte < 0 != xteAfter <= 0) {
|
||||
newCandidates.put(Arrays.asList(fix, fixAfter),
|
||||
createCandidate(c, xte, xteAfter, t, tAfter, w,
|
||||
/* still portMark in case of single-mark waypoint */ Util.size(w.getMarks()) < 2));
|
||||
if (size > 1) {
|
||||
Double xte = wayPointXTEs.get(1).getMeters();
|
||||
if (xte == 0) {
|
||||
newCandidates.put(Arrays.asList(fix, fix), createCandidate(c, 0, 0, t, t, w, false));
|
||||
} else {
|
||||
if (fixAfter != null && xtesAfter != null && xtesAfter.get(w).size() >= 2) {
|
||||
Double xteAfter = xtesAfter.get(w).get(1).getMeters();
|
||||
if (xte < 0 != xteAfter <= 0) {
|
||||
newCandidates.put(Arrays.asList(fix, fixAfter),
|
||||
createCandidate(c, xte, xteAfter, t, tAfter, w,
|
||||
/* still portMark in case of single-mark waypoint */ Util.size(w.getMarks()) < 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fixBefore != null && xtesBefore.get(w).size() >= 2) {
|
||||
Double xteBefore = xtesBefore.get(w).get(1).getMeters();
|
||||
if (xte < 0 != xteBefore <= 0) {
|
||||
newCandidates.put(Arrays.asList(fixBefore, fix),
|
||||
createCandidate(c, xteBefore, xte, tBefore, t, w,
|
||||
/* still portMark in case of single-mark waypoint */ Util.size(w.getMarks()) < 2));
|
||||
if (fixBefore != null && xtesBefore.get(w).size() >= 2) {
|
||||
Double xteBefore = xtesBefore.get(w).get(1).getMeters();
|
||||
if (xte < 0 != xteBefore <= 0) {
|
||||
newCandidates.put(Arrays.asList(fixBefore, fix),
|
||||
createCandidate(c, xteBefore, xte, tBefore, t, w,
|
||||
/* still portMark in case of single-mark waypoint */ Util.size(w.getMarks()) < 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Entry<List<GPSFix>, Candidate> candidateWithFixes : newCandidates.entrySet()) {
|
||||
Candidate newCan = candidateWithFixes.getValue();
|
||||
List<GPSFix> canFixes = candidateWithFixes.getKey();
|
||||
if (oldCandidates.contains(canFixes)) {
|
||||
oldCandidates.remove(canFixes);
|
||||
Candidate oldCan = waypointCandidates.get(canFixes);
|
||||
if (newCan.compareTo(oldCan) != 0) {
|
||||
result.getB().add(oldCan);
|
||||
waypointCandidates.remove(canFixes);
|
||||
for (Entry<List<GPSFix>, Candidate> candidateWithFixes : newCandidates.entrySet()) {
|
||||
Candidate newCan = candidateWithFixes.getValue();
|
||||
List<GPSFix> canFixes = candidateWithFixes.getKey();
|
||||
if (oldCandidates.contains(canFixes)) {
|
||||
oldCandidates.remove(canFixes);
|
||||
Candidate oldCan = waypointCandidates.get(canFixes);
|
||||
if (newCan.compareTo(oldCan) != 0) {
|
||||
result.getB().add(oldCan);
|
||||
waypointCandidates.remove(canFixes);
|
||||
if (newCan.getProbability() > penaltyForSkipping) {
|
||||
result.getA().add(newCan);
|
||||
logger.finest("Added XTE " + newCan.toString() + "for " + c);
|
||||
waypointCandidates.put(canFixes, newCan);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (newCan.getProbability() > penaltyForSkipping) {
|
||||
result.getA().add(newCan);
|
||||
logger.finest("Added XTE " + newCan.toString() + "for " + c);
|
||||
waypointCandidates.put(canFixes, newCan);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (newCan.getProbability() > penaltyForSkipping) {
|
||||
result.getA().add(newCan);
|
||||
logger.finest("Added XTE " + newCan.toString() + "for " + c);
|
||||
waypointCandidates.put(canFixes, newCan);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (List<GPSFix> badCanFixes : oldCandidates) {
|
||||
result.getB().add(waypointCandidates.get(badCanFixes));
|
||||
waypointCandidates.remove(badCanFixes);
|
||||
for (List<GPSFix> badCanFixes : oldCandidates) {
|
||||
result.getB().add(waypointCandidates.get(badCanFixes));
|
||||
waypointCandidates.remove(badCanFixes);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,4 +191,11 @@ public interface GPSFixTrack<ItemType, FixType extends GPSFix> extends MappedTra
|
||||
*/
|
||||
SpeedWithBearingStepsIterable getSpeedWithBearingSteps(TimePoint fromTimePoint, TimePoint toTimePoint);
|
||||
|
||||
/**
|
||||
* For a fix that doesn't necessarily need to be part of this track already decides whether this fix is considered
|
||||
* valid in the scope of this track. This means that if the fix is part of the track it will be returned in
|
||||
* {@link #getFixes()} if and only if this method returns {@code true}.
|
||||
*/
|
||||
boolean isValid(FixType e);
|
||||
|
||||
}
|
||||
+5
@@ -947,6 +947,11 @@ public abstract class GPSFixTrackImpl<ItemType, FixType extends GPSFix> extends
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(FixType e) {
|
||||
return isValid(getInternalFixes(), e);
|
||||
}
|
||||
|
||||
/**
|
||||
* When redefining this method, make sure to redefine
|
||||
* {@link #invalidateValidityAndEstimatedSpeedAndDistanceCaches(GPSFix)} accordingly. This implementation checks the
|
||||
|
||||
+6
-3
@@ -45,11 +45,14 @@ public class GetSearchResultsAction implements SailingAction<ListResult<SearchRe
|
||||
public ListResult<SearchResultDTO> execute(SailingDispatchContext ctx) throws DispatchException {
|
||||
KeywordQuery searchQuery = new KeywordQuery(Util.splitAlongWhitespaceRespectingDoubleQuotedPhrases(searchText));
|
||||
RacingEventService service = ctx.getRacingEventService();
|
||||
final ListResult<SearchResultDTO> result;
|
||||
if (remoteServerName == null) {
|
||||
return getListResult(service.search(searchQuery), ctx.getRequestBaseURL(), false);
|
||||
result = getListResult(service.search(searchQuery), ctx.getRequestBaseURL(), false);
|
||||
} else {
|
||||
RemoteSailingServerReference remoteServer = service.getRemoteServerReferenceByName(remoteServerName);
|
||||
result = getListResult(service.searchRemotely(remoteServerName, searchQuery), remoteServer.getURL(), true);
|
||||
}
|
||||
RemoteSailingServerReference remoteServer = service.getRemoteServerReferenceByName(remoteServerName);
|
||||
return getListResult(service.searchRemotely(remoteServerName, searchQuery), remoteServer.getURL(), true);
|
||||
return result;
|
||||
}
|
||||
|
||||
@GwtIncompatible
|
||||
|
||||
+7
-1
@@ -4,6 +4,12 @@
|
||||
<div id="mainContent">
|
||||
<h4 class="articleHeadline">What's New - SAP Sailing Analytics</h4>
|
||||
<div class="innerContent">
|
||||
<h5 class="articleSubheadline">October 2018</h5>
|
||||
<ul class="bulletList">
|
||||
<li>Searching for phrases containing whitespace characters with double quotes such as "Tobias Schadewaldt" will now work
|
||||
across a distributed server and event landscape.</li>
|
||||
</ul>
|
||||
|
||||
<h5 class="articleSubheadline">August 2018</h5>
|
||||
<ul class="bulletList">
|
||||
<li>The windstreamlets are now colored dynamically according to the wind fields maximum and minimum wind speed.</li>
|
||||
@@ -21,7 +27,7 @@
|
||||
<li>The suggested statistics are now grouped by their retriever chain</li>
|
||||
<li>The aggregator and statistic control switched places and are now linked together. This means that
|
||||
all aggregators/statistics can always be selected, but are grayed out if one component isn't supported
|
||||
by the other (e.g. an aggreagtor doesn't exist for the currently selected statistic). The other
|
||||
by the other (e.g. an aggregator doesn't exist for the currently selected statistic). The other
|
||||
component will be reset when an unsupported component is selected.</li>
|
||||
<li>Counting aggregators now work directly on the retrieved data elements and don't require the
|
||||
selection of a specific statistic. Changing to a counting aggregator when a statistic is selected
|
||||
|
||||
+2
-1
@@ -17,6 +17,7 @@ import com.sap.sailing.server.gateway.serialization.impl.EventBaseJsonSerializer
|
||||
import com.sap.sailing.server.gateway.serialization.impl.LeaderboardGroupBaseJsonSerializer;
|
||||
import com.sap.sailing.server.gateway.serialization.impl.LeaderboardSearchResultJsonSerializer;
|
||||
import com.sap.sailing.server.gateway.serialization.impl.VenueJsonSerializer;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.search.KeywordQuery;
|
||||
import com.sap.sse.common.search.Result;
|
||||
|
||||
@@ -37,7 +38,7 @@ public class SearchResource extends AbstractSailingServerResource {
|
||||
@GET
|
||||
@Produces("application/json;charset=UTF-8")
|
||||
public Response search(@QueryParam("q") String keywords) {
|
||||
KeywordQuery query = new KeywordQuery(keywords.split(" "));
|
||||
KeywordQuery query = new KeywordQuery(Util.splitAlongWhitespaceRespectingDoubleQuotedPhrases(keywords));
|
||||
Iterable<LeaderboardSearchResult> searchResults = search(query).getHits();
|
||||
JSONArray jsonSearchResults = new JSONArray();
|
||||
for (LeaderboardSearchResult searchResult : searchResults) {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{ showNewVersionHint: false }
|
||||
@@ -45,7 +45,9 @@ public class KeywordQuery implements Query, Serializable {
|
||||
} else {
|
||||
sb.append(' ');
|
||||
}
|
||||
sb.append('"');
|
||||
sb.append(keyword);
|
||||
sb.append('"');
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user