mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-20 04:35:32 +00:00
Merge branch 'master' into bug4652
This commit is contained in:
@@ -117,6 +117,7 @@ stop_httpd() {
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
/usr/sbin/update-motd
|
||||
start_servers
|
||||
touch /var/lock/subsys/sailing
|
||||
;;
|
||||
|
||||
+5
-5
@@ -15,7 +15,7 @@ import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.datamining.impl.data.LeaderboardGroupWithContext;
|
||||
import com.sap.sailing.datamining.data.HasLeaderboardGroupContext;
|
||||
import com.sap.sailing.datamining.test.util.ConcurrencyTestsUtil;
|
||||
import com.sap.sailing.datamining.test.util.NullProcessor;
|
||||
import com.sap.sailing.domain.leaderboard.Leaderboard;
|
||||
@@ -27,7 +27,7 @@ import com.sap.sse.datamining.components.Processor;
|
||||
public class TestLeaderboardGroupRetrievalProcessor {
|
||||
|
||||
private RacingEventService service;
|
||||
private Processor<RacingEventService, LeaderboardGroupWithContext> retriever;
|
||||
private Processor<RacingEventService, HasLeaderboardGroupContext> retriever;
|
||||
|
||||
private Collection<LeaderboardGroup> retrievedGroups;
|
||||
|
||||
@@ -37,14 +37,14 @@ public class TestLeaderboardGroupRetrievalProcessor {
|
||||
stub(service.getLeaderboardGroups()).toReturn(getGroupsInService());
|
||||
|
||||
retrievedGroups = new HashSet<>();
|
||||
Processor<LeaderboardGroupWithContext, Void> receiver = new NullProcessor<LeaderboardGroupWithContext, Void>(LeaderboardGroupWithContext.class, Void.class) {
|
||||
Processor<HasLeaderboardGroupContext, Void> receiver = new NullProcessor<HasLeaderboardGroupContext, Void>(HasLeaderboardGroupContext.class, Void.class) {
|
||||
@Override
|
||||
public void processElement(LeaderboardGroupWithContext element) {
|
||||
public void processElement(HasLeaderboardGroupContext element) {
|
||||
retrievedGroups.add(element.getLeaderboardGroup());
|
||||
}
|
||||
};
|
||||
|
||||
Collection<Processor<LeaderboardGroupWithContext, ?>> resultReceivers = new ArrayList<>();
|
||||
Collection<Processor<HasLeaderboardGroupContext, ?>> resultReceivers = new ArrayList<>();
|
||||
resultReceivers.add(receiver);
|
||||
retriever = new LeaderboardGroupRetrievalProcessor(ConcurrencyTestsUtil.getExecutor(), resultReceivers, 0);
|
||||
}
|
||||
|
||||
+3
-2
@@ -188,7 +188,7 @@ AbsRelativeBearingToNextMarkAfterManeuver=Abs. relative bearing to the next mark
|
||||
RatioBetweenDistanceSailedWithAndWithoutManeuver=Ratio between distance sailed with and without maneuver
|
||||
RatioBetweenDistanceSailedTowardMiddleAngleProjectionWithAndWithoutManeuver=Ratio between distance sailed toward middle angle projection with and without maneuver
|
||||
DurationLostByManeuver=Duration lost by maneuver
|
||||
DurationLostByManeuverTowardMiddleAngleProjection=duration lost by maneuver toward middle angle projection
|
||||
DurationLostByManeuverTowardMiddleAngleProjection=Duration lost by maneuver toward middle angle projection
|
||||
JibingCount=Jibing count
|
||||
TackingCount=Tacking count
|
||||
AbsTwaAtMaxTurningRate=Abs. TWA at max. turning rate
|
||||
@@ -198,4 +198,5 @@ PercentageOfMainCurveProgressUntilLowestSpeed=Percentage of main curve progress
|
||||
PercentageOfMainCurveProgressUntilHighestSpeed=Percentage of main curve progress until highest speed
|
||||
PercentageOfMainCurveProgressUntilMaxTurningRate=Percentage of main curve progress until max. turning rate speed
|
||||
AbsTwaAtManeuverMiddle=Abs. TWA at maneuver middle
|
||||
GpsSamplingRate=GPS sampling rate
|
||||
GpsSamplingRate=GPS sampling rate
|
||||
RaceDuration=Race duration
|
||||
+2
-1
@@ -201,4 +201,5 @@ PercentageOfMainCurveProgressUntilHighestSpeed=Prozentualer Fortschritt der Haup
|
||||
PercentageOfMainCurveProgressUntilMaxTurningRate=Prozentualer Fortschritt der Hauptkurve bis zum Erreichen von max. Drehrate
|
||||
ManeuverTypeForCompleteManeuverCurve=Manövertyp für komplette Manöverkurve
|
||||
AbsTwaAtManeuverMiddle=Abs. TWA während Manövermitte
|
||||
GpsSamplingRate=GPS-Samplingrate
|
||||
GpsSamplingRate=GPS-Samplingrate
|
||||
RaceDuration=Renndauer
|
||||
+4
-4
@@ -5,12 +5,13 @@ import java.util.Collection;
|
||||
|
||||
import com.sap.sailing.datamining.data.HasBravoFixContext;
|
||||
import com.sap.sailing.datamining.data.HasBravoFixTrackContext;
|
||||
import com.sap.sailing.datamining.data.HasCompleteManeuverCurveWithEstimationDataContext;
|
||||
import com.sap.sailing.datamining.data.HasFoilingSegmentContext;
|
||||
import com.sap.sailing.datamining.data.HasGPSFixContext;
|
||||
import com.sap.sailing.datamining.data.HasLeaderboardContext;
|
||||
import com.sap.sailing.datamining.data.HasLeaderboardGroupContext;
|
||||
import com.sap.sailing.datamining.data.HasManeuverContext;
|
||||
import com.sap.sailing.datamining.data.HasManeuverSpeedDetailsContext;
|
||||
import com.sap.sailing.datamining.data.HasCompleteManeuverCurveWithEstimationDataContext;
|
||||
import com.sap.sailing.datamining.data.HasMarkPassingContext;
|
||||
import com.sap.sailing.datamining.data.HasRaceOfCompetitorContext;
|
||||
import com.sap.sailing.datamining.data.HasRaceResultOfCompetitorContext;
|
||||
@@ -22,13 +23,13 @@ import com.sap.sailing.datamining.data.HasWindTrackContext;
|
||||
import com.sap.sailing.datamining.impl.components.BravoFixRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.BravoFixTrackRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.CompetitorOfRaceInLeaderboardRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.CompleteManeuverCurveWithEstimationDataRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.FoilingSegmentRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.GPSFixRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.LeaderboardGroupRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.LeaderboardRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.ManeuverRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.ManeuverSpeedDetailsRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.CompleteManeuverCurveWithEstimationDataRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.MarkPassingRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.RaceOfCompetitorRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.TrackedLegOfCompetitorRetrievalProcessor;
|
||||
@@ -36,7 +37,6 @@ import com.sap.sailing.datamining.impl.components.TrackedLegRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.TrackedRaceRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.WindFixRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.components.WindTrackRetrievalProcessor;
|
||||
import com.sap.sailing.datamining.impl.data.LeaderboardGroupWithContext;
|
||||
import com.sap.sailing.datamining.shared.FoilingSegmentsDataMiningSettings;
|
||||
import com.sap.sailing.datamining.shared.ManeuverSettings;
|
||||
import com.sap.sailing.datamining.shared.ManeuverSettingsImpl;
|
||||
@@ -55,7 +55,7 @@ public class SailingDataRetrievalChainDefinitions {
|
||||
|
||||
final DataRetrieverChainDefinition<RacingEventService, HasLeaderboardContext> leaderboardRetrieverChainDefinition = new SimpleDataRetrieverChainDefinition<>(
|
||||
RacingEventService.class, HasLeaderboardContext.class, "LeaderboardSailingDomainRetrieverChain");
|
||||
leaderboardRetrieverChainDefinition.startWith(LeaderboardGroupRetrievalProcessor.class, LeaderboardGroupWithContext.class, "LeaderboardGroup");
|
||||
leaderboardRetrieverChainDefinition.startWith(LeaderboardGroupRetrievalProcessor.class, HasLeaderboardGroupContext.class, "LeaderboardGroup");
|
||||
leaderboardRetrieverChainDefinition.endWith(LeaderboardGroupRetrievalProcessor.class, LeaderboardRetrievalProcessor.class,
|
||||
HasLeaderboardContext.class, "Leaderboard");
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ public interface HasBravoFixContext {
|
||||
@Connector(ordinal=1)
|
||||
BravoFix getBravoFix();
|
||||
|
||||
@Connector(messageKey="Speed")
|
||||
@Connector(messageKey="")
|
||||
SpeedWithBearing getSpeed();
|
||||
|
||||
@Connector(messageKey="Wind")
|
||||
|
||||
-3
@@ -2,7 +2,6 @@ package com.sap.sailing.datamining.data;
|
||||
|
||||
import com.sap.sailing.domain.base.BoatClass;
|
||||
import com.sap.sailing.domain.leaderboard.Leaderboard;
|
||||
import com.sap.sailing.domain.polars.PolarDataService;
|
||||
import com.sap.sse.datamining.annotations.Connector;
|
||||
import com.sap.sse.datamining.annotations.Dimension;
|
||||
|
||||
@@ -12,8 +11,6 @@ public interface HasLeaderboardContext {
|
||||
|
||||
Leaderboard getLeaderboard();
|
||||
|
||||
PolarDataService getPolarDataService();
|
||||
|
||||
@Dimension(messageKey="Leaderboard", ordinal=1)
|
||||
String getName();
|
||||
|
||||
|
||||
+29
-24
@@ -4,6 +4,7 @@ import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.common.NoWindException;
|
||||
import com.sap.sailing.domain.common.Tack;
|
||||
import com.sap.sse.common.Distance;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
import com.sap.sse.common.Speed;
|
||||
import com.sap.sse.datamining.annotations.Connector;
|
||||
@@ -14,74 +15,74 @@ import com.sap.sse.datamining.shared.impl.dto.ClusterDTO;
|
||||
public interface HasRaceOfCompetitorContext {
|
||||
|
||||
@Connector(scanForStatistics=false)
|
||||
public HasTrackedRaceContext getTrackedRaceContext();
|
||||
HasTrackedRaceContext getTrackedRaceContext();
|
||||
|
||||
@Connector(messageKey="Competitor")
|
||||
@Statistic(messageKey="")
|
||||
public Competitor getCompetitor();
|
||||
@Statistic(messageKey="Competitor")
|
||||
Competitor getCompetitor();
|
||||
|
||||
@Dimension(messageKey="TackAtStart", ordinal=12)
|
||||
public Tack getTackAtStart() throws NoWindException;
|
||||
Tack getTackAtStart() throws NoWindException;
|
||||
|
||||
@Dimension(messageKey="DistanceToStarboardSideAtStartOfCompetitor", ordinal=13)
|
||||
public ClusterDTO getPercentageClusterForDistanceToStarboardSideAtStart();
|
||||
ClusterDTO getPercentageClusterForDistanceToStarboardSideAtStart();
|
||||
|
||||
@Dimension(messageKey="RelativeScoreInPercent", ordinal=14)
|
||||
public ClusterDTO getPercentageClusterForRelativeScore();
|
||||
ClusterDTO getPercentageClusterForRelativeScore();
|
||||
|
||||
@Statistic(messageKey="DistanceAtStart", resultDecimals=2, ordinal=0)
|
||||
public Distance getDistanceToStartLineAtStart();
|
||||
Distance getDistanceToStartLineAtStart();
|
||||
|
||||
@Statistic(messageKey="DistanceToStarboardSideAtStartOfCompetitor", resultDecimals=2, ordinal=1)
|
||||
public Double getNormalizedDistanceToStarboardSideAtStartOfCompetitor();
|
||||
Double getNormalizedDistanceToStarboardSideAtStartOfCompetitor();
|
||||
|
||||
@Statistic(messageKey="DistanceToStarboardSideAtStartOfCompetitorVsRankAtFirstMark", resultDecimals=2, ordinal=1)
|
||||
public Pair<Double, Double> getNormalizedDistanceToStarboardSideAtStartOfCompetitorVsRankAtFirstMark();
|
||||
Pair<Double, Double> getNormalizedDistanceToStarboardSideAtStartOfCompetitorVsRankAtFirstMark();
|
||||
|
||||
@Statistic(messageKey="WindwardDistanceToAdvantageousEndOfLineAtStartOfRace", resultDecimals=2, ordinal=2)
|
||||
public Distance getWindwardDistanceToAdvantageousLineEndAtStartofRace();
|
||||
Distance getWindwardDistanceToAdvantageousLineEndAtStartofRace();
|
||||
|
||||
@Statistic(messageKey="WindwardDistanceToAdvantageousEndOfLineAtStartOfCompetitor", resultDecimals=2, ordinal=2)
|
||||
public Distance getWindwardDistanceToAdvantageousLineEndAtStartofCompetitor();
|
||||
Distance getWindwardDistanceToAdvantageousLineEndAtStartofCompetitor();
|
||||
|
||||
@Connector(messageKey="SpeedWhenStarting", ordinal=3)
|
||||
public Speed getSpeedWhenStarting();
|
||||
Speed getSpeedWhenStarting();
|
||||
|
||||
@Connector(messageKey="SpeedTenSecondsBeforeStart", ordinal=4)
|
||||
public Speed getSpeedTenSecondsBeforeStart();
|
||||
Speed getSpeedTenSecondsBeforeStart();
|
||||
|
||||
@Connector(messageKey="SpeedTenSecondsAfterStart", ordinal=5)
|
||||
public Speed getSpeedTenSecondsAfterStartOfRace();
|
||||
Speed getSpeedTenSecondsAfterStartOfRace();
|
||||
|
||||
@Statistic(messageKey="RankThirtySecondsAfterStart", resultDecimals=2, ordinal=6)
|
||||
public Double getRankThirtySecondsAfterStartOfRace();
|
||||
Double getRankThirtySecondsAfterStartOfRace();
|
||||
|
||||
@Statistic(messageKey="RankAfterHalfOfTheFirstLeg", resultDecimals=2, ordinal=7)
|
||||
public Double getRankAfterHalfOfTheFirstLeg();
|
||||
Double getRankAfterHalfOfTheFirstLeg();
|
||||
|
||||
@Statistic(messageKey="RankAtFirstMark", resultDecimals=2, ordinal=8)
|
||||
public Double getRankAtFirstMark();
|
||||
Double getRankAtFirstMark();
|
||||
|
||||
@Statistic(messageKey="RankGainsOrLossesBetweenFirstMarkAndFinish", resultDecimals=2, ordinal=9)
|
||||
public Double getRankGainsOrLossesBetweenFirstMarkAndFinish();
|
||||
Double getRankGainsOrLossesBetweenFirstMarkAndFinish();
|
||||
|
||||
@Statistic(messageKey="NumberOfManeuvers", resultDecimals=0, ordinal=10)
|
||||
public int getNumberOfManeuvers();
|
||||
int getNumberOfManeuvers();
|
||||
|
||||
@Statistic(messageKey="NumberOfTacks", resultDecimals=0, ordinal=11)
|
||||
public int getNumberOfTacks();
|
||||
int getNumberOfTacks();
|
||||
|
||||
@Statistic(messageKey="NumberOfJibes", resultDecimals=0, ordinal=12)
|
||||
public int getNumberOfJibes();
|
||||
int getNumberOfJibes();
|
||||
|
||||
@Statistic(messageKey="NumberOfPenaltyCircles", resultDecimals=0, ordinal=13)
|
||||
public int getNumberOfPenaltyCircles();
|
||||
int getNumberOfPenaltyCircles();
|
||||
|
||||
@Statistic(messageKey="DistanceTraveled", resultDecimals=1)
|
||||
public Distance getDistanceTraveled();
|
||||
Distance getDistanceTraveled();
|
||||
|
||||
@Statistic(messageKey="LineLengthAtStart", resultDecimals=1)
|
||||
public Distance getLineLengthAtStart();
|
||||
Distance getLineLengthAtStart();
|
||||
|
||||
@Statistic(messageKey="AbsoluteWindwardDistanceToStarboardSideAtStartOfCompetitor", resultDecimals=2)
|
||||
Distance getAbsoluteWindwardDistanceToStarboardSideAtStartOfCompetitor();
|
||||
@@ -94,4 +95,8 @@ public interface HasRaceOfCompetitorContext {
|
||||
|
||||
@Statistic(messageKey="RelativeDistanceToAdvantageousEndOfLineAtStartOfRace", resultDecimals=2)
|
||||
Double getRelativeDistanceToAdvantageousEndOfLineAtStartOfRace();
|
||||
|
||||
@Statistic(messageKey="RaceDuration")
|
||||
Duration getDuration();
|
||||
|
||||
}
|
||||
|
||||
+6
-2
@@ -8,6 +8,7 @@ import com.sap.sailing.domain.base.RaceDefinition;
|
||||
import com.sap.sailing.domain.base.Regatta;
|
||||
import com.sap.sailing.domain.common.NauticalSide;
|
||||
import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.datamining.annotations.Connector;
|
||||
import com.sap.sse.datamining.annotations.Dimension;
|
||||
import com.sap.sse.datamining.annotations.Statistic;
|
||||
@@ -46,10 +47,13 @@ public interface HasTrackedRaceContext {
|
||||
@Dimension(messageKey="IsTracked", ordinal=9)
|
||||
public Boolean isTracked();
|
||||
|
||||
@Statistic(messageKey="NumberOfCompetitorFixes", resultDecimals=0, ordinal=0)
|
||||
@Statistic(messageKey="RaceDuration", ordinal=0)
|
||||
public Duration getDuration();
|
||||
|
||||
@Statistic(messageKey="NumberOfCompetitorFixes", resultDecimals=0, ordinal=1)
|
||||
public int getNumberOfCompetitorFixes();
|
||||
|
||||
@Statistic(messageKey="NumberOfMarkFixes", resultDecimals=0, ordinal=1)
|
||||
@Statistic(messageKey="NumberOfMarkFixes", resultDecimals=0, ordinal=2)
|
||||
public int getNumberOfMarkFixes();
|
||||
|
||||
// Convenience methods for race dependent calculation to avoid code duplication
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ public interface HasWindFixContext extends HasWind {
|
||||
@Connector(scanForStatistics=false)
|
||||
public HasTrackedRaceContext getTrackedRaceContext();
|
||||
|
||||
@Statistic(messageKey="", ordinal=0)
|
||||
@Statistic(messageKey="WindFix", ordinal=0)
|
||||
public Wind getWind();
|
||||
|
||||
@Statistic(messageKey="windFrom", resultDecimals=1, ordinal=1)
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ public class CompetitorOfRaceInLeaderboardRetrievalProcessor extends
|
||||
for (RaceColumn raceColumn : element.getLeaderboard().getRaceColumns()) {
|
||||
for (Competitor competitor : element.getLeaderboard().getCompetitors()) {
|
||||
HasRaceResultOfCompetitorContext raceResultOfCompetitorContext = new RaceResultOfCompetitorWithContext(element, raceColumn, competitor,
|
||||
element.getPolarDataService());
|
||||
element.getLeaderboardGroupContext().getPolarDataService());
|
||||
raceResultsOfCompetitor.add(raceResultOfCompetitorContext);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ public class CompleteManeuverCurveWithEstimationDataRetrievalProcessor extends
|
||||
Competitor competitor = element.getCompetitor();
|
||||
ManeuverDetectorWithEstimationDataSupport maneuverDetector = new ManeuverDetectorWithEstimationDataSupportDecoratorImpl(
|
||||
new ManeuverDetectorImpl(trackedRace, competitor),
|
||||
element.getTrackedRaceContext().getLeaderboardContext().getPolarDataService());
|
||||
element.getTrackedRaceContext().getLeaderboardContext().getLeaderboardGroupContext().getPolarDataService());
|
||||
Iterable<Maneuver> maneuvers = trackedRace.getManeuvers(competitor, false);
|
||||
Iterable<CompleteManeuverCurve> maneuverCurves = maneuverDetector.getCompleteManeuverCurves(maneuvers);
|
||||
Iterable<CompleteManeuverCurveWithEstimationData> maneuversWithEstimationData = maneuverDetector
|
||||
|
||||
+5
-4
@@ -4,21 +4,22 @@ import java.util.Collection;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.sap.sailing.datamining.data.HasLeaderboardGroupContext;
|
||||
import com.sap.sailing.datamining.impl.data.LeaderboardGroupWithContext;
|
||||
import com.sap.sailing.domain.polars.PolarDataService;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sse.datamining.components.Processor;
|
||||
import com.sap.sse.datamining.impl.components.AbstractRetrievalProcessor;
|
||||
|
||||
public class LeaderboardGroupRetrievalProcessor extends AbstractRetrievalProcessor<RacingEventService, LeaderboardGroupWithContext> {
|
||||
public class LeaderboardGroupRetrievalProcessor extends AbstractRetrievalProcessor<RacingEventService, HasLeaderboardGroupContext> {
|
||||
|
||||
public LeaderboardGroupRetrievalProcessor(ExecutorService executor,
|
||||
Collection<Processor<LeaderboardGroupWithContext, ?>> resultReceivers, int retrievalLevel) {
|
||||
super(RacingEventService.class, LeaderboardGroupWithContext.class, executor, resultReceivers, retrievalLevel);
|
||||
Collection<Processor<HasLeaderboardGroupContext, ?>> resultReceivers, int retrievalLevel) {
|
||||
super(RacingEventService.class, HasLeaderboardGroupContext.class, executor, resultReceivers, retrievalLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Iterable<LeaderboardGroupWithContext> retrieveData(RacingEventService element) {
|
||||
protected Iterable<HasLeaderboardGroupContext> retrieveData(RacingEventService element) {
|
||||
final PolarDataService polarDataService = element.getPolarDataService();
|
||||
return element.getLeaderboardGroups()
|
||||
.values()
|
||||
|
||||
+5
-5
@@ -5,24 +5,24 @@ import java.util.Collection;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import com.sap.sailing.datamining.data.HasLeaderboardContext;
|
||||
import com.sap.sailing.datamining.impl.data.LeaderboardGroupWithContext;
|
||||
import com.sap.sailing.datamining.data.HasLeaderboardGroupContext;
|
||||
import com.sap.sailing.datamining.impl.data.LeaderboardWithContext;
|
||||
import com.sap.sailing.domain.leaderboard.Leaderboard;
|
||||
import com.sap.sse.datamining.components.Processor;
|
||||
import com.sap.sse.datamining.impl.components.AbstractRetrievalProcessor;
|
||||
|
||||
public class LeaderboardRetrievalProcessor extends AbstractRetrievalProcessor<LeaderboardGroupWithContext, HasLeaderboardContext> {
|
||||
public class LeaderboardRetrievalProcessor extends AbstractRetrievalProcessor<HasLeaderboardGroupContext, HasLeaderboardContext> {
|
||||
|
||||
public LeaderboardRetrievalProcessor(ExecutorService executor,
|
||||
Collection<Processor<HasLeaderboardContext, ?>> resultReceivers, int retrievalLevel) {
|
||||
super(LeaderboardGroupWithContext.class, HasLeaderboardContext.class, executor, resultReceivers, retrievalLevel);
|
||||
super(HasLeaderboardGroupContext.class, HasLeaderboardContext.class, executor, resultReceivers, retrievalLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Iterable<HasLeaderboardContext> retrieveData(LeaderboardGroupWithContext element) {
|
||||
protected Iterable<HasLeaderboardContext> retrieveData(HasLeaderboardGroupContext element) {
|
||||
Collection<HasLeaderboardContext> leaderboardsWithContext = new ArrayList<>();
|
||||
for (Leaderboard leaderboard : element.getLeaderboardGroup().getLeaderboards()) {
|
||||
leaderboardsWithContext.add(new LeaderboardWithContext(leaderboard, element, element.getPolarDataService()));
|
||||
leaderboardsWithContext.add(new LeaderboardWithContext(leaderboard, element));
|
||||
}
|
||||
return leaderboardsWithContext;
|
||||
}
|
||||
|
||||
+1
-9
@@ -4,17 +4,14 @@ import com.sap.sailing.datamining.data.HasLeaderboardContext;
|
||||
import com.sap.sailing.datamining.data.HasLeaderboardGroupContext;
|
||||
import com.sap.sailing.domain.base.BoatClass;
|
||||
import com.sap.sailing.domain.leaderboard.Leaderboard;
|
||||
import com.sap.sailing.domain.polars.PolarDataService;
|
||||
|
||||
public class LeaderboardWithContext implements HasLeaderboardContext {
|
||||
private final Leaderboard leaderboard;
|
||||
private final HasLeaderboardGroupContext leaderboardGroupContext;
|
||||
private final PolarDataService polarDataService;
|
||||
|
||||
public LeaderboardWithContext(Leaderboard leaderboard, HasLeaderboardGroupContext leaderboardGroupContext, PolarDataService polarDataService) {
|
||||
public LeaderboardWithContext(Leaderboard leaderboard, HasLeaderboardGroupContext leaderboardGroupContext) {
|
||||
this.leaderboard = leaderboard;
|
||||
this.leaderboardGroupContext = leaderboardGroupContext;
|
||||
this.polarDataService = polarDataService;
|
||||
}
|
||||
|
||||
public HasLeaderboardGroupContext getLeaderboardGroupContext() {
|
||||
@@ -31,11 +28,6 @@ public class LeaderboardWithContext implements HasLeaderboardContext {
|
||||
return getLeaderboard().getBoatClass();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PolarDataService getPolarDataService() {
|
||||
return polarDataService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getLeaderboard().getName();
|
||||
|
||||
+16
@@ -29,10 +29,12 @@ import com.sap.sailing.domain.tracking.TrackedLegOfCompetitor;
|
||||
import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
import com.sap.sailing.domain.tracking.WindPositionMode;
|
||||
import com.sap.sse.common.Distance;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.Speed;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
import com.sap.sse.common.impl.MillisecondsDurationImpl;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
import com.sap.sse.datamining.data.Cluster;
|
||||
import com.sap.sse.datamining.shared.impl.dto.ClusterDTO;
|
||||
@@ -357,4 +359,18 @@ public class RaceOfCompetitorWithContext implements HasRaceOfCompetitorContext {
|
||||
return distance / length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Duration getDuration() {
|
||||
Duration duration = null;
|
||||
TrackedRace race = getTrackedRace();
|
||||
Course course = race.getRace().getCourse();
|
||||
MarkPassing startPassing = race.getMarkPassing(competitor, course.getFirstWaypoint());
|
||||
MarkPassing finishPassing = race.getMarkPassing(competitor, course.getLastWaypoint());
|
||||
if (startPassing != null && finishPassing != null) {
|
||||
long durationMillis = finishPassing.getTimePoint().asMillis() - startPassing.getTimePoint().asMillis();
|
||||
duration = new MillisecondsDurationImpl(durationMillis);
|
||||
}
|
||||
return duration;
|
||||
}
|
||||
|
||||
}
|
||||
+22
@@ -17,8 +17,10 @@ import com.sap.sailing.domain.common.tracking.GPSFixMoving;
|
||||
import com.sap.sailing.domain.tracking.GPSFixTrack;
|
||||
import com.sap.sailing.domain.tracking.LineDetails;
|
||||
import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.impl.MillisecondsDurationImpl;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
public class TrackedRaceWithContext implements HasTrackedRaceContext {
|
||||
@@ -113,6 +115,26 @@ public class TrackedRaceWithContext implements HasTrackedRaceContext {
|
||||
public Boolean isTracked() {
|
||||
return getTrackedRace().hasStarted(MillisecondsTimePoint.now());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Duration getDuration() {
|
||||
Duration duration = null;
|
||||
TrackedRace race = getTrackedRace();
|
||||
TimePoint start = race.getStartOfRace();
|
||||
if (start == null) {
|
||||
start = race.getStartOfTracking();
|
||||
}
|
||||
if (start != null) {
|
||||
TimePoint end = race.getEndOfRace();
|
||||
if (end == null) {
|
||||
end = race.getEndOfTracking();
|
||||
}
|
||||
if (end != null) {
|
||||
duration = new MillisecondsDurationImpl(end.asMillis() - start.asMillis());
|
||||
}
|
||||
}
|
||||
return duration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumberOfCompetitorFixes() {
|
||||
|
||||
+5
-2
@@ -130,11 +130,14 @@ public class IncrementalManeuverComputationTest extends AbstractManeuverDetectio
|
||||
performanceMeasurementStartedAt = System.currentTimeMillis();
|
||||
List<Maneuver> normallyDetectedManeuvers = normalManeuverDetector.detectManeuvers();
|
||||
long millisForNormalManeuverDetection = System.currentTimeMillis() - performanceMeasurementStartedAt;
|
||||
int performanceBenefitOfIncrementalManeuverDetectionInPercent = (int) ((1.0 * (millisForNormalManeuverDetection - millisForIncrementalManeuverDetection)
|
||||
/ millisForNormalManeuverDetection) * 100);
|
||||
assertEquals("Incrementally calculated maneuvers differ from normally calculated maneuvers",
|
||||
normallyDetectedManeuvers, incrementallyDetectedManeuvers);
|
||||
assertTrue(
|
||||
"Incremental maneuver detection was not 20% faster in detecting maneuvers incrementally, than the full maneuver detection",
|
||||
millisForIncrementalManeuverDetection * 1.2 < millisForNormalManeuverDetection);
|
||||
"Incremental maneuver detection was not 20% faster in detecting maneuvers incrementally, than the full maneuver detection. The actual performance benefit was: "
|
||||
+ performanceBenefitOfIncrementalManeuverDetectionInPercent + "%",
|
||||
performanceBenefitOfIncrementalManeuverDetectionInPercent >= 20);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -100,9 +100,9 @@ public interface CompleteManeuverCurveWithEstimationData extends Timed, Position
|
||||
|
||||
Distance getDistanceToClosestMark();
|
||||
|
||||
Double getDeviationOfManeuverAngleFromTargetTackAngleInDegrees();
|
||||
Double getTargetTackAngleInDegrees();
|
||||
|
||||
Double getDeviationOfManeuverAngleFromTargetJibeAngleInDegrees();
|
||||
Double getTargetJibeAngleInDegrees();
|
||||
|
||||
/**
|
||||
* Gets whether a mark was crossed within the maneuver curve.
|
||||
|
||||
+13
-12
@@ -27,14 +27,15 @@ public class CompleteManeuverCurveWithEstimationDataImpl implements CompleteMane
|
||||
private final boolean markPassing;
|
||||
private final Position position;
|
||||
private final Distance distanceToClosestMark;
|
||||
private final Double deviationOfManeuverAngleFromTargetTackAngleInDegrees;
|
||||
private final Double deviationOfManeuverAngleFromTargetJibeAngleInDegrees;
|
||||
private final Double targetTackAngleInDegrees;
|
||||
private final Double targetJibeAngleInDegrees;
|
||||
|
||||
public CompleteManeuverCurveWithEstimationDataImpl(Position position, ManeuverMainCurveWithEstimationData mainCurve,
|
||||
ManeuverCurveWithUnstableCourseAndSpeedWithEstimationData curveWithUnstableCourseAndSpeed, Wind wind,
|
||||
int tackingCount, int jibingCount, boolean maneuverStartsByRunningAwayFromWind,
|
||||
Bearing relativeBearingToNextMarkBeforeManeuver, Bearing relativeBearingToNextMarkAfterManeuver,
|
||||
boolean markPassing, Distance distanceToClosestMark, Double deviationOfManeuverAngleFromTargetTackAngleInDegrees, Double deviationOfManeuverAngleFromTargetJibeAngleInDegrees) {
|
||||
boolean markPassing, Distance distanceToClosestMark, Double targetTackAngleInDegrees,
|
||||
Double targetJibeAngleInDegrees) {
|
||||
this.position = position;
|
||||
this.mainCurve = mainCurve;
|
||||
this.curveWithUnstableCourseAndSpeed = curveWithUnstableCourseAndSpeed;
|
||||
@@ -46,8 +47,8 @@ public class CompleteManeuverCurveWithEstimationDataImpl implements CompleteMane
|
||||
this.relativeBearingToNextMarkAfterManeuver = relativeBearingToNextMarkAfterManeuver;
|
||||
this.markPassing = markPassing;
|
||||
this.distanceToClosestMark = distanceToClosestMark;
|
||||
this.deviationOfManeuverAngleFromTargetTackAngleInDegrees = deviationOfManeuverAngleFromTargetTackAngleInDegrees;
|
||||
this.deviationOfManeuverAngleFromTargetJibeAngleInDegrees = deviationOfManeuverAngleFromTargetJibeAngleInDegrees;
|
||||
this.targetTackAngleInDegrees = targetTackAngleInDegrees;
|
||||
this.targetJibeAngleInDegrees = targetJibeAngleInDegrees;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,20 +100,20 @@ public class CompleteManeuverCurveWithEstimationDataImpl implements CompleteMane
|
||||
public Position getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Distance getDistanceToClosestMark() {
|
||||
return distanceToClosestMark;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Double getDeviationOfManeuverAngleFromTargetTackAngleInDegrees() {
|
||||
return deviationOfManeuverAngleFromTargetTackAngleInDegrees;
|
||||
public Double getTargetTackAngleInDegrees() {
|
||||
return targetTackAngleInDegrees;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Double getDeviationOfManeuverAngleFromTargetJibeAngleInDegrees() {
|
||||
return deviationOfManeuverAngleFromTargetJibeAngleInDegrees;
|
||||
public Double getTargetJibeAngleInDegrees() {
|
||||
return targetJibeAngleInDegrees;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+10
-9
@@ -278,7 +278,8 @@ public class ManeuverDetectorWithEstimationDataSupportDecoratorImpl
|
||||
stepWithHighestSpeed.getSpeedWithBearing(), stepWithHighestSpeed.getTimePoint(),
|
||||
maneuverCurve.getMainCurveBoundaries().getTimePoint(),
|
||||
maneuverCurve.getMainCurveBoundaries().getMaxTurningRateInDegreesPerSecond(), courseAtMaxTurningRate,
|
||||
distanceSailedWithinManeuver, projectedManeuverLoss.getDistanceSailedProjectedOnMiddleManeuverAngle(), distanceSailedIfNotManeuvering,
|
||||
distanceSailedWithinManeuver, projectedManeuverLoss.getDistanceSailedProjectedOnMiddleManeuverAngle(),
|
||||
distanceSailedIfNotManeuvering,
|
||||
projectedManeuverLoss.getDistanceSailedIfNotManeuveringProjectedOnMiddleManeuverAngle(),
|
||||
Math.abs(maneuverCurve.getMainCurveBoundaries().getDirectionChangeInDegrees())
|
||||
/ maneuverCurve.getMainCurveBoundaries().getDuration().asSeconds(),
|
||||
@@ -338,9 +339,9 @@ public class ManeuverDetectorWithEstimationDataSupportDecoratorImpl
|
||||
gpsFixesCountFromPreviousManeuver, durationAndAvgSpeedWithBearingAfter.getB(),
|
||||
durationAndAvgSpeedWithBearingAfter.getA(), gpsFixesCountToNextManeuver, distanceSailedWithinManeuver,
|
||||
projectedManeuverLoss.getDistanceSailedProjectedOnMiddleManeuverAngle(), distanceSailedIfNotManeuvering,
|
||||
projectedManeuverLoss.getDistanceSailedIfNotManeuveringProjectedOnMiddleManeuverAngle(), gpsFixCountWithinWholeCurve,
|
||||
longestGpsFixIntervalBetweenTwoFixes, intervalBetweenLastFixOfCurveAndNextFix,
|
||||
intervalBetweenFirstFixOfCurveAndPreviousFix);
|
||||
projectedManeuverLoss.getDistanceSailedIfNotManeuveringProjectedOnMiddleManeuverAngle(),
|
||||
gpsFixCountWithinWholeCurve, longestGpsFixIntervalBetweenTwoFixes,
|
||||
intervalBetweenLastFixOfCurveAndNextFix, intervalBetweenFirstFixOfCurveAndPreviousFix);
|
||||
TimePoint maneuverTimePoint = maneuverCurve.getMainCurveBoundaries().getTimePoint();
|
||||
Position maneuverPosition = maneuverDetector.track.getEstimatedPosition(maneuverTimePoint,
|
||||
/* extrapolate */false);
|
||||
@@ -357,8 +358,8 @@ public class ManeuverDetectorWithEstimationDataSupportDecoratorImpl
|
||||
.getManeuverCurveWithStableSpeedAndCourseBoundaries().getSpeedWithBearingAfter().getBearing());
|
||||
BoatClass boatClass = maneuverDetector.trackedRace.getRace().getBoatOfCompetitor(maneuverDetector.competitor)
|
||||
.getBoatClass();
|
||||
Double deviationFromTackAngle = null;
|
||||
Double deviationFromJibeAngle = null;
|
||||
Double targetTackAngle = null;
|
||||
Double targetJibeAngle = null;
|
||||
Speed boatSpeed = curveWithUnstableCourseAndSpeed.getSpeedWithBearingBefore()
|
||||
.compareTo(curveWithUnstableCourseAndSpeed.getSpeedWithBearingAfter()) < 0
|
||||
? curveWithUnstableCourseAndSpeed.getSpeedWithBearingBefore()
|
||||
@@ -369,11 +370,11 @@ public class ManeuverDetectorWithEstimationDataSupportDecoratorImpl
|
||||
SpeedWithBearingWithConfidence<Void> closestJibeTwa = polarDataService.getClosestTwaTws(ManeuverType.JIBE,
|
||||
boatSpeed, curveWithUnstableCourseAndSpeed.getDirectionChangeInDegrees(), boatClass);
|
||||
if (closestTackTwa != null) {
|
||||
deviationFromTackAngle = polarDataService.getManeuverAngleInDegreesFromTwa(
|
||||
targetTackAngle = polarDataService.getManeuverAngleInDegreesFromTwa(
|
||||
closestTackTwa.getObject().getBearing().getDegrees(), ManeuverType.TACK);
|
||||
}
|
||||
if (closestJibeTwa != null) {
|
||||
deviationFromJibeAngle = polarDataService.getManeuverAngleInDegreesFromTwa(
|
||||
targetJibeAngle = polarDataService.getManeuverAngleInDegreesFromTwa(
|
||||
closestJibeTwa.getObject().getBearing().getDegrees(), ManeuverType.JIBE);
|
||||
}
|
||||
}
|
||||
@@ -383,7 +384,7 @@ public class ManeuverDetectorWithEstimationDataSupportDecoratorImpl
|
||||
curveWithUnstableCourseAndSpeed, wind, numberOfTacks, numberOfJibes,
|
||||
maneuverStartsByRunningAwayFromWind, relativeBearingToNextMarkPassingBeforeManeuver,
|
||||
relativeBearingToNextMarkPassingAfterManeuver, maneuverCurve.isMarkPassing(), closestDistanceToMark,
|
||||
deviationFromTackAngle, deviationFromJibeAngle);
|
||||
targetTackAngle, targetJibeAngle);
|
||||
}
|
||||
|
||||
public Distance getClosestDistanceToMark(TimePoint timePoint) {
|
||||
|
||||
+8
-17
@@ -205,6 +205,7 @@ public class CrossTrackErrorCache extends AbstractRaceChangeListener {
|
||||
owner.addListener(this);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
private interface CrossTrackErrorMeterRetriever {
|
||||
double getDistanceInMetersSumFromStart(CrossTrackErrorSumAndNumberOfFixes cacheEntry);
|
||||
}
|
||||
@@ -220,12 +221,7 @@ public class CrossTrackErrorCache extends AbstractRaceChangeListener {
|
||||
*/
|
||||
public Distance getAverageAbsoluteCrossTrackError(Competitor competitor, TimePoint from, TimePoint to, boolean upwindOnly,
|
||||
boolean waitForLatest) throws NoWindException {
|
||||
CrossTrackErrorMeterRetriever absoluteMetersRetriever = new CrossTrackErrorMeterRetriever() {
|
||||
@Override
|
||||
public double getDistanceInMetersSumFromStart(CrossTrackErrorSumAndNumberOfFixes cacheEntry) {
|
||||
return cacheEntry.getAbsoluteDistanceInMetersSumFromStart();
|
||||
}
|
||||
};
|
||||
CrossTrackErrorMeterRetriever absoluteMetersRetriever = cacheEntry->cacheEntry.getAbsoluteDistanceInMetersSumFromStart();
|
||||
return getAbsoluteOrSignedAverageCrossTrackError(competitor, from, to, upwindOnly, waitForLatest, absoluteMetersRetriever);
|
||||
}
|
||||
|
||||
@@ -240,20 +236,15 @@ public class CrossTrackErrorCache extends AbstractRaceChangeListener {
|
||||
*/
|
||||
public Distance getAverageSignedCrossTrackError(Competitor competitor, TimePoint from, TimePoint to, boolean upwindOnly,
|
||||
boolean waitForLatest) throws NoWindException {
|
||||
CrossTrackErrorMeterRetriever signedMetersRetriever = new CrossTrackErrorMeterRetriever() {
|
||||
@Override
|
||||
public double getDistanceInMetersSumFromStart(CrossTrackErrorSumAndNumberOfFixes cacheEntry) {
|
||||
return cacheEntry.getSignedDistanceInMetersSumFromStart();
|
||||
}
|
||||
};
|
||||
CrossTrackErrorMeterRetriever signedMetersRetriever = cacheEntry->cacheEntry.getSignedDistanceInMetersSumFromStart();
|
||||
return getAbsoluteOrSignedAverageCrossTrackError(competitor, from, to, upwindOnly, waitForLatest, signedMetersRetriever);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param absoluteMetersRetriever determines whether the absolute or signed cross track error will be aggregated
|
||||
* @param absoluteOrSignedMetersRetriever determines whether the absolute or signed cross track error will be aggregated
|
||||
*/
|
||||
private Distance getAbsoluteOrSignedAverageCrossTrackError(Competitor competitor, TimePoint from, TimePoint to,
|
||||
boolean upwindOnly, boolean waitForLatest, CrossTrackErrorMeterRetriever absoluteMetersRetriever)
|
||||
boolean upwindOnly, boolean waitForLatest, CrossTrackErrorMeterRetriever absoluteOrSignedMetersRetriever)
|
||||
throws NoWindException {
|
||||
Track<CrossTrackErrorSumAndNumberOfFixes> cacheForCompetitor = cachePerCompetitor.get(competitor, waitForLatest);
|
||||
double distanceInMeters = 0;
|
||||
@@ -268,7 +259,7 @@ public class CrossTrackErrorCache extends AbstractRaceChangeListener {
|
||||
final MarkPassing legStartMarkPassing = owner.getMarkPassing(competitor, leg.getFrom());
|
||||
if (legStartMarkPassing != null) {
|
||||
if (!upwindOnly || trackedLeg.getLegType(legStartMarkPassing.getTimePoint()) == LegType.UPWIND) {
|
||||
TimePoint start;
|
||||
final TimePoint start;
|
||||
final TimePoint legStart = legStartMarkPassing.getTimePoint();
|
||||
if (legStart.compareTo(from) < 0) {
|
||||
// the interval requested starts after this leg's start:
|
||||
@@ -277,7 +268,7 @@ public class CrossTrackErrorCache extends AbstractRaceChangeListener {
|
||||
start = legStart;
|
||||
}
|
||||
final MarkPassing legEndMarkPassing = owner.getMarkPassing(competitor, leg.getTo());
|
||||
TimePoint end;
|
||||
final TimePoint end;
|
||||
if (legEndMarkPassing == null || legEndMarkPassing.getTimePoint().compareTo(to) >= 0) {
|
||||
// no next mark passing, or next mark passing is beyond the "to" time point; aggregate up to "to"
|
||||
end = to;
|
||||
@@ -294,7 +285,7 @@ public class CrossTrackErrorCache extends AbstractRaceChangeListener {
|
||||
}
|
||||
CrossTrackErrorSumAndNumberOfFixes endAggregate = cacheForCompetitor.getLastFixAtOrBefore(end);
|
||||
if (endAggregate != null) {
|
||||
distanceInMeters += absoluteMetersRetriever.getDistanceInMetersSumFromStart(endAggregate) - absoluteMetersRetriever.getDistanceInMetersSumFromStart(startAggregate);
|
||||
distanceInMeters += absoluteOrSignedMetersRetriever.getDistanceInMetersSumFromStart(endAggregate) - absoluteOrSignedMetersRetriever.getDistanceInMetersSumFromStart(startAggregate);
|
||||
count += endAggregate.getFixCountFromStart() - startAggregate.getFixCountFromStart();
|
||||
startAggregate = endAggregate;
|
||||
}
|
||||
|
||||
-1
@@ -20,7 +20,6 @@ public class GetBoatPositionsAction extends AbstractGetMapRelatedDataAction<Comp
|
||||
@Override
|
||||
public void execute(final AsyncCallback<CompactBoatPositionsDTO> callback) {
|
||||
Map<String, Date> fromByCompetitorIdAsString = new HashMap<String, Date>();
|
||||
System.out.println(fromByCompetitorIdAsString);
|
||||
for (Map.Entry<CompetitorDTO, Date> fromEntry : getFrom().entrySet()) {
|
||||
fromByCompetitorIdAsString.put(fromEntry.getKey().getIdAsString(), fromEntry.getValue());
|
||||
}
|
||||
|
||||
+4
-10
@@ -49,12 +49,10 @@ public class WinningLanesMode extends RaceBoardModeWithPerRaceCompetitors {
|
||||
raceDetailsToShow.add(DetailType.RACE_TIME_TRAVELED);
|
||||
final SingleRaceLeaderboardSettings additiveSettings = LeaderboardSettingsFactory.getInstance().createNewSettingsWithCustomRaceDetails(raceDetailsToShow);
|
||||
((RaceBoardComponentContext) leaderboardPanel.getComponentContext()).addModesPatching(leaderboardPanel, additiveSettings, new OnSettingsReloadedCallback<SingleRaceLeaderboardSettings>() {
|
||||
|
||||
@Override
|
||||
public void onSettingsReloaded(SingleRaceLeaderboardSettings patchedSettings) {
|
||||
leaderboardPanel.updateSettings(patchedSettings);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -79,14 +77,11 @@ public class WinningLanesMode extends RaceBoardModeWithPerRaceCompetitors {
|
||||
defaultSettings.isShowEstimatedDuration(),
|
||||
defaultSettings.getStartCountDownFontSizeScaling(),
|
||||
defaultSettings.isShowManeuverLossVisualization());
|
||||
|
||||
((RaceBoardComponentContext) raceMap.getComponentContext()).addModesPatching(raceMap, additiveSettings, new OnSettingsReloadedCallback<RaceMapSettings>() {
|
||||
|
||||
@Override
|
||||
public void onSettingsReloaded(RaceMapSettings patchedSettings) {
|
||||
raceMap.updateSettings(patchedSettings);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -129,17 +124,16 @@ public class WinningLanesMode extends RaceBoardModeWithPerRaceCompetitors {
|
||||
stopReceivingLeaderboard();
|
||||
adjustLeaderboardSettings();
|
||||
}
|
||||
if (adjustedLeaderboardSettings && tailLength != null) {
|
||||
adjustMapSettings();
|
||||
}
|
||||
if (getLeaderboardForSpecificTimePoint() == null && tailLength != null && getLeaderboard() != null && getRaceColumn() != null) {
|
||||
loadLeaderboardForSpecificTimePoint(getLeaderboard().name, getRaceColumn().getName(), getTimer().getTime());
|
||||
}
|
||||
if (!adjustedCompetitorSelection && getLeaderboardForSpecificTimePoint() != null && getCompetitorsInRace() != null) {
|
||||
stopReceivingCompetitorsInRace();
|
||||
adjustedCompetitorSelection = true;
|
||||
updateCompetitorSelection();
|
||||
}
|
||||
if (adjustedLeaderboardSettings && tailLength != null && adjustedCompetitorSelection) {
|
||||
adjustMapSettings();
|
||||
}
|
||||
updateCompetitorSelection();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+9
-9
@@ -1843,7 +1843,6 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
boolean extrapolate, LegIdentifier simulationLegIdentifier,
|
||||
byte[] md5OfIdsAsStringOfCompetitorParticipatingInRaceInAlphanumericOrderOfTheirID,
|
||||
Date timeToGetTheEstimatedDurationFor, boolean estimatedDurationRequired) throws NoWindException {
|
||||
Duration estimatedDuration = null;
|
||||
final HashSet<String> raceCompetitorIdsAsStrings;
|
||||
final TrackedRace trackedRace = getExistingTrackedRace(raceIdentifier);
|
||||
// if md5OfIdsAsStringOfCompetitorParticipatingInRaceInAlphanumericOrderOfTheirID is null, Arrays.equals will return false, and the
|
||||
@@ -1856,10 +1855,12 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
raceCompetitorIdsAsStrings.add(c.getId().toString());
|
||||
}
|
||||
}
|
||||
if(estimatedDurationRequired){
|
||||
estimatedDuration = getEstimationForTargetTime(timeToGetTheEstimatedDurationFor, estimatedDuration, trackedRace);
|
||||
final Duration estimatedDuration;
|
||||
if (estimatedDurationRequired) {
|
||||
estimatedDuration = getEstimationForTargetTime(timeToGetTheEstimatedDurationFor, trackedRace);
|
||||
} else {
|
||||
estimatedDuration = null;
|
||||
}
|
||||
|
||||
final Map<CompetitorDTO, List<GPSFixDTOWithSpeedWindTackAndLegType>> boatPositions = getBoatPositionsInternal(raceIdentifier,
|
||||
fromPerCompetitorIdAsString, toPerCompetitorIdAsString, extrapolate);
|
||||
final CoursePositionsDTO coursePositions = getCoursePositions(raceIdentifier, date);
|
||||
@@ -1870,18 +1871,17 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
SimulationService simulationService = getService().getSimulationService();
|
||||
simulationResultVersion = simulationService.getSimulationResultsVersion(simulationLegIdentifier);
|
||||
}
|
||||
|
||||
return new CompactRaceMapDataDTO(boatPositions, coursePositions, courseSidelines, quickRanks,
|
||||
simulationResultVersion, raceCompetitorIdsAsStrings, estimatedDuration);
|
||||
}
|
||||
|
||||
private Duration getEstimationForTargetTime(Date time, Duration estimatedDuration, final TrackedRace trackedRace) {
|
||||
if(trackedRace != null){
|
||||
private Duration getEstimationForTargetTime(Date time, final TrackedRace trackedRace) {
|
||||
Duration estimatedDuration = null;
|
||||
if (trackedRace != null) {
|
||||
try {
|
||||
estimatedDuration = trackedRace.getEstimatedTimeToComplete(new MillisecondsTimePoint(time)).getExpectedDuration();
|
||||
} catch (NotEnoughDataHasBeenAddedException | NoWindException e) {
|
||||
e.printStackTrace();
|
||||
} finally{
|
||||
logger.log(Level.WARNING, "Problem computing the estimated race duration", e);
|
||||
}
|
||||
}
|
||||
return estimatedDuration;
|
||||
|
||||
@@ -18,9 +18,9 @@ public abstract class HostPage extends PageObject {
|
||||
protected static final String NO_CODE_SERVER_PARAMTER_VALUE = ""; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* </p>The default timeout of 60 seconds for the initialization of the page object.</p>
|
||||
* </p>The default timeout of 120 seconds for the initialization of the page object.</p>
|
||||
*/
|
||||
protected static final int DEFAULT_PAGE_LOAD_TIMEOUT = 120;
|
||||
protected static final int DEFAULT_PAGE_LOAD_TIMEOUT_IN_SECONDS = 120;
|
||||
|
||||
public static final String getGWTCodeServerAndLocale() {
|
||||
StringBuilder queryBuilder = new StringBuilder("locale=en");
|
||||
@@ -64,13 +64,12 @@ public abstract class HostPage extends PageObject {
|
||||
*/
|
||||
@Override
|
||||
protected void initElements() {
|
||||
waitForAjaxRequests(getPageLoadTimeOut(), 5);
|
||||
|
||||
waitForAjaxRequests(getPageLoadTimeOutInSeconds(), 5 /* seconds */);
|
||||
super.initElements();
|
||||
}
|
||||
|
||||
protected int getPageLoadTimeOut() {
|
||||
return DEFAULT_PAGE_LOAD_TIMEOUT;
|
||||
protected int getPageLoadTimeOutInSeconds() {
|
||||
return DEFAULT_PAGE_LOAD_TIMEOUT_IN_SECONDS;
|
||||
}
|
||||
|
||||
protected interface HostPageSupplier<T extends HostPage> {
|
||||
|
||||
+22
-22
@@ -132,15 +132,15 @@ public class PageObject {
|
||||
*
|
||||
* @param input
|
||||
*
|
||||
* @param timeout
|
||||
* @param timeoutInSeconds
|
||||
*
|
||||
* @param polling
|
||||
* @param pollingEverySoManySeconds
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
public static <T> FluentWait<T> createFluentWait(T input, int timeout, int polling) {
|
||||
return createFluentWait(input, timeout, polling, Collections.<Class<? extends Throwable>>emptyList());
|
||||
public static <T> FluentWait<T> createFluentWait(T input, int timeoutInSeconds, int pollingEverySoManySeconds) {
|
||||
return createFluentWait(input, timeoutInSeconds, pollingEverySoManySeconds, Collections.<Class<? extends Throwable>>emptyList());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,20 +168,20 @@ public class PageObject {
|
||||
*
|
||||
* @param input
|
||||
*
|
||||
* @param timeout
|
||||
* @param timeoutInSeconds
|
||||
*
|
||||
* @param polling
|
||||
* @param pollingEverySoManySeconds
|
||||
*
|
||||
* @param exceptions
|
||||
*
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
public static <T> FluentWait<T> createFluentWait(T input, int timeout, int polling,
|
||||
public static <T> FluentWait<T> createFluentWait(T input, int timeoutInSeconds, int pollingEverySoManySeconds,
|
||||
Collection<Class<? extends Throwable>> exceptions) {
|
||||
FluentWait<T> wait = new FluentWait<>(input);
|
||||
wait.withTimeout(timeout, TimeUnit.SECONDS);
|
||||
wait.pollingEvery(polling, TimeUnit.SECONDS);
|
||||
wait.withTimeout(timeoutInSeconds, TimeUnit.SECONDS);
|
||||
wait.pollingEvery(pollingEverySoManySeconds, TimeUnit.SECONDS);
|
||||
wait.ignoreAll(exceptions);
|
||||
|
||||
return wait;
|
||||
@@ -223,7 +223,7 @@ public class PageObject {
|
||||
|
||||
/**
|
||||
* <p>Initialize the page object. The default implementation use a factory to lazily initialize the elements
|
||||
* (annotated fields) of the page object using the timeout duration returned by {@link #getPageLoadTimeOut()}.
|
||||
* (annotated fields) of the page object using the timeout duration returned by {@link #getPageLoadTimeOutInSeconds()}.
|
||||
* To get a field lazily initialized you have to annotate the field either with {@link FindBy} or with
|
||||
* {@link FindBys}. If the element never changes (that is, that the same instance in the DOM can always be used)
|
||||
* it is also possible to use a cache for the lookup by using the annotation {@code CacheLookup} in addition.</p>
|
||||
@@ -431,15 +431,15 @@ public class PageObject {
|
||||
* and polling interval. In reality, the interval may be greater as the cost of actually evaluating the condition
|
||||
* is not factored in.</p>
|
||||
*
|
||||
* @param timeout
|
||||
* The timeout duration for the waiting.
|
||||
* @param polling
|
||||
* The interval in which the check should be performed.
|
||||
* @param timeoutInSeconds
|
||||
* The timeout duration for the waiting in seconds.
|
||||
* @param pollingEverySoManySeconds
|
||||
* The interval in seconds in which the check should be performed.
|
||||
* @throws org.openqa.selenium.TimeoutException
|
||||
* if the timeout expires.
|
||||
*/
|
||||
protected void waitForAjaxRequests(int timeout, int polling) {
|
||||
waitForAjaxRequests(AjaxCallsComplete.CATEGORY_GLOBAL, timeout, polling);
|
||||
protected void waitForAjaxRequests(int timeoutInSeconds, int pollingEverySoManySeconds) {
|
||||
waitForAjaxRequests(AjaxCallsComplete.CATEGORY_GLOBAL, timeoutInSeconds, pollingEverySoManySeconds);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -449,15 +449,15 @@ public class PageObject {
|
||||
*
|
||||
* @param category
|
||||
* The category of Ajax requests to wait for.
|
||||
* @param timeout
|
||||
* The timeout duration for the waiting.
|
||||
* @param polling
|
||||
* The interval in which the check should be performed.
|
||||
* @param timeoutInSeconds
|
||||
* The timeout duration for the waiting in seconds.
|
||||
* @param pollingEverySoManySeconds
|
||||
* The interval in seconds in which the check should be performed.
|
||||
* @throws org.openqa.selenium.TimeoutException
|
||||
* if the timeout expires.
|
||||
*/
|
||||
protected void waitForAjaxRequests(String category, int timeout, int polling) {
|
||||
FluentWait<WebDriver> wait = createFluentWait(this.driver, timeout, polling);
|
||||
protected void waitForAjaxRequests(String category, int timeoutInSeconds, int pollingEverySoManySeconds) {
|
||||
FluentWait<WebDriver> wait = createFluentWait(this.driver, timeoutInSeconds, pollingEverySoManySeconds);
|
||||
|
||||
wait.until(new AjaxCallsComplete(category));
|
||||
}
|
||||
|
||||
+4
@@ -10,6 +10,7 @@ import javax.xml.bind.DatatypeConverter;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.selenium.pages.adminconsole.AdminConsolePage;
|
||||
@@ -83,6 +84,7 @@ public class SettingsTest extends AbstractSeleniumTest {
|
||||
* settings and global settings.
|
||||
*/
|
||||
@Test
|
||||
@Ignore
|
||||
public void testRaceBoardPageSettingsStorage() throws InterruptedException, UnsupportedEncodingException {
|
||||
AdminConsolePage adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
|
||||
EventConfigurationPanelPO events = adminConsole.goToEvents();
|
||||
@@ -257,6 +259,7 @@ public class SettingsTest extends AbstractSeleniumTest {
|
||||
* Verifies that settings for different modes are distinct and do not have an effect on other modes.
|
||||
*/
|
||||
@Test
|
||||
@Ignore
|
||||
public void testThatUserDefaultsForOneModeDoNotHaveAnEffectOnAnotherMode() throws InterruptedException, UnsupportedEncodingException {
|
||||
AdminConsolePage adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
|
||||
EventConfigurationPanelPO events = adminConsole.goToEvents();
|
||||
@@ -337,6 +340,7 @@ public class SettingsTest extends AbstractSeleniumTest {
|
||||
* Verifies that settings are stored for raceboard.
|
||||
*/
|
||||
@Test
|
||||
@Ignore
|
||||
public void testThatModeDependentSettingsAreStoredForOneMode() throws InterruptedException, UnsupportedEncodingException {
|
||||
AdminConsolePage adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
|
||||
EventConfigurationPanelPO events = adminConsole.goToEvents();
|
||||
|
||||
+12
-16
@@ -130,14 +130,14 @@ public class EstimationDataSerializationDeserializationTest {
|
||||
Bearing relativeBearingToNextMarkAfterManeuver = new DegreeBearingImpl(10.01);
|
||||
boolean markPassing = true;
|
||||
Distance closestDistanceToMark = new MeterDistance(3.0);
|
||||
Double deviationFromTargetTackAngle = 23.30;
|
||||
Double deviationFromTargetJibeAngle = 22.30;
|
||||
Double targetTackAngle = 23.30;
|
||||
Double targetJibeAngle = 22.30;
|
||||
|
||||
CompleteManeuverCurveWithEstimationData toSerialize = new CompleteManeuverCurveWithEstimationDataImpl(
|
||||
maneuverPosition, mainCurve, curve, wind, tackingCount, jibingCount,
|
||||
maneuverStartsByRunningAwayFromWind, relativeBearingToNextMarkBeforeManeuver,
|
||||
relativeBearingToNextMarkAfterManeuver, markPassing, closestDistanceToMark,
|
||||
deviationFromTargetTackAngle, deviationFromTargetJibeAngle);
|
||||
relativeBearingToNextMarkAfterManeuver, markPassing, closestDistanceToMark, targetTackAngle,
|
||||
targetJibeAngle);
|
||||
CompleteManeuverCurveWithEstimationDataJsonSerializer serializer = new CompleteManeuverCurveWithEstimationDataJsonSerializer(
|
||||
new ManeuverMainCurveWithEstimationDataJsonSerializer(),
|
||||
new ManeuverCurveWithUnstableCourseAndSpeedWithEstimationDataJsonSerializer(),
|
||||
@@ -149,10 +149,8 @@ public class EstimationDataSerializationDeserializationTest {
|
||||
new ManeuverWindJsonDeserializer(), new PositionJsonDeserializer());
|
||||
CompleteManeuverCurveWithEstimationData deserialized = deserializer.deserialize(json);
|
||||
|
||||
assertEquals(deviationFromTargetJibeAngle,
|
||||
deserialized.getDeviationOfManeuverAngleFromTargetJibeAngleInDegrees());
|
||||
assertEquals(deviationFromTargetTackAngle,
|
||||
deserialized.getDeviationOfManeuverAngleFromTargetTackAngleInDegrees());
|
||||
assertEquals(targetJibeAngle, deserialized.getTargetJibeAngleInDegrees());
|
||||
assertEquals(targetTackAngle, deserialized.getTargetTackAngleInDegrees());
|
||||
assertEquals(closestDistanceToMark, deserialized.getDistanceToClosestMark());
|
||||
assertEquals(maneuverPosition, deserialized.getPosition());
|
||||
assertEquals(tackingCount, deserialized.getTackingCount());
|
||||
@@ -310,14 +308,14 @@ public class EstimationDataSerializationDeserializationTest {
|
||||
boolean markPassing = false;
|
||||
DegreePosition maneuverPosition = new DegreePosition(50.325246, 11.148556);
|
||||
Distance closestDistanceToMark = null;
|
||||
Double deviationFromTargetTackAngle = null;
|
||||
Double deviationFromTargetJibeAngle = null;
|
||||
Double targetTackAngle = null;
|
||||
Double targetJibeAngle = null;
|
||||
|
||||
CompleteManeuverCurveWithEstimationData toSerialize = new CompleteManeuverCurveWithEstimationDataImpl(
|
||||
maneuverPosition, mainCurve, curve, wind, tackingCount, jibingCount,
|
||||
maneuverStartsByRunningAwayFromWind, relativeBearingToNextMarkBeforeManeuver,
|
||||
relativeBearingToNextMarkAfterManeuver, markPassing, closestDistanceToMark,
|
||||
deviationFromTargetTackAngle, deviationFromTargetJibeAngle);
|
||||
relativeBearingToNextMarkAfterManeuver, markPassing, closestDistanceToMark, targetTackAngle,
|
||||
targetJibeAngle);
|
||||
CompleteManeuverCurveWithEstimationDataJsonSerializer serializer = new CompleteManeuverCurveWithEstimationDataJsonSerializer(
|
||||
new ManeuverMainCurveWithEstimationDataJsonSerializer(),
|
||||
new ManeuverCurveWithUnstableCourseAndSpeedWithEstimationDataJsonSerializer(),
|
||||
@@ -329,10 +327,8 @@ public class EstimationDataSerializationDeserializationTest {
|
||||
new ManeuverWindJsonDeserializer(), new PositionJsonDeserializer());
|
||||
CompleteManeuverCurveWithEstimationData deserialized = deserializer.deserialize(json);
|
||||
|
||||
assertEquals(deviationFromTargetJibeAngle,
|
||||
deserialized.getDeviationOfManeuverAngleFromTargetJibeAngleInDegrees());
|
||||
assertEquals(deviationFromTargetTackAngle,
|
||||
deserialized.getDeviationOfManeuverAngleFromTargetTackAngleInDegrees());
|
||||
assertEquals(targetJibeAngle, deserialized.getTargetJibeAngleInDegrees());
|
||||
assertEquals(targetTackAngle, deserialized.getTargetTackAngleInDegrees());
|
||||
assertEquals(closestDistanceToMark, deserialized.getDistanceToClosestMark());
|
||||
assertEquals(maneuverPosition, deserialized.getPosition());
|
||||
assertEquals(tackingCount, deserialized.getTackingCount());
|
||||
|
||||
+5
-6
@@ -67,16 +67,15 @@ public class CompleteManeuverCurveWithEstimationDataJsonDeserializer
|
||||
CompleteManeuverCurveWithEstimationDataJsonSerializer.RELATIVE_BEARING_TO_NEXT_MARK_AFTER_MANEUVER);
|
||||
Double closestDistanceToMarkInMeters = (Double) object
|
||||
.get(CompleteManeuverCurveWithEstimationDataJsonSerializer.CLOSEST_DISTANCE_TO_MARK);
|
||||
Double deviationFromTargetTackAngle = (Double) object
|
||||
.get(CompleteManeuverCurveWithEstimationDataJsonSerializer.DEVIATION_FROM_TARGET_TACK_ANGLE);
|
||||
Double deviationFromTargetJibeAngle = (Double) object
|
||||
.get(CompleteManeuverCurveWithEstimationDataJsonSerializer.DEVIATION_FROM_TARGET_JIBE_ANGLE);
|
||||
Double targetTackAngle = (Double) object
|
||||
.get(CompleteManeuverCurveWithEstimationDataJsonSerializer.TARGET_TACK_ANGLE);
|
||||
Double targetJibeAngle = (Double) object
|
||||
.get(CompleteManeuverCurveWithEstimationDataJsonSerializer.TARGET_JIBE_ANGLE);
|
||||
return new CompleteManeuverCurveWithEstimationDataImpl(position, mainCurve, curveWithUnstableCourseAndSpeed,
|
||||
wind, tackingCount, jibingCount, maneuverStartsByRunningAwayFromWind,
|
||||
convertBearing(relativeBearingToNextMarkBeforeManeuver),
|
||||
convertBearing(relativeBearingToNextMarkAfterManeuver), markPassing,
|
||||
convertDistance(closestDistanceToMarkInMeters), deviationFromTargetTackAngle,
|
||||
deviationFromTargetJibeAngle);
|
||||
convertDistance(closestDistanceToMarkInMeters), targetTackAngle, targetJibeAngle);
|
||||
}
|
||||
|
||||
private Bearing convertBearing(Double degrees) {
|
||||
|
||||
+22
-22
@@ -26,7 +26,7 @@ import com.sap.sse.common.impl.MillisecondsDurationImpl;
|
||||
*
|
||||
*/
|
||||
public class CompetitorTrackWithEstimationDataJsonSerializer extends AbstractTrackedRaceDataJsonSerializer {
|
||||
public static final String elements = "elements";
|
||||
public static final String ELEMENTS = "elements";
|
||||
public static final String BOAT_CLASS = "boatClass";
|
||||
public static final String COMPETITOR_NAME = "competitorName";
|
||||
public static final String AVG_INTERVAL_BETWEEN_FIXES_IN_SECONDS = "avgIntervalBetweenFixesInSeconds";
|
||||
@@ -67,27 +67,27 @@ public class CompetitorTrackWithEstimationDataJsonSerializer extends AbstractTra
|
||||
for (Competitor competitor : trackedRace.getRace().getCompetitors()) {
|
||||
ManeuverDetectorImpl maneuverDetector = new ManeuverDetectorImpl(trackedRace, competitor);
|
||||
TrackTimeInfo trackTimeInfo = maneuverDetector.getTrackTimeInfo();
|
||||
TimePoint from = null;
|
||||
TimePoint to = null;
|
||||
if (startBeforeStartLineInSeconds != null) {
|
||||
from = trackTimeInfo.getTrackStartTimePoint()
|
||||
.minus(new MillisecondsDurationImpl(startBeforeStartLineInSeconds * 1000L));
|
||||
} else if (startAfterFinishLineInSeconds != null) {
|
||||
from = trackTimeInfo.getTrackEndTimePoint()
|
||||
.plus(new MillisecondsDurationImpl(startAfterFinishLineInSeconds * 1000L));
|
||||
} else {
|
||||
from = trackTimeInfo.getTrackStartTimePoint();
|
||||
}
|
||||
if (endAfterFinishLineInSeconds != null) {
|
||||
to = trackTimeInfo.getTrackEndTimePoint()
|
||||
.plus(new MillisecondsDurationImpl(endAfterFinishLineInSeconds * 1000L));
|
||||
} else if (endBeforeStartLineInSeconds != null) {
|
||||
to = trackTimeInfo.getTrackStartTimePoint()
|
||||
.minus(new MillisecondsDurationImpl(endBeforeStartLineInSeconds * 1000L));
|
||||
} else {
|
||||
to = trackTimeInfo.getTrackEndTimePoint();
|
||||
}
|
||||
if (trackTimeInfo != null) {
|
||||
TimePoint from = null;
|
||||
TimePoint to = null;
|
||||
if (startBeforeStartLineInSeconds != null) {
|
||||
from = trackTimeInfo.getTrackStartTimePoint()
|
||||
.minus(new MillisecondsDurationImpl(startBeforeStartLineInSeconds * 1000L));
|
||||
} else if (startAfterFinishLineInSeconds != null) {
|
||||
from = trackTimeInfo.getTrackEndTimePoint()
|
||||
.plus(new MillisecondsDurationImpl(startAfterFinishLineInSeconds * 1000L));
|
||||
} else {
|
||||
from = trackTimeInfo.getTrackStartTimePoint();
|
||||
}
|
||||
if (endAfterFinishLineInSeconds != null) {
|
||||
to = trackTimeInfo.getTrackEndTimePoint()
|
||||
.plus(new MillisecondsDurationImpl(endAfterFinishLineInSeconds * 1000L));
|
||||
} else if (endBeforeStartLineInSeconds != null) {
|
||||
to = trackTimeInfo.getTrackStartTimePoint()
|
||||
.minus(new MillisecondsDurationImpl(endBeforeStartLineInSeconds * 1000L));
|
||||
} else {
|
||||
to = trackTimeInfo.getTrackEndTimePoint();
|
||||
}
|
||||
final JSONObject forCompetitorJson = new JSONObject();
|
||||
byCompetitorJson.add(forCompetitorJson);
|
||||
forCompetitorJson.put(COMPETITOR_NAME, competitor.getName());
|
||||
@@ -111,7 +111,7 @@ public class CompetitorTrackWithEstimationDataJsonSerializer extends AbstractTra
|
||||
: trackTimeInfo.getTrackEndTimePoint().asMillis());
|
||||
forCompetitorJson.put(MARK_PASSINGS_COUNT, getMarkPassingsCount(trackedRace, competitor));
|
||||
forCompetitorJson.put(WAYPOINTS_COUNT, getWaypointsCount(trackedRace));
|
||||
forCompetitorJson.put(elements,
|
||||
forCompetitorJson.put(ELEMENTS,
|
||||
elementsJsonSerializer.serialize(trackedRace, competitor, from, to, trackTimeInfo));
|
||||
}
|
||||
}
|
||||
|
||||
+4
-6
@@ -24,8 +24,8 @@ public class CompleteManeuverCurveWithEstimationDataJsonSerializer
|
||||
public static final String RELATIVE_BEARING_TO_NEXT_MARK_BEFORE_MANEUVER = "relativeBearingToNextMarkBeforeManeuver";
|
||||
public static final String RELATIVE_BEARING_TO_NEXT_MARK_AFTER_MANEUVER = "relativeBearingToNextMarkAfterManeuver";
|
||||
public static final String CLOSEST_DISTANCE_TO_MARK = "closestDistanceToMarkInMeters";
|
||||
public static final String DEVIATION_FROM_TARGET_TACK_ANGLE = "deviationFromTargetTackAngleInDegrees";
|
||||
public static final String DEVIATION_FROM_TARGET_JIBE_ANGLE = "deviationFromTargetJibeAngleInDegrees";
|
||||
public static final String TARGET_TACK_ANGLE = "targetTackAngleInDegrees";
|
||||
public static final String TARGET_JIBE_ANGLE = "targetJibeAngleInDegrees";
|
||||
|
||||
private final ManeuverCurveBoundariesJsonSerializer mainCurveSerializer;
|
||||
private final ManeuverCurveBoundariesJsonSerializer curveWithUnstableCourseAndSpeedSerializer;
|
||||
@@ -64,10 +64,8 @@ public class CompleteManeuverCurveWithEstimationDataJsonSerializer
|
||||
: maneuverWithEstimationData.getRelativeBearingToNextMarkAfterManeuver().getDegrees());
|
||||
result.put(CLOSEST_DISTANCE_TO_MARK, maneuverWithEstimationData.getDistanceToClosestMark() == null ? null
|
||||
: maneuverWithEstimationData.getDistanceToClosestMark().getMeters());
|
||||
result.put(DEVIATION_FROM_TARGET_TACK_ANGLE,
|
||||
maneuverWithEstimationData.getDeviationOfManeuverAngleFromTargetTackAngleInDegrees());
|
||||
result.put(DEVIATION_FROM_TARGET_JIBE_ANGLE,
|
||||
maneuverWithEstimationData.getDeviationOfManeuverAngleFromTargetJibeAngleInDegrees());
|
||||
result.put(TARGET_TACK_ANGLE, maneuverWithEstimationData.getTargetTackAngleInDegrees());
|
||||
result.put(TARGET_JIBE_ANGLE, maneuverWithEstimationData.getTargetJibeAngleInDegrees());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+8
-2
@@ -2,19 +2,25 @@ package com.sap.sailing.server.gateway.serialization.impl;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.domain.common.SpeedWithBearing;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFixMoving;
|
||||
import com.sap.sailing.server.gateway.deserialization.TypeBasedJsonDeserializer;
|
||||
import com.sap.sailing.server.gateway.deserialization.impl.GPSFixMovingJsonDeserializer;
|
||||
import com.sap.sailing.server.gateway.serialization.JsonSerializer;
|
||||
|
||||
public class GPSFixMovingJsonSerializer implements JsonSerializer<GPSFixMoving> {
|
||||
|
||||
@Override
|
||||
public JSONObject serialize(GPSFixMoving object) {
|
||||
return serialize(object, object.getSpeed());
|
||||
}
|
||||
|
||||
public JSONObject serialize(GPSFixMoving object, SpeedWithBearing speedWithCourse) {
|
||||
JSONObject result = new GPSFixJsonSerializer().serialize(object);
|
||||
|
||||
result.put(TypeBasedJsonDeserializer.FIELD_TYPE, GPSFixMovingJsonDeserializer.TYPE);
|
||||
result.put(GPSFixMovingJsonDeserializer.FIELD_BEARING_DEG, object.getSpeed().getBearing().getDegrees());
|
||||
result.put(GPSFixMovingJsonDeserializer.FIELD_SPEED_KNOTS, object.getSpeed().getKnots());
|
||||
result.put(GPSFixMovingJsonDeserializer.FIELD_BEARING_DEG, speedWithCourse.getBearing().getDegrees());
|
||||
result.put(GPSFixMovingJsonDeserializer.FIELD_SPEED_KNOTS, speedWithCourse.getKnots());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+3
-3
@@ -60,7 +60,9 @@ public class GpsFixesWithEstimationDataJsonSerializer implements CompetitorTrack
|
||||
track.lockForRead();
|
||||
try {
|
||||
for (GPSFixMoving gpsFix : track.getFixes(from, true, to, true)) {
|
||||
JSONObject serializedGpsFix = gpsFixMovingJsonSerializer.serialize(gpsFix);
|
||||
SpeedWithBearing speedWithBearing = smoothFixes ? track.getEstimatedSpeed(gpsFix.getTimePoint())
|
||||
: gpsFix.getSpeed();
|
||||
JSONObject serializedGpsFix = gpsFixMovingJsonSerializer.serialize(gpsFix, speedWithBearing);
|
||||
if (addWind) {
|
||||
Wind wind = trackedRace.getWind(gpsFix.getPosition(), gpsFix.getTimePoint());
|
||||
JSONObject serializedWind = wind == null ? null : windJsonSerializer.serialize(wind);
|
||||
@@ -69,8 +71,6 @@ public class GpsFixesWithEstimationDataJsonSerializer implements CompetitorTrack
|
||||
if (addNextWaypoint) {
|
||||
Distance closestDistanceToMark = estimationDataSupportDecoratorImpl
|
||||
.getClosestDistanceToMark(gpsFix.getTimePoint());
|
||||
SpeedWithBearing speedWithBearing = smoothFixes ? track.getEstimatedSpeed(gpsFix.getTimePoint())
|
||||
: gpsFix.getSpeed();
|
||||
Bearing relativeBearingToNextMark = speedWithBearing == null ? null
|
||||
: estimationDataSupportDecoratorImpl.getRelativeBearingToNextMark(gpsFix.getTimePoint(),
|
||||
speedWithBearing.getBearing());
|
||||
|
||||
@@ -17,7 +17,6 @@ Export-Package: com.sap.sse.datamining.ui.client,
|
||||
com.sap.sse.datamining.ui.client.presentation,
|
||||
com.sap.sse.datamining.ui.client.presentation.dataproviders,
|
||||
com.sap.sse.datamining.ui.client.selection,
|
||||
com.sap.sse.datamining.ui.client.selection.filter,
|
||||
com.sap.sse.datamining.ui.client.settings
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Automatic-Module-Name: com.sap.sse.datamining.ui
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.sap.sse.datamining.ui.client.selection.filter;
|
||||
package com.sap.sse.datamining.ui.client.selection;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.sap.sse.datamining.ui.client.selection.filter;
|
||||
package com.sap.sse.datamining.ui.client.selection;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
-1
@@ -43,7 +43,6 @@ import com.sap.sse.datamining.ui.client.StatisticProvider;
|
||||
import com.sap.sse.datamining.ui.client.WithControls;
|
||||
import com.sap.sse.datamining.ui.client.developer.PredefinedQueryRunner;
|
||||
import com.sap.sse.datamining.ui.client.developer.QueryDefinitionViewer;
|
||||
import com.sap.sse.datamining.ui.client.selection.filter.HierarchicalDimensionListFilterSelectionProvider;
|
||||
import com.sap.sse.datamining.ui.client.settings.AdvancedDataMiningSettings;
|
||||
import com.sap.sse.datamining.ui.client.settings.AdvancedDataMiningSettingsDialogComponent;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
|
||||
+8
-46
@@ -219,24 +219,12 @@ public class SuggestBoxStatisticProvider extends AbstractDataMiningComponent<Com
|
||||
awaitingRetrieverChainStatistics--;
|
||||
if (awaitingRetrieverChainStatistics == 0) {
|
||||
Collections.sort(availableExtractionFunctions);
|
||||
Map<String, ExtractionFunctionWithContext> displayDuplicates = new HashMap<>();
|
||||
for (ExtractionFunctionWithContext statistic : availableExtractionFunctions) {
|
||||
ExtractionFunctionWithContext duplicate = displayDuplicates
|
||||
.get(statistic.getExtractionFunction().getDisplayName());
|
||||
if (duplicate == null) {
|
||||
displayDuplicates.put(statistic.getExtractionFunction().getDisplayName(), statistic);
|
||||
} else {
|
||||
statistic.setVerbose(true);
|
||||
duplicate.setVerbose(true);
|
||||
}
|
||||
}
|
||||
extractionFunctionSuggestBox.setSelectableValues(availableExtractionFunctions);
|
||||
|
||||
// TODO Do not pre-select the first element. The other UI components have to be able to handle "empty content"
|
||||
ExtractionFunctionWithContext currentValue = extractionFunctionSuggestBox.getExtractionFunction();
|
||||
ExtractionFunctionWithContext valueToBeSelected = availableExtractionFunctions.contains(currentValue)
|
||||
? currentValue : Util.first(availableExtractionFunctions);
|
||||
extractionFunctionSuggestBox.getValueBox().setValue(valueToBeSelected.getDisplayString(), false);
|
||||
extractionFunctionSuggestBox.setExtractionFunction(valueToBeSelected);
|
||||
}
|
||||
}
|
||||
@@ -377,18 +365,9 @@ public class SuggestBoxStatisticProvider extends AbstractDataMiningComponent<Com
|
||||
if (index != -1) {
|
||||
statistic = availableExtractionFunctions.get(index);
|
||||
} else {
|
||||
String displayName = extractionFunction.getDisplayName();
|
||||
for (ExtractionFunctionWithContext availableStatistic : availableExtractionFunctions) {
|
||||
if (availableStatistic.getExtractionFunction().getDisplayName().equals(displayName)) {
|
||||
statistic.setVerbose(true);
|
||||
availableStatistic.setVerbose(true);
|
||||
}
|
||||
}
|
||||
availableExtractionFunctions.add(statistic);
|
||||
extractionFunctionSuggestBox.setSelectableValues(availableExtractionFunctions);
|
||||
}
|
||||
|
||||
extractionFunctionSuggestBox.getValueBox().setValue(statistic.getDisplayString(), false);
|
||||
extractionFunctionSuggestBox.setExtractionFunction(statistic);
|
||||
aggregatorListBox.setValue(queryDefinition.getAggregatorDefinition());
|
||||
}
|
||||
@@ -488,7 +467,6 @@ public class SuggestBoxStatisticProvider extends AbstractDataMiningComponent<Com
|
||||
private final DataRetrieverChainDefinitionDTO retrieverChain;
|
||||
private final FunctionDTO extractionFunction;
|
||||
private final Collection<String> matchingStrings;
|
||||
private boolean verbose;
|
||||
|
||||
public ExtractionFunctionWithContext(DataRetrieverChainDefinitionDTO retrieverChain,
|
||||
FunctionDTO extractionFunction) {
|
||||
@@ -511,30 +489,13 @@ public class SuggestBoxStatisticProvider extends AbstractDataMiningComponent<Com
|
||||
return matchingStrings;
|
||||
}
|
||||
|
||||
public boolean isVerbose() {
|
||||
return verbose;
|
||||
}
|
||||
|
||||
public void setVerbose(boolean verbose) {
|
||||
this.verbose = verbose;
|
||||
}
|
||||
|
||||
public String getDisplayString() {
|
||||
StringBuilder builder = new StringBuilder(extractionFunction.getDisplayName());
|
||||
if (isVerbose()) {
|
||||
builder.append(" (").append(getDataMiningStringMessages().basedOn()).append(" ")
|
||||
.append(retrieverChain.getName()).append(")");
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(ExtractionFunctionWithContext o) {
|
||||
int comparedDisplayName = extractionFunction.getDisplayName()
|
||||
.compareTo(o.getExtractionFunction().getDisplayName());
|
||||
if (comparedDisplayName != 0)
|
||||
String otherDisplayName = o.getExtractionFunction().getDisplayName();
|
||||
int comparedDisplayName = extractionFunction.getDisplayName().compareToIgnoreCase(otherDisplayName);
|
||||
if (comparedDisplayName != 0) {
|
||||
return comparedDisplayName;
|
||||
|
||||
}
|
||||
return retrieverChain.compareTo(o.getRetrieverChain());
|
||||
}
|
||||
|
||||
@@ -597,12 +558,12 @@ public class SuggestBoxStatisticProvider extends AbstractDataMiningComponent<Com
|
||||
|
||||
@Override
|
||||
protected String createSuggestionKeyString(ExtractionFunctionWithContext value) {
|
||||
return value.getDisplayString();
|
||||
return value.getExtractionFunction().getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String createSuggestionAdditionalDisplayString(ExtractionFunctionWithContext value) {
|
||||
return null;
|
||||
return value.getRetrieverChain().getName();
|
||||
}
|
||||
}, new ScrollableSuggestionDisplay());
|
||||
suggestOracle = (AbstractListSuggestOracle<ExtractionFunctionWithContext>) getSuggestOracle();
|
||||
@@ -622,9 +583,10 @@ public class SuggestBoxStatisticProvider extends AbstractDataMiningComponent<Com
|
||||
public void setExtractionFunction(ExtractionFunctionWithContext extractionFunction) {
|
||||
if (!Objects.equals(this.extractionFunction, extractionFunction)) {
|
||||
this.extractionFunction = extractionFunction;
|
||||
this.setFocus(false);
|
||||
setValue(extractionFunction.getExtractionFunction().getDisplayName(), false);
|
||||
onValueChange();
|
||||
}
|
||||
setFocus(false);
|
||||
}
|
||||
|
||||
public ExtractionFunctionWithContext getExtractionFunction() {
|
||||
|
||||
-166
@@ -1,166 +0,0 @@
|
||||
package com.sap.sse.datamining.ui.client.selection.filter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.gwt.view.client.MultiSelectionModel;
|
||||
import com.google.gwt.view.client.ProvidesKey;
|
||||
import com.google.gwt.view.client.SelectionChangeEvent;
|
||||
|
||||
/**
|
||||
* A multi selection model, that allows to block the selection change notifications.
|
||||
* @author Lennart Hensler (D054527)
|
||||
*/
|
||||
public class ControllableMultiSelectionModel<T> extends MultiSelectionModel<T> {
|
||||
|
||||
// Ensure one value per key
|
||||
private final Map<Object, T> selectedSet;
|
||||
/**
|
||||
* A map of keys to the item and its pending selection state.
|
||||
*/
|
||||
private final Map<Object, SelectionChange<T>> selectionChanges;
|
||||
|
||||
private boolean blockNotifications;
|
||||
|
||||
/**
|
||||
* Constructs a MultiSelectionModel without a key provider.
|
||||
*/
|
||||
public ControllableMultiSelectionModel() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a MultiSelectionModel with the given key provider.
|
||||
*
|
||||
* @param keyProvider
|
||||
* an instance of ProvidesKey<T>, or null if the item should act as its own key
|
||||
*/
|
||||
public ControllableMultiSelectionModel(ProvidesKey<T> keyProvider) {
|
||||
super(keyProvider);
|
||||
this.selectedSet = new HashMap<Object, T>();
|
||||
this.selectionChanges = new HashMap<Object, SelectionChange<T>>();
|
||||
blockNotifications = false;
|
||||
}
|
||||
|
||||
public void setBlockNotifications(boolean blockNotifications) {
|
||||
this.blockNotifications = blockNotifications;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deselect all selected values.
|
||||
*/
|
||||
@Override
|
||||
public void clear() {
|
||||
// Clear the current list of pending changes.
|
||||
selectionChanges.clear();
|
||||
|
||||
/*
|
||||
* Add a pending change to deselect each key that is currently selected. We cannot just clear the selected set,
|
||||
* because then we would not know which keys were selected before we cleared, which we need to know to determine
|
||||
* if we should fire an event.
|
||||
*/
|
||||
for (T value : selectedSet.values()) {
|
||||
selectionChanges.put(getKey(value), new SelectionChange<T>(value, false));
|
||||
}
|
||||
scheduleSelectionChangeEvent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the set of selected items as a copy. If multiple selected items share the same key, only the last selected
|
||||
* item is included in the set.
|
||||
*
|
||||
* @return the set of selected items
|
||||
*/
|
||||
@Override
|
||||
public Set<T> getSelectedSet() {
|
||||
determineChanges();
|
||||
return new HashSet<T>(selectedSet.values());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelected(T item) {
|
||||
determineChanges();
|
||||
return selectedSet.containsKey(getKey(item));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelected(T item, boolean selected) {
|
||||
selectionChanges.put(getKey(item), new SelectionChange<T>(item, selected));
|
||||
scheduleSelectionChangeEvent();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void scheduleSelectionChangeEvent() {
|
||||
if (!blockNotifications) {
|
||||
super.scheduleSelectionChangeEvent();
|
||||
} else {
|
||||
determineChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fireSelectionChangeEvent() {
|
||||
if (isEventScheduled()) {
|
||||
setEventCancelled(true);
|
||||
}
|
||||
determineChanges();
|
||||
}
|
||||
|
||||
private void determineChanges() {
|
||||
if (selectionChanges.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean changed = false;
|
||||
for (Map.Entry<Object, SelectionChange<T>> entry : selectionChanges.entrySet()) {
|
||||
Object key = entry.getKey();
|
||||
SelectionChange<T> value = entry.getValue();
|
||||
boolean selected = value.isSelected();
|
||||
|
||||
T oldValue = selectedSet.get(key);
|
||||
if (selected) {
|
||||
selectedSet.put(key, value.getItem());
|
||||
Object oldKey = getKey(oldValue);
|
||||
if (!changed) {
|
||||
changed = (oldKey == null) ? (key != null) : !oldKey.equals(key);
|
||||
}
|
||||
} else {
|
||||
if (oldValue != null) {
|
||||
selectedSet.remove(key);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
selectionChanges.clear();
|
||||
|
||||
// Fire a selection change event.
|
||||
if (changed && !blockNotifications) {
|
||||
SelectionChangeEvent.fire(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores an item and its pending selection state.
|
||||
* @param <T> the data type of the item
|
||||
*/
|
||||
private static class SelectionChange<T> {
|
||||
private final T item;
|
||||
private final boolean isSelected;
|
||||
|
||||
SelectionChange(T item, boolean isSelected) {
|
||||
this.item = item;
|
||||
this.isSelected = isSelected;
|
||||
}
|
||||
|
||||
public T getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean isSelected() {
|
||||
return isSelected;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+5
-3
@@ -2,9 +2,11 @@ package com.sap.sse.datamining.components;
|
||||
|
||||
public interface ProcessorInstructionHandler<ResultType> {
|
||||
|
||||
public void instructionSucceeded(ResultType result);
|
||||
public void instructionFailed(Exception e);
|
||||
boolean isAborted();
|
||||
|
||||
public void afterInstructionFinished();
|
||||
void instructionSucceeded(ResultType result);
|
||||
void instructionFailed(Exception e);
|
||||
|
||||
void afterInstructionFinished();
|
||||
|
||||
}
|
||||
|
||||
+3
-1
@@ -24,7 +24,9 @@ public interface FunctionProvider {
|
||||
DataRetrieverChainDefinition<?, ?> dataRetrieverChainDefinition);
|
||||
|
||||
/**
|
||||
* @param classLoader TODO
|
||||
* @param functionDTO The {@link FunctionDTO} to resolve
|
||||
* @param classLoader The class loader used to get the actual {@link Class} objects described
|
||||
* by the <code>functionDTO</code>
|
||||
* @return The first function, that matches the given DTO or <code>null</code>
|
||||
*/
|
||||
public Function<?> getFunctionForDTO(FunctionDTO functionDTO, ClassLoader classLoader);
|
||||
|
||||
+4
-2
@@ -52,8 +52,10 @@ public abstract class AbstractProcessorInstruction<ResultType> implements Proces
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
ResultType result = computeResult();
|
||||
handler.instructionSucceeded(result);
|
||||
if (!handler.isAborted()) {
|
||||
ResultType result = computeResult();
|
||||
handler.instructionSucceeded(result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
handler.instructionFailed(e);
|
||||
} finally {
|
||||
|
||||
+1
-1
@@ -228,7 +228,7 @@ public class ConcatenatingCompoundFunction<ReturnType> extends AbstractFunction<
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getSimpleName();
|
||||
return getDeclaringType().getSimpleName() + "." + getSimpleName() + " : " + getReturnType().getSimpleName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-2
@@ -18,8 +18,9 @@ public abstract class AbstractListSuggestOracle<C> extends AbstractSuggestOracle
|
||||
|
||||
@Override
|
||||
protected final void getSuggestions(Request request, Callback callback, Iterable<String> queryTokens) {
|
||||
Iterable<C> filteredList = suggestionMatchingFilter.applyFilter(getKeywordStrings(queryTokens), suggestionObjectList);
|
||||
this.setSuggestions(request, callback, filteredList, queryTokens);
|
||||
Iterable<String> keywords = getKeywordStrings(queryTokens);
|
||||
Iterable<C> filteredList = suggestionMatchingFilter.applyFilter(keywords, suggestionObjectList);
|
||||
this.setSuggestions(request, callback, filteredList, keywords);
|
||||
}
|
||||
|
||||
protected Iterable<String> getKeywordStrings(Iterable<String> queryTokens) {
|
||||
|
||||
+6
-4
@@ -90,10 +90,12 @@ public abstract class AbstractSuggestOracle<T> extends SuggestOracle {
|
||||
int index = displayString.length();
|
||||
String matchToken = null;
|
||||
for (String token : queryTokens) {
|
||||
int matchIndex = normalizedString.indexOf(token, cursor);
|
||||
if (matchIndex >= 0 && matchIndex < index) {
|
||||
index = matchIndex;
|
||||
matchToken = token;
|
||||
if (token != null && !token.isEmpty()) {
|
||||
int matchIndex = normalizedString.indexOf(token, cursor);
|
||||
if (matchIndex >= 0 && matchIndex < index) {
|
||||
index = matchIndex;
|
||||
matchToken = token;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (matchToken != null) {
|
||||
|
||||
@@ -514,7 +514,7 @@ Follow these steps to upgrade the AMI:
|
||||
* Check the sizes of the mounted partitions by doing `df; swapon -s`. These will come in handy after creating the new AMI in order to tag the new volume snapshots accordingly
|
||||
* Update any keys in `/root/.ssh/authorized_keys` and `/home/sailing/.ssh/authorized_keys`
|
||||
* Remove created http rewrite entries in `/etc/httpd/conf.d/001-events.conf`
|
||||
* Edit /etc/motd to set the current version
|
||||
* Edit /etc/update-motd.d/30-banner to set the current version
|
||||
* In the EC2 administration console go to the "Instances" tab, select your running instance and from the "Actions" drop-down select "Create Image". Give the image the name "SAP Sailing Analytics App x.y" where "x.y" is the updated version number of the image. Just make sure it's greater than the previous one. If you feel like it, you may provide a short description telling the most important features of the image.
|
||||
* Once the image creation has completed, go to the Snapshots list in the "Elastic Block Store" category and name the new snapshots appropriately. Now the information about the device sizes obtained earlier from the `df` and `swapon` commands will help you to identify which snapshot is which. Usually, the three snapshots would be something like AMI Analytics Home x.y, AMI Analytics System x.y and AMI Analytics Swap x.y with "x.y" being the version number matching that of your image.
|
||||
* Now you can remove any earlier Sailing Server AMI version and the corresponding snapshots.
|
||||
|
||||
Reference in New Issue
Block a user