bug6068: introduced four new @Statistic methods for wind axis-based XTE

This commit is contained in:
Axel Uhl
2024-11-08 17:26:54 +01:00
parent e5e86e0a34
commit ea51331950
8 changed files with 122 additions and 22 deletions
@@ -253,6 +253,10 @@ XTE=Cross-Track Error, signed (- = left, + = right)
AbsoluteXTE=Absolute Cross-Track Error, unsigned
XTERelativeSigned=Relative Cross-Track Error, signed (-1 = 1/2 leg length left, 0 = middle, +1 = 1/2 leg length right)
XTERelativeUnsigned=Relative Cross-Track Error, unsigned (0 = middle, 1 = 1/2 leg length out)
XTEToWindAxisUnsigned=Cross-Track Error to Wind Axis, unsigned
XTEToWindAxisSigned=Cross-Track Error to Wind Axis, signed (- = left, + = right)
XTEToWindAxisRelativeUnsigned=Relative Cross-Track Error to Wind Axis, unsigned (0 = middle, 1 = 1/2 leg length out)
XTEToWindAxisRelativeSigned=Relative Cross-Track Error to Wind Axis, signed (-1 = 1/2 leg length left, 0 = middle, +1 = 1/2 leg length right)
Day=Day
CompetitorDay=Competitor Day
CompetitorDaySailingDomainRetrieverChain=Competitor-Day for race
@@ -256,6 +256,10 @@ XTE=Absolute Querabweichung, vorzeichenbehaftet (- = links, + = rechts)
AbsoluteXTE=Absolute Querabweichung, ohne Vorzeichen
XTERelativeSigned=Relative Querabweichung, mit Vorzeichen (-1 = 1/2 Schenkellänge links, 0 = Mitte, +1 = 1/2 Schenkellänge rechts)
XTERelativeUnsigned=Relative Querabweichung, ohne Vorzeichen (0 = Mitte, 1 = ganz aussen)
XTEToWindAxisUnsigned=Querabweichung zur Windachse, ohne Vorzeichen
XTEToWindAxisSigned=Querabweichung zur Windachse, vorzeichenbehaftet (- = links, + = rechts)
XTEToWindAxisRelativeUnsigned=Relative Querabweichung zur Windachse, mit Vorzeichen (-1 = 1/2 Schenkellänge links, 0 = Mitte, +1 = 1/2 Schenkellänge rechts)
XTEToWindAxisRelativeSigned=Relative Querabweichung zur Windachse, ohne Vorzeichen (0 = Mitte, 1 = ganz aussen)
Day=Tag
CompetitorDay=Teilnehmer-Tag
CompetitorDaySailingDomainRetrieverChain=Teilnehmer-Tag für Wettfahrt
@@ -42,6 +42,36 @@ public interface HasGPSFixContext {
@Statistic(messageKey = "XTERelativeUnsigned", resultDecimals = 2)
Double getRelativeXTEUnsigned();
/**
* Instead of projecting onto the course middle line connecting start and end of the leg,
* projects onto the wind axis, attached to the leg's end waypoint.
*/
@Statistic(messageKey = "XTEToWindAxisUnsigned", resultDecimals = 2)
Distance getXTEToWindAxisUnsigned();
/**
* Instead of projecting onto the course middle line connecting start and end of the leg,
* projects onto the wind axis, attached to the leg's end waypoint.
*/
@Statistic(messageKey = "XTEToWindAxisSigned", resultDecimals = 2)
Distance getXTEToWindAxisSigned();
/**
* Instead of projecting onto the course middle line connecting start and end of the leg,
* projects onto the wind axis, attached to the leg's end waypoint. That distance is divided
* by half the leg length.
*/
@Statistic(messageKey = "XTEToWindAxisRelativeUnsigned", resultDecimals = 2)
Double getXTEToWindAxisRelativeUnsigned();
/**
* Instead of projecting onto the course middle line connecting start and end of the leg,
* projects onto the wind axis, attached to the leg's end waypoint. That distance is divided
* by half the leg length.
*/
@Statistic(messageKey = "XTEToWindAxisRelativeSigned", resultDecimals = 2)
Double getXTEToWindAxisRelativeSigned();
@Statistic(messageKey = "SmoothedSpeed", resultDecimals = 2)
Speed getSmoothedSpeed();
@@ -149,4 +149,24 @@ public class GPSFixWithContext implements HasGPSFixContext {
final double fractionSailed = Math.max(0, legWindwardDistance.add(windwardDistanceToGo.scale(-1)).divide(legWindwardDistance));
return (int) Math.min(10, 1+10*fractionSailed);
}
@Override
public Distance getXTEToWindAxisUnsigned() {
return getTrackedLegOfCompetitorContext().getTrackedLegOfCompetitor().getUnsignedCrossTrackErrorToWindAxis(getTimePoint());
}
@Override
public Distance getXTEToWindAxisSigned() {
return getTrackedLegOfCompetitorContext().getTrackedLegOfCompetitor().getSignedCrossTrackErrorToWindAxis(getTimePoint());
}
@Override
public Double getXTEToWindAxisRelativeUnsigned() {
return getRelativeXTE(TrackedLegOfCompetitor::getUnsignedCrossTrackErrorToWindAxis);
}
@Override
public Double getXTEToWindAxisRelativeSigned() {
return getRelativeXTE(TrackedLegOfCompetitor::getSignedCrossTrackErrorToWindAxis);
}
}