bug4572: Added a bearingAtManeuverEndPositionLine to the maneuver loss visualization.

This commit is contained in:
Alessandro Stoltenberg
2018-07-11 16:01:39 +02:00
parent 778b192121
commit 99559164a4
4 changed files with 18 additions and 8 deletions
@@ -2086,6 +2086,7 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages,
String extrapolatedManeuverStartPosition();
String projectedExtrapolatedManeuverStartPosition();
String projectedManeuverEndPosition();
String bearingAtManeuverEndPosition();
String gender();
String manage2SailEventIdBox();
String manage2SailEventURLBox();
@@ -2081,6 +2081,7 @@ middleManeuverAngle=Middle maneuver angle
extrapolatedManeuverStartPosition=Extrapolated Maneuver Start Position
projectedExtrapolatedManeuverStartPosition=Projection of the extrapolated maneuver start position on middle maneuver angle line
projectedManeuverEndPosition=Projection of the maneuver end position on middle maneuver angle line
bearingAtManeuverEndPosition=Bearing at maneuver end position
gender=Gender
manage2SailEventIdBox=Manage2Sail Event ID
manage2SailEventURLBox=Manage2Sail EventURL (json)
@@ -2076,6 +2076,7 @@ middleManeuverAngle=Manöverwinkel-Halbierende
extrapolatedManeuverStartPosition=Extrapolierte Manöver Anfangsposition
projectedExtrapolatedManeuverStartPosition=Projektion der extrapolierten Manöver Startposition auf die Manöverwinkel-Halbierende
projectedManeuverEndPosition=Projektion der Manöverendposition auf die Manöverwinkel-Halbierende
bearingAtManeuverEndPosition=Anliegender Kurs an Manöverendposition
gender=Geschlecht
manage2SailEventId=Manage2Sail Event ID
manage2SailEventURL=Manage2Sail Event URL (json)
@@ -3169,6 +3169,13 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
return stringMessages.maneuverLoss();
}
};
final LineInfoProvider bearingAtManeuverEndPositionLineInfoProvider = new LineInfoProvider() {
@Override
public String getLineInfo() {
return stringMessages.bearingAtManeuverEndPosition();
}
};
/**
* Visualizes the Maneuver Loss, creates the corresponding polylines and Info Overlays calling
@@ -3227,14 +3234,14 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
intersectionMiddleManeuverAngleWithExtrapolationOfManeuverStartPoint, middleManeuverAngle);
Position projectedManeuverEndPosition = maneuver.getManeuverLoss().getManeuverEndPosition().projectToLineThrough(
intersectionMiddleManeuverAngleWithExtrapolationOfManeuverStartPoint, middleManeuverAngle);
/* maneuver end extrapolation line, test start */
Position help1 = maneuver.getManeuverLoss().getManeuverEndPosition().getIntersection(
new DegreeBearingImpl(maneuver.getSpeedWithBearingAfter().bearingInDegrees),
intersectionMiddleManeuverAngleWithExtrapolationOfManeuverStartPoint, middleManeuverAngle);
maneuverLossLines.add(showOrRemoveOrUpdateLine(null, true, help1,
maneuver.getManeuverLoss().getManeuverEndPosition(), null, MANEUVERLOSSLINES_EXTRAPOLATEDLINES_COLOR,
STANDARD_LINE_STROKEWEIGHT, LOWLIGHTED_LINE_OPACITY));
/* test end */
Position startOfBearingAtManeuverEndPositionLineOnMiddleManeuverAngleLine = maneuver.getManeuverLoss()
.getManeuverEndPosition()
.getIntersection(new DegreeBearingImpl(maneuver.getSpeedWithBearingAfter().bearingInDegrees),
intersectionMiddleManeuverAngleWithExtrapolationOfManeuverStartPoint, middleManeuverAngle);
maneuverLossLines.add(showOrRemoveOrUpdateLine(null, true,
startOfBearingAtManeuverEndPositionLineOnMiddleManeuverAngleLine,
maneuver.getManeuverLoss().getManeuverEndPosition(), bearingAtManeuverEndPositionLineInfoProvider,
MANEUVERLOSSLINES_EXTRAPOLATEDLINES_COLOR, STANDARD_LINE_STROKEWEIGHT, LOWLIGHTED_LINE_OPACITY));
String color = maneuver.getManeuverLoss().getDistanceLost().compareTo(Distance.NULL) > 0
? color = MANEUVERLOSSLINES_RED : MANEUVERLOSSLINES_GREEN;
maneuverLossLines.add(showOrRemoveOrUpdateLine(null, true,