aca05be3221ebe8abc3d63bd61893c169558c650
java/com.sap.sailing.polars.test/src/com/sap/sailing/polars/jaxrs/api/test/PolarDataResourceTest.java
| ... | ... | @@ -58,7 +58,6 @@ public class PolarDataResourceTest { |
| 58 | 58 | BoatClass boatClass = domainFactory.getOrCreateBoatClass(BOAT_CLASS); |
| 59 | 59 | PolynomialFunction angleDownwindFunction = new PolynomialFunction(ANGLE_FUNCTION_COEFFS_DOWNWIND); |
| 60 | 60 | PolynomialFunction speedDownwindFunction = new PolynomialFunction(SPEED_FUNCTIONS_COEFFS_DOWNWIND); |
| 61 | - |
|
| 62 | 61 | assertThat(polarService.getSpeedRegressionsPerAngle().size(), is(68)); |
| 63 | 62 | assertThat(polarService.getCubicRegressionsPerCourse().size(), is(4)); |
| 64 | 63 | assertThat(polarService.getFixCountPerBoatClass().get(boatClass), is(9330L)); |
| ... | ... | @@ -67,5 +66,4 @@ public class PolarDataResourceTest { |
| 67 | 66 | assertThat(polarService.getAngleRegressionFunction(boatClass, LegType.DOWNWIND), is(angleDownwindFunction)); |
| 68 | 67 | assertThat(polarService.getSpeedRegressionFunction(boatClass, LegType.DOWNWIND), is(speedDownwindFunction)); |
| 69 | 68 | } |
| 70 | - |
|
| 71 | 69 | } |
| ... | ... | \ No newline at end of file |
java/com.sap.sailing.windestimation/src/com/sap/sailing/windestimation/aggregator/hmm/WindCourseRange.java
| ... | ... | @@ -147,10 +147,7 @@ public class WindCourseRange { |
| 147 | 147 | } |
| 148 | 148 | double deviationFromPortsideTowardStarboardInDegrees = deviationFromPortsideBoundaryTowardStarboard |
| 149 | 149 | - angleTowardStarboard; |
| 150 | - if (deviationFromPortsideTowardStarboardInDegrees <= 0) { |
|
| 151 | - return true; |
|
| 152 | - } |
|
| 153 | - return false; |
|
| 150 | + return deviationFromPortsideTowardStarboardInDegrees <= 0; |
|
| 154 | 151 | } |
| 155 | 152 | |
| 156 | 153 | @Override |
java/com.sap.sailing.windestimation/src/com/sap/sailing/windestimation/aggregator/msthmm/MstGraphExporter.java
| ... | ... | @@ -21,6 +21,7 @@ import com.sap.sailing.windestimation.aggregator.hmm.WindCourseRange; |
| 21 | 21 | import com.sap.sailing.windestimation.aggregator.msthmm.MstManeuverGraphGenerator.MstManeuverGraphComponents; |
| 22 | 22 | import com.sap.sailing.windestimation.data.ManeuverForEstimation; |
| 23 | 23 | import com.sap.sailing.windestimation.data.ManeuverTypeForClassification; |
| 24 | +import com.sap.sse.common.impl.DegreeBearingImpl; |
|
| 24 | 25 | |
| 25 | 26 | /** |
| 26 | 27 | * Exports MST graph data to JSON format for visualization. |
| ... | ... | @@ -137,16 +138,18 @@ public class MstGraphExporter { |
| 137 | 138 | writer.write(" {\n"); |
| 138 | 139 | writer.write(" \"type\": \"" + type.name() + "\",\n"); |
| 139 | 140 | writer.write(" \"confidence\": " + confidence + ",\n"); |
| 140 | - writer.write(" \"windRangeFrom\": " + windRange.getFromPortside() + ",\n"); |
|
| 141 | + writer.write(" \"windRangeFrom\": " + |
|
| 142 | + new DegreeBearingImpl(windRange.getFromPortside()).reverse().getDegrees() + ",\n"); |
|
| 141 | 143 | writer.write(" \"windRangeWidth\": " + windRange.getAngleTowardStarboard() + ",\n"); |
| 142 | 144 | |
| 143 | 145 | // Calculate single wind direction estimate for TACK/JIBE (width ~0) |
| 144 | 146 | double windEstimate; |
| 145 | 147 | if (windRange.getAngleTowardStarboard() < 1.0) { |
| 146 | - windEstimate = windRange.getFromPortside(); |
|
| 148 | + windEstimate = new DegreeBearingImpl(windRange.getFromPortside()).reverse().getDegrees(); |
|
| 147 | 149 | } else { |
| 148 | 150 | // For HEAD_UP/BEAR_AWAY, use middle of range |
| 149 | - windEstimate = windRange.getFromPortside() + windRange.getAngleTowardStarboard() / 2.0; |
|
| 151 | + windEstimate = new DegreeBearingImpl(windRange.getFromPortside()).reverse().getDegrees() |
|
| 152 | + + windRange.getAngleTowardStarboard() / 2.0; |
|
| 150 | 153 | if (windEstimate >= 360) { |
| 151 | 154 | windEstimate -= 360; |
| 152 | 155 | } |