mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-17 11:19:15 +00:00
Merge branch 'bug6304' into eclipse-main
This commit is contained in:
-2
@@ -36,6 +36,4 @@ public interface Candidate extends Comparable<CandidateImpl>, Timed {
|
||||
Double getProbability();
|
||||
|
||||
int compareTo(Candidate other);
|
||||
|
||||
long getTimePointAsMillis();
|
||||
}
|
||||
|
||||
+1
-1
@@ -240,7 +240,7 @@ public class CandidateChooserImpl implements CandidateChooser {
|
||||
} else if (o1 == end || o2 == start) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = (int) (o1.getTimePointAsMillis() - o2.getTimePointAsMillis());
|
||||
result = (int) (o1.getTimePoint().asMillis() - o2.getTimePoint().asMillis());
|
||||
if (result == 0) {
|
||||
result = Integer.compare(o1.getOneBasedIndexOfWaypoint(), o2.getOneBasedIndexOfWaypoint());
|
||||
if (result == 0) {
|
||||
|
||||
+4
-22
@@ -5,33 +5,20 @@ import java.util.Comparator;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
import com.sap.sailing.domain.markpassingcalculation.Candidate;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.impl.AbstractTimePoint;
|
||||
|
||||
public class CandidateImpl implements Candidate {
|
||||
private static final long serialVersionUID = -4626280455738918911L;
|
||||
private final Waypoint w;
|
||||
private final boolean timePointAsMillisIsNull;
|
||||
private final long timePointAsMillis;
|
||||
private final TimePoint timePoint;
|
||||
private final double probability;
|
||||
private final Integer oneBasedIndexOfWaypoint;
|
||||
private final Comparator<TimePoint> nullSafeTimePointComparator;
|
||||
private static final Comparator<TimePoint> nullSafeTimePointComparator = Comparator.nullsLast(Comparator.naturalOrder());
|
||||
|
||||
public class CandidateTimePoint extends AbstractTimePoint implements TimePoint {
|
||||
private static final long serialVersionUID = 8156956989028606884L;
|
||||
|
||||
@Override
|
||||
public long asMillis() {
|
||||
return timePointAsMillis;
|
||||
}
|
||||
}
|
||||
|
||||
public CandidateImpl(int oneBasedIndexOfWaypoint, TimePoint p, double probability, Waypoint w) {
|
||||
this.w = w;
|
||||
this.timePointAsMillisIsNull = p == null;
|
||||
this.timePointAsMillis = p == null ? 0 : p.asMillis();
|
||||
this.timePoint = p;
|
||||
this.probability = probability;
|
||||
this.oneBasedIndexOfWaypoint = oneBasedIndexOfWaypoint;
|
||||
this.nullSafeTimePointComparator = Comparator.nullsLast(Comparator.naturalOrder());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,12 +28,7 @@ public class CandidateImpl implements Candidate {
|
||||
|
||||
@Override
|
||||
public TimePoint getTimePoint() {
|
||||
return timePointAsMillisIsNull ? null : new CandidateTimePoint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTimePointAsMillis() {
|
||||
return timePointAsMillisIsNull ? -1 : timePointAsMillis;
|
||||
return timePoint;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
@@ -6,6 +6,11 @@
|
||||
<div id="mainContent">
|
||||
<h4 class="articleHeadline" id="sailingAnalyticsHeadline">What's New - Sailing Analytics</h4>
|
||||
<div class="innerContent">
|
||||
<h5 class="articleSubheadline">September 2026</h5>
|
||||
<ul class="bulletList">
|
||||
<li>Fix for recently introduced issue in the simulator when used for live smartphone-tracked
|
||||
races. A time point from the mark passing detection turned out to be non-serializable.</li>
|
||||
</ul>
|
||||
<h5 class="articleSubheadline">August 2026</h5>
|
||||
<ul class="bulletList">
|
||||
<li>An event's course area configuration dialog now can copy course areas from other local
|
||||
|
||||
Reference in New Issue
Block a user