mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-21 21:25:38 +00:00
Merge branch 'main' into bug6064
This commit is contained in:
+2
-1
@@ -276,4 +276,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)
|
||||
+2
-1
@@ -274,4 +274,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)
|
||||
+9
@@ -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();
|
||||
}
|
||||
+11
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user