mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-25 05:23:51 +00:00
embed RaceCourseDTO in CoursePositionsDTO so that the sequence of waypoints becomes clear; shares MarkDTOs for efficiency
This commit is contained in:
1 parent
14105f8bf9
commit
b19b5d5807
2 files changed
+5
-31
No files matched your search
-26
@@ -1,26 +0,0 @@
|
||||
package com.sap.sailing.gwt.ui.actions;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||
import com.sap.sailing.gwt.ui.shared.CoursePositionsDTO;
|
||||
import com.sap.sse.gwt.client.async.AsyncAction;
|
||||
|
||||
public class GetCoursePositionsAction implements AsyncAction<CoursePositionsDTO> {
|
||||
private final SailingServiceAsync sailingService;
|
||||
private final RegattaAndRaceIdentifier raceIdentifier;
|
||||
private final Date date;
|
||||
|
||||
public GetCoursePositionsAction(SailingServiceAsync sailingService, RegattaAndRaceIdentifier raceIdentifier, Date date) {
|
||||
this.sailingService = sailingService;
|
||||
this.raceIdentifier = raceIdentifier;
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(AsyncCallback<CoursePositionsDTO> callback) {
|
||||
sailingService.getCoursePositions(raceIdentifier, date, callback);
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -1865,11 +1865,11 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
marks.add(b);
|
||||
}
|
||||
}
|
||||
for (Mark mark : marks) {
|
||||
GPSFixTrack<Mark, GPSFix> track = trackedRace.getOrCreateTrack(mark);
|
||||
Position positionAtDate = track.getEstimatedPosition(dateAsTimePoint, /* extrapolate */false);
|
||||
if (positionAtDate != null) {
|
||||
result.marks.add(convertToMarkDTO(mark, positionAtDate));
|
||||
for (final WaypointDTO waypointDTO : result.course.waypoints) {
|
||||
for (final MarkDTO markDTO : waypointDTO.controlPoint.getMarks()) {
|
||||
if (markDTO.position != null) {
|
||||
result.marks.add(markDTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user