mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-16 17:21:00 +00:00
Ping marks in RegattaLog
This commit is contained in:
1 parent
36e2908adc
commit
5136ceff78
7 files changed
+13
-27
No files matched your search
-5
@@ -74,11 +74,6 @@ public interface RaceLogTrackingAdapter {
|
||||
void denoteAllRacesForRaceLogTracking(RacingEventService service, Leaderboard leaderboard)
|
||||
throws NotDenotableForRaceLogTrackingException;
|
||||
|
||||
/**
|
||||
* @see #pingMark(RaceLog, Mark, GPSFix, RacingEventService) using a random {@link PingDeviceIdentifier}
|
||||
*/
|
||||
void pingMark(RaceLog raceLogToAddTo, Mark mark, GPSFix gpsFix, RacingEventService service);
|
||||
|
||||
/**
|
||||
* @see #pingMark(RaceLog, Mark, GPSFix, RacingEventService)
|
||||
*/
|
||||
|
||||
+1
-9
@@ -255,15 +255,7 @@ public class RaceLogTrackingAdapterImpl implements RaceLogTrackingAdapter {
|
||||
logger.log(Level.WARNING, "Could not ping mark " + mark);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pingMark(RaceLog raceLog, Mark mark, GPSFix gpsFix, RacingEventService service) {
|
||||
pingMark(raceLog, mark, gpsFix, service,
|
||||
(DeviceIdentifier dev, TimePoint timePoint) -> RaceLogEventFactory.INSTANCE
|
||||
.createDeviceMarkMappingEvent(timePoint, service.getServerAuthor(), dev, mark,
|
||||
raceLog.getCurrentPassId(), timePoint, timePoint), new PingDeviceIdentifierImpl());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void pingMark(RegattaLog regattaLog, Mark mark, GPSFix gpsFix, RacingEventService service) {
|
||||
pingMark(regattaLog, mark, gpsFix, service,
|
||||
|
||||
+4
-3
@@ -15,13 +15,14 @@ import com.sap.sailing.domain.base.impl.SeriesImpl;
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
import com.sap.sailing.domain.common.RankingMetrics;
|
||||
import com.sap.sailing.domain.common.impl.DegreePosition;
|
||||
import com.sap.sailing.domain.common.racelog.tracking.DoesNotHaveRegattaLogException;
|
||||
import com.sap.sailing.domain.leaderboard.RegattaLeaderboard;
|
||||
import com.sap.sailing.domain.leaderboard.impl.HighPoint;
|
||||
import com.sap.sailing.domain.ranking.RankingMetricsFactory;
|
||||
import com.sap.sailing.gwt.ui.shared.MarkDTO;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
|
||||
public class PingMarkViaRaceLogTest {
|
||||
public class PingMarkViaRegattaLogTest {
|
||||
private SailingServiceImplMock sailingService;
|
||||
private RacingEventService service;
|
||||
private final String columnName = "column";
|
||||
@@ -34,7 +35,7 @@ public class PingMarkViaRaceLogTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPinging() {
|
||||
public void testPinging() throws DoesNotHaveRegattaLogException {
|
||||
service.getMongoObjectFactory().getDatabase().dropDatabase();
|
||||
Series series = new SeriesImpl("series", false, Collections.singletonList(fleet),
|
||||
Collections.singletonList(columnName), service);
|
||||
@@ -47,6 +48,6 @@ public class PingMarkViaRaceLogTest {
|
||||
MarkDTO mark = new MarkDTO("mark", "mark");
|
||||
Position position = new DegreePosition(30, 40);
|
||||
|
||||
sailingService.pingMarkViaRaceLogTracking(leaderboard.getName(), columnName, fleet.getName(), mark, position);
|
||||
sailingService.pingMark(leaderboard.getName(), mark, position);
|
||||
}
|
||||
}
|
||||
+1
-4
@@ -1,7 +1,5 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.gwt.cell.client.FieldUpdater;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
@@ -98,8 +96,7 @@ public class RaceLogCourseManagementWidget extends CourseManagementWidget {
|
||||
new DataEntryDialog.DialogCallback<Position>() {
|
||||
@Override
|
||||
public void ok(Position position) {
|
||||
sailingService.pingMarkViaRaceLogTracking(leaderboardName, raceColumnName,
|
||||
fleetName, markDTO, position, new AsyncCallback<Void>() {
|
||||
sailingService.pingMark(leaderboardName, markDTO, position, new AsyncCallback<Void>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Void result) {
|
||||
|
||||
+2
-1
@@ -478,8 +478,9 @@ public interface SailingService extends RemoteService, FileStorageManagementGwtS
|
||||
|
||||
/**
|
||||
* Adds a fix to the {@link GPSFixStore}, and creates a mapping with a virtual device for exactly the current timepoint.
|
||||
* @throws DoesNotHaveRegattaLogException
|
||||
*/
|
||||
void pingMarkViaRaceLogTracking(String leaderboardName, String raceColumnName, String fleetName, MarkDTO mark, Position position);
|
||||
void pingMark(String leaderboardName, MarkDTO mark, Position position) throws DoesNotHaveRegattaLogException;
|
||||
|
||||
List<DeviceMappingDTO> getDeviceMappingsFromRaceLog(String leaderboardName, String raceColumnName, String fleetName)
|
||||
throws TransformationException;
|
||||
|
||||
+1
-1
@@ -632,7 +632,7 @@ public interface SailingServiceAsync extends ServerInfoRetriever, FileStorageMan
|
||||
void getLastCourseDefinitionInRaceLog(String leaderboardName, String raceColumnName, String fleetName,
|
||||
AsyncCallback<RaceCourseDTO> callback);
|
||||
|
||||
void pingMarkViaRaceLogTracking(String leaderboardName, String raceColumnName, String fleetName, MarkDTO mark,
|
||||
void pingMark(String leaderboardName, MarkDTO mark,
|
||||
Position position, AsyncCallback<Void> callback);
|
||||
|
||||
void getDeserializableDeviceIdentifierTypes(AsyncCallback<List<String>> callback);
|
||||
|
||||
+4
-4
@@ -5081,15 +5081,15 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pingMarkViaRaceLogTracking(String leaderboardName, String raceColumnName, String fleetName,
|
||||
MarkDTO markDTO, Position positionDTO) {
|
||||
RaceLog raceLog = getRaceLog(leaderboardName, raceColumnName, fleetName);
|
||||
public void pingMark(String leaderboardName,
|
||||
MarkDTO markDTO, Position positionDTO) throws DoesNotHaveRegattaLogException {
|
||||
RegattaLog regattaLog = getRegattaLogInternal(leaderboardName);
|
||||
Mark mark = convertToMark(markDTO, true);
|
||||
TimePoint time = MillisecondsTimePoint.now();
|
||||
Position position = positionDTO;
|
||||
GPSFix fix = new GPSFixImpl(position, time);
|
||||
|
||||
getRaceLogTrackingAdapter().pingMark(raceLog, mark, fix, getService());
|
||||
getRaceLogTrackingAdapter().pingMark(regattaLog, mark, fix, getService());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user