candidates2 = approximation.approximate(fix1.getTimePoint(), fix3.getTimePoint());
+ assertEquals(1, Util.size(candidates2));
+ assertEquals(fix2.getTimePoint(), candidates2.iterator().next().getTimePoint());
+ // and this should have spanned fix1..fix5 with the greatest course change on fix5, so that gets
+ // emitted as the maneuver candidate, and all fixes from FixWindow's head up to and including fix5
+ // are expected to get removed from FixWindow
+ // Now add an ever newer fix to the queue, forcing fix3_5 to get added if it hasn't been cleaned up
+ // by the FixWindow trimming:
+ final GPSFixMoving fix10 = travel(fix9, 4000l, 5, 2);
+ track.add(fix10);
+ }
+
@Test
public void simpleTackRecognition() {
final GPSFixMoving start = fix(10000l, 0, 0, 5, 0);
diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/impl/CourseChangeBasedTrackApproximation.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/impl/CourseChangeBasedTrackApproximation.java
index d797a6d1dfe..8c1d9c0f65b 100755
--- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/impl/CourseChangeBasedTrackApproximation.java
+++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/impl/CourseChangeBasedTrackApproximation.java
@@ -173,7 +173,7 @@ public class CourseChangeBasedTrackApproximation implements Serializable, GPSTra
*
*
* This method queues the new fix and only adds it to the window when it is "old enough" to not be influenced
- * anymore by newer fixes that may still arrive. The influence is measured by half the
+ * anymore by newer fixes that may still arrive. The influence is measured by the
* {@link GPSFixTrack#getMillisecondsOverWhichToAverageSpeed()} interval. This way, approximation results
* are more stable but have a delay with regards to the newest fixes known by the track.
*
@@ -280,6 +280,12 @@ public class CourseChangeBasedTrackApproximation implements Serializable, GPSTra
courseChangeBetweenFixesInWindow.add(new ScalableDouble(courseChangeBetweenPreviousAndNextInDegrees));
} else {
courseChangeBetweenFixesInWindow.add(insertPosition-1, new ScalableDouble(courseChangeBetweenPreviousAndNextInDegrees));
+ if (courseChangeBetweenFixesInWindow.size() > insertPosition) { // the node just added isn't the last one; update the next node!
+ courseChangeBetweenFixesInWindow.remove(insertPosition);
+ final SpeedWithBearing nextNextSpeed = this.speedForFixesInWindow.get(insertPosition+1);
+ final double courseChangeBetweenNextAndNextNextInDegrees = nextSpeed.getBearing().getDifferenceTo(nextNextSpeed.getBearing()).getDegrees();
+ courseChangeBetweenFixesInWindow.add(insertPosition, new ScalableDouble(courseChangeBetweenNextAndNextNextInDegrees));
+ }
}
if (windowDuration.compareTo(getMaximumWindowLength()) > 0) {
result = tryToExtractManeuverCandidate();
@@ -360,15 +366,35 @@ public class CourseChangeBasedTrackApproximation implements Serializable, GPSTra
*/
private void removeFirst(int howManyElementsToRemove) {
assert !window.isEmpty();
+ final int oldSize = window.size();
for (int i=0; i= maximumCourseChangeToPort ? 1 : -1);
if (absoluteCourseChangeInDegrees > maximumAbsoluteCourseChangeInCorrectDirection) {
maximumAbsoluteCourseChangeInCorrectDirection = absoluteCourseChangeInDegrees;
- indexOfMaximumAbsoluteCourseChangeInCorrectDirection = i;
+ indexOfMaximumAbsoluteCourseChangeInCorrectDirection = i+1; // the course change is to the next fix in window
}
i++;
}
@@ -414,6 +440,7 @@ public class CourseChangeBasedTrackApproximation implements Serializable, GPSTra
} else {
result = null;
}
+ assert indexOfMaximumAbsoluteCourseChangeInCorrectDirection < window.size();
return result == null ? null : new Pair<>(result, indexOfMaximumAbsoluteCourseChangeInCorrectDirection);
}
diff --git a/java/com.sap.sailing.targetplatform.base/features/target-base/feature.xml b/java/com.sap.sailing.targetplatform.base/features/target-base/feature.xml
index 6b6964b31ed..da1890f4ba6 100755
--- a/java/com.sap.sailing.targetplatform.base/features/target-base/feature.xml
+++ b/java/com.sap.sailing.targetplatform.base/features/target-base/feature.xml
@@ -282,28 +282,28 @@
id="org.eclipse.jetty.apache-jsp"
download-size="0"
install-size="0"
- version="9.4.57.v20241219"
+ version="9.4.58.v20250814"
unpack="false"/>
-
-
-
+
+
+
diff --git a/java/com.sap.sailing.targetplatform/scripts/createAndUploadJettyP2Repository.sh b/java/com.sap.sailing.targetplatform/scripts/createAndUploadJettyP2Repository.sh
index a15563c99ae..54586f416ce 100755
--- a/java/com.sap.sailing.targetplatform/scripts/createAndUploadJettyP2Repository.sh
+++ b/java/com.sap.sailing.targetplatform/scripts/createAndUploadJettyP2Repository.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# Fetches the latest Jetty 9.4 version from the official Jetty p2 repository, uploads it to sapsailing.com and updates all references in the workspace.
+# Specific components such as apache-jsp and jetty-osgi-boot-jsp are updated to the new version, too, but not from the p2 repo but directly from Maven Central, as the p2 repo does not contain the source bundles.
VERSION=$( curl https://download.eclipse.org/jetty/updates/jetty-bundles-9.x/ | grep "/jetty/updates/jetty-bundles-9.x" | sed -e 's/^.*> \?\(9\.4\.[0-9]*\.v[0-9]*\)<.*$/\1/' )
echo "Found version ${VERSION}"
P2_URL="https://download.eclipse.org/jetty/updates/jetty-bundles-9.x/${VERSION}/"
diff --git a/java/com.sap.sse.feature.runtime/feature.xml b/java/com.sap.sse.feature.runtime/feature.xml
index c503ed25dac..6fac9f9ae2a 100644
--- a/java/com.sap.sse.feature.runtime/feature.xml
+++ b/java/com.sap.sse.feature.runtime/feature.xml
@@ -63,14 +63,14 @@
id="org.eclipse.jetty.osgi.boot"
download-size="0"
install-size="0"
- version="9.4.57.v20241219"
+ version="9.4.58.v20250814"
unpack="false"/>
@@ -895,7 +895,7 @@
id="org.eclipse.jetty.osgi.boot.jsp.source"
download-size="0"
install-size="0"
- version="9.4.57.v20241219"
+ version="9.4.58.v20250814"
unpack="false"/>