Adapted boolean dimension for mark passing maneuver filtering

This commit is contained in:
Vladislav Chumak committed 2018-03-16 18:02:34 +01:00
1 parent 431aad65b5
commit b5a4331e52
6 files changed
+8 -25

No files matched your search

@@ -1,8 +1,6 @@
package com.sap.sailing.datamining.data;
import com.sap.sailing.domain.common.Distance;
import com.sap.sailing.domain.common.ManeuverType;
import com.sap.sailing.domain.common.NauticalSide;
import com.sap.sailing.domain.common.Tack;
import com.sap.sse.common.TimePoint;
import com.sap.sse.datamining.annotations.Connector;
@@ -13,12 +11,6 @@ public interface HasManeuverContext extends HasWindOnTrackedLeg, HasManeuver, Ha
@Connector(scanForStatistics = false)
HasTrackedLegOfCompetitorContext getTrackedLegOfCompetitorContext();
@Dimension(messageKey = "ManeuverType", ordinal = 12)
ManeuverType getManeuverType();
@Dimension(messageKey = "ToSide", ordinal = 16)
NauticalSide getToSide();
@Dimension(messageKey = "TackBeforeManeuver")
Tack getTackBeforeManeuver();
@@ -4,8 +4,6 @@ import com.sap.sailing.datamining.data.HasManeuverContext;
import com.sap.sailing.datamining.data.HasTrackedLegOfCompetitorContext;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.common.Distance;
import com.sap.sailing.domain.common.ManeuverType;
import com.sap.sailing.domain.common.NauticalSide;
import com.sap.sailing.domain.common.SpeedWithBearing;
import com.sap.sailing.domain.common.Tack;
import com.sap.sailing.domain.common.Wind;
@@ -88,16 +86,6 @@ public class ManeuverWithContext implements HasManeuverContext {
return maneuver;
}
@Override
public ManeuverType getManeuverType() {
return getManeuver().getType();
}
@Override
public NauticalSide getToSide() {
return getDirectionChangeInDegreesForAnalysis() >= 0 ? NauticalSide.STARBOARD : NauticalSide.PORT;
}
@Override
public Double getAbsoluteDirectionChangeInDegrees() {
return Math.abs(getDirectionChangeInDegreesForAnalysis());
@@ -42,7 +42,7 @@ public class MarkPassingWithContext implements HasMarkPassingContext {
@Override
public NauticalSide getPassingSide() {
return getManeuver().getSide();
return getManeuver().getToSide();
}
@Override
@@ -958,7 +958,7 @@ public abstract class AbstractLeaderboardWithCache implements Leaderboard {
// analyze all mark passings, not only those after this leg's start, to catch the mark passing
// maneuver starting this leg, even if its time point is slightly before the mark passing starting this leg
if (maneuver.getMarkPassing().getWaypoint() == trackedLeg.getLeg().getFrom()) {
result.sideToWhichMarkAtLegStartWasRounded = maneuver.getSide();
result.sideToWhichMarkAtLegStartWasRounded = maneuver.getToSide();
}
}
}
@@ -43,6 +43,7 @@ public interface Maneuver extends GPSFix {
*
* @return The type of maneuver
*/
@Dimension(messageKey = "ManeuverType", ordinal = 12)
ManeuverType getType();
/**
@@ -51,7 +52,7 @@ public interface Maneuver extends GPSFix {
*
* @return The new tack after the performed maneuver
*/
@Dimension(messageKey = "Tack", ordinal = 13)
@Dimension(messageKey = "Tack", ordinal = 14)
Tack getNewTack();
/**
@@ -151,11 +152,13 @@ public interface Maneuver extends GPSFix {
/**
* Determines whether the maneuver is mark passing maneuver.
*/
@Dimension(messageKey = "MarkPassing", ordinal = 13)
boolean isMarkPassing();
/**
* Gets the direction of the maneuver. It corresponds to the direction of mark passing side.
*/
NauticalSide getSide();
@Dimension(messageKey = "ToSide", ordinal = 16)
NauticalSide getToSide();
}
@@ -121,7 +121,7 @@ public abstract class ManeuverImpl extends AbstractGPSFixImpl implements Maneuve
return markPassing != null;
}
public NauticalSide getSide() {
public NauticalSide getToSide() {
return getMainCurveBoundaries().getDirectionChangeInDegrees() < 0 ? NauticalSide.PORT : NauticalSide.STARBOARD;
}