mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-04 03:13:49 +00:00
display mappings from RegattaLog in mappings dialog
This commit is contained in:
1 parent
1a4f86e3ad
commit
d7e010c88a
7 files changed
+51
-11
No files matched your search
+2
-2
@@ -228,12 +228,12 @@ public class RaceLogRaceTracker implements RaceTracker, GPSFixReceivedListener {
|
||||
}
|
||||
|
||||
private Map<Competitor, List<DeviceMapping<Competitor>>> getNewCompetitorMappings() {
|
||||
return new MultiLogAnalyzer<>(new DeviceCompetitorMappingFinder.Factory<>(),
|
||||
return new MultiLogAnalyzer<>(new DeviceCompetitorMappingFinder.Factory(),
|
||||
new MapWithValueCollectionReducer<>(), params.getLogHierarchy()).analyze();
|
||||
}
|
||||
|
||||
private Map<Mark, List<DeviceMapping<Mark>>> getNewMarkMappings() {
|
||||
return new MultiLogAnalyzer<>(new DeviceMarkMappingFinder.Factory<>(), new MapWithValueCollectionReducer<>(),
|
||||
return new MultiLogAnalyzer<>(new DeviceMarkMappingFinder.Factory(), new MapWithValueCollectionReducer<>(),
|
||||
params.getLogHierarchy()).analyze();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ import com.sap.sailing.domain.racelogtracking.DeviceMapping;
|
||||
public class DeviceCompetitorMappingFinder<LogT extends AbstractLog<EventT, VisitorT>, EventT extends AbstractLogEvent<VisitorT>, VisitorT>
|
||||
extends DeviceMappingFinder<LogT, EventT, VisitorT, Competitor> {
|
||||
|
||||
public static class Factory<T> implements AnalyzerFactory<Map<Competitor, List<DeviceMapping<Competitor>>>> {
|
||||
public static class Factory implements AnalyzerFactory<Map<Competitor, List<DeviceMapping<Competitor>>>> {
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public LogAnalyzer<Map<Competitor, List<DeviceMapping<Competitor>>>> createAnalyzer(AbstractLog<?, ?> log) {
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ import com.sap.sailing.domain.racelogtracking.DeviceMapping;
|
||||
public class DeviceMarkMappingFinder<LogT extends AbstractLog<EventT, VisitorT>, EventT extends AbstractLogEvent<VisitorT>, VisitorT>
|
||||
extends DeviceMappingFinder<LogT, EventT, VisitorT, Mark> {
|
||||
|
||||
public static class Factory<T> implements AnalyzerFactory<Map<Mark, List<DeviceMapping<Mark>>>> {
|
||||
public static class Factory implements AnalyzerFactory<Map<Mark, List<DeviceMapping<Mark>>>> {
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public LogAnalyzer<Map<Mark, List<DeviceMapping<Mark>>>> createAnalyzer(AbstractLog<?, ?> log) {
|
||||
|
||||
+1
-1
@@ -256,7 +256,7 @@ public class RaceLogTrackingDeviceMappingsDialog extends RaceLogTrackingDialog {
|
||||
}
|
||||
|
||||
private void refresh() {
|
||||
sailingService.getDeviceMappingsFromRaceLog(leaderboardName, raceColumnName, fleetName, new AsyncCallback<List<DeviceMappingDTO>>() {
|
||||
sailingService.getDeviceMappingsFromLogHierarchy(leaderboardName, raceColumnName, fleetName, new AsyncCallback<List<DeviceMappingDTO>>() {
|
||||
@Override
|
||||
public void onSuccess(List<DeviceMappingDTO> result) {
|
||||
mappings = result;
|
||||
|
||||
+3
@@ -549,4 +549,7 @@ public interface SailingService extends RemoteService {
|
||||
* leaderboard is coupled to.
|
||||
*/
|
||||
Collection<EventDTO> getEventsForLeaderboard(String leaderboardName);
|
||||
|
||||
List<DeviceMappingDTO> getDeviceMappingsFromLogHierarchy(String leaderboardName, String raceColumnName,
|
||||
String fleetName) throws TransformationException;
|
||||
}
|
||||
+7
-1
@@ -597,7 +597,13 @@ public interface SailingServiceAsync extends BuildVersionRetriever {
|
||||
void pingMarkViaRaceLogTracking(String leaderboardName, String raceColumnName, String fleetName, MarkDTO mark,
|
||||
PositionDTO position, AsyncCallback<Void> callback);
|
||||
|
||||
void getDeserializableDeviceIdentifierTypes(AsyncCallback<List<String>> callback);
|
||||
void getDeserializableDeviceIdentifierTypes(AsyncCallback<List<String>> callback);
|
||||
|
||||
/**
|
||||
* Do not only use the racelog, but also other logs (e.g. RegattaLogs) in the hierarchy of the race.
|
||||
*/
|
||||
void getDeviceMappingsFromLogHierarchy(String leaderboardName, String raceColumnName, String fleetName,
|
||||
AsyncCallback<List<DeviceMappingDTO>> callback);
|
||||
|
||||
void getDeviceMappingsFromRaceLog(String leaderboardName, String raceColumnName, String fleetName,
|
||||
AsyncCallback<List<DeviceMappingDTO>> callback);
|
||||
|
||||
+36
-5
@@ -54,6 +54,8 @@ import org.osgi.framework.InvalidSyntaxException;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
import org.osgi.util.tracker.ServiceTracker;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLog;
|
||||
import com.sap.sailing.domain.abstractlog.MultiLogAnalyzer;
|
||||
import com.sap.sailing.domain.abstractlog.Revokable;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
@@ -4943,17 +4945,33 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
deviceId), from, to, item, originalRaceLogEventUUIDs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceMappingDTO> getDeviceMappingsFromRaceLog(String leaderboardName, String raceColumnName,
|
||||
String fleetName) throws TransformationException {
|
||||
private List<AbstractLog<?, ?>> getLogHierarchy(String leaderboardName, String raceColumnName,
|
||||
String fleetName) {
|
||||
List<AbstractLog<?, ?>> result = new ArrayList<>();
|
||||
RaceLog raceLog = getRaceLog(leaderboardName, raceColumnName, fleetName);
|
||||
result.add(raceLog);
|
||||
Leaderboard leaderboard = getService().getLeaderboardByName(leaderboardName);
|
||||
if (leaderboard instanceof HasRegattaLog) {
|
||||
result.add(((HasRegattaLog) leaderboard).getRegattaLog());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<DeviceMappingDTO> getDeviceMappingsFromLogs(List<AbstractLog<?, ?>> logs)
|
||||
throws TransformationException {
|
||||
List<DeviceMappingDTO> result = new ArrayList<DeviceMappingDTO>();
|
||||
for (List<? extends DeviceMapping<Competitor>> list : new DeviceCompetitorMappingFinder<>(raceLog).analyze().values()) {
|
||||
for (List<? extends DeviceMapping<Competitor>> list : new MultiLogAnalyzer<>(
|
||||
new DeviceCompetitorMappingFinder.Factory(),
|
||||
new MultiLogAnalyzer.MapWithValueCollectionReducer<Competitor, DeviceMapping<Competitor>, List<DeviceMapping<Competitor>>>(),
|
||||
logs).analyze().values()) {
|
||||
for (DeviceMapping<Competitor> mapping : list) {
|
||||
result.add(convertToDeviceMappingDTO(mapping));
|
||||
}
|
||||
}
|
||||
for (List<? extends DeviceMapping<Mark>> list : new DeviceMarkMappingFinder<>(raceLog).analyze().values()) {
|
||||
for (List<? extends DeviceMapping<Mark>> list : new MultiLogAnalyzer<>(
|
||||
new DeviceMarkMappingFinder.Factory(),
|
||||
new MultiLogAnalyzer.MapWithValueCollectionReducer<Mark, DeviceMapping<Mark>, List<DeviceMapping<Mark>>>(),
|
||||
logs).analyze().values()) {
|
||||
for (DeviceMapping<Mark> mapping : list) {
|
||||
result.add(convertToDeviceMappingDTO(mapping));
|
||||
}
|
||||
@@ -4961,6 +4979,19 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceMappingDTO> getDeviceMappingsFromLogHierarchy(String leaderboardName, String raceColumnName,
|
||||
String fleetName) throws TransformationException {
|
||||
return getDeviceMappingsFromLogs(getLogHierarchy(leaderboardName, raceColumnName, fleetName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceMappingDTO> getDeviceMappingsFromRaceLog(String leaderboardName, String raceColumnName,
|
||||
String fleetName) throws TransformationException {
|
||||
RaceLog raceLog = getRaceLog(leaderboardName, raceColumnName, fleetName);
|
||||
return getDeviceMappingsFromLogs(Collections.<AbstractLog<?, ?>>singletonList(raceLog));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDeviceMappingToRaceLog(String leaderboardName, String raceColumnName, String fleetName,
|
||||
DeviceMappingDTO dto) throws NoCorrespondingServiceRegisteredException, TransformationException {
|
||||
|
||||
Reference in new issue
Block a user