Merge branch 'bug6063' into main

This commit is contained in:
Axel Uhl
2024-11-06 10:55:00 +01:00
5 changed files with 30 additions and 2 deletions
@@ -274,4 +274,5 @@ RatioDistanceLongVsShortTack=Ratio distance long tack / short tack
RatioDurationLongVsShortTack=Ratio duration long tack / short tack
Discarded=Discarded
DurationFromRaceStartToFirstTack=Duration from race start to first tack
TypeOfFirstLeg=Type of first leg
TypeOfFirstLeg=Type of first leg
TenthInLeg=Which tenth of the leg (1-10)
@@ -272,4 +272,5 @@ RatioDistanceLongVsShortTack=Verhältnis gesegelte Distanz auf Streck- zu Holebu
RatioDurationLongVsShortTack=Verhältnis gesegelte Dauer auf Streck- zu Holebug
Discarded=Gestrichen
DurationFromRaceStartToFirstTack=Dauer vom Start der Wettfahrt bis zur ersten Wende
TypeOfFirstLeg=Art des ersten Bahnschenkels
TypeOfFirstLeg=Art des ersten Bahnschenkels
TenthInLeg=Zehntel des Bahnschenkels (1-10)
@@ -38,4 +38,13 @@ public interface HasGPSFixContext {
@Statistic(messageKey = "SmoothedSpeed", resultDecimals = 2)
Speed getSmoothedSpeed();
/**
* @return the tenth of the leg the fix is in, computed based on the "windward distance" along the leg; the first
* tenth has number 1, the last tenth has number 10. Should the fix not be linked to any leg, the result is
* {@code null}. For reaching legs, "windward distance" translates to rhumbline-based distance
* (along-course).
*/
@Dimension(messageKey="TenthInLeg")
Integer getTenthOfLeg();
}
@@ -7,6 +7,7 @@ import com.sap.sailing.domain.common.SpeedWithBearing;
import com.sap.sailing.domain.common.TackType;
import com.sap.sailing.domain.common.tracking.GPSFixMoving;
import com.sap.sailing.domain.tracking.TrackedRace;
import com.sap.sailing.domain.tracking.WindPositionMode;
import com.sap.sse.common.Bearing;
import com.sap.sse.common.Distance;
import com.sap.sse.common.Speed;
@@ -107,4 +108,14 @@ public class GPSFixWithContext implements HasGPSFixContext {
}
return result;
}
@Override
public Integer getTenthOfLeg() {
final Distance windwardDistanceToGo = getTrackedLegOfCompetitorContext().getTrackedLegOfCompetitor().getWindwardDistanceToGo(getGPSFix().getTimePoint(), WindPositionMode.LEG_MIDDLE);
final Distance legWindwardDistance = getTrackedLegOfCompetitorContext().getTrackedLegOfCompetitor().getTrackedLeg().getWindwardDistance();
// eliminate negative values which may result if the competitor has just entered the leg but is yet to arrive at the windward
// level of the waypoint just rounded:
final double fractionSailed = Math.max(0, legWindwardDistance.add(windwardDistanceToGo.scale(-1)).divide(legWindwardDistance));
return (int) Math.min(10, 1+10*fractionSailed);
}
}
@@ -5,6 +5,12 @@
<div id="mainContent">
<h4 class="articleHeadline">What's New - SAP Sailing Analytics</h4>
<div class="innerContent">
<h5 class="articleSubheadline">November 2024</h5>
<ul class="bulletList">
<li>Added a data mining dimension "tenth of leg" for competitor position fixes, such that, e.g.,
the first or last tenth of a leg (based on the windward distance) can be excluded during
data collection.</li>
</ul>
<h5 class="articleSubheadline">October 2024</h5>
<ul class="bulletList">
<li>Bug fix: for match racing tie breaks, under very special circumstances the tie breaking