mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-27 06:17:27 +00:00
Merge remote-tracking branch 'origin/master' into design2015
This commit is contained in:
commit
28a8517bdd
7 files changed
+26
-29
No files matched your search
Binary file not shown.
@@ -209,12 +209,16 @@ public class CourseImpl extends NamedImpl implements Course {
|
||||
|
||||
@Override
|
||||
public Leg getFirstLeg() {
|
||||
try {
|
||||
return legs.get(0);
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
// yes, it's a bit clumsy, but this way it's still atomic without requiring a lock which is even more expensive
|
||||
return null;
|
||||
Leg result = null;
|
||||
if (!legs.isEmpty()) {
|
||||
try {
|
||||
result = legs.get(0);
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
// The legs collection could have turned empty since the check; we don't want to have to lock here...
|
||||
// Yes, it's a bit clumsy, but this way it's still atomic without requiring a lock which is even more expensives
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
-6
@@ -2,12 +2,11 @@ package com.sap.sailing.domain.leaderboard.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.NavigableSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@@ -40,12 +39,12 @@ public class ScoreCorrectionImpl implements SettableScoreCorrection {
|
||||
/**
|
||||
* If no max point reason is provided for a competitor/race, {@link MaxPointsReason#NONE} should be the default.
|
||||
*/
|
||||
private final Map<com.sap.sse.common.Util.Pair<Competitor, RaceColumn>, MaxPointsReason> maxPointsReasons;
|
||||
private final ConcurrentHashMap<com.sap.sse.common.Util.Pair<Competitor, RaceColumn>, MaxPointsReason> maxPointsReasons;
|
||||
|
||||
/**
|
||||
* If no score correction is provided here, the uncorrected points are the default.
|
||||
*/
|
||||
private final Map<com.sap.sse.common.Util.Pair<Competitor, RaceColumn>, Double> correctedScores;
|
||||
private final ConcurrentHashMap<com.sap.sse.common.Util.Pair<Competitor, RaceColumn>, Double> correctedScores;
|
||||
|
||||
/**
|
||||
* If <code>null</code>, despite a non-<code>null</code> {@link #timePointOfLastCorrectionsValidity} value the
|
||||
@@ -67,8 +66,8 @@ public class ScoreCorrectionImpl implements SettableScoreCorrection {
|
||||
|
||||
public ScoreCorrectionImpl(Leaderboard leaderboard) {
|
||||
this.leaderboard = leaderboard;
|
||||
this.maxPointsReasons = new HashMap<com.sap.sse.common.Util.Pair<Competitor, RaceColumn>, MaxPointsReason>();
|
||||
this.correctedScores = new HashMap<com.sap.sse.common.Util.Pair<Competitor, RaceColumn>, Double>();
|
||||
this.maxPointsReasons = new ConcurrentHashMap<>();
|
||||
this.correctedScores = new ConcurrentHashMap<>();
|
||||
this.scoreCorrectionListeners = new HashSet<ScoreCorrectionListener>();
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -25,6 +25,7 @@ import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CompetitorStore;
|
||||
import com.sap.sailing.domain.base.Nationality;
|
||||
import com.sap.sailing.domain.base.Team;
|
||||
import com.sap.sailing.domain.common.racelog.tracking.DeviceMappingConstants;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
@@ -50,14 +51,14 @@ public class CompetitorsResource extends AbstractSailingServerResource {
|
||||
json.put("id", competitor.getId().toString());
|
||||
json.put("name", competitor.getName());
|
||||
json.put("sailID", competitor.getBoat().getSailID());
|
||||
json.put("nationality", competitor.getTeam().getNationality().getThreeLetterIOCAcronym());
|
||||
json.put("countryCode", competitor.getTeam().getNationality().getCountryCode().getTwoLetterISOCode());
|
||||
final Nationality nationality = competitor.getTeam().getNationality();
|
||||
json.put("nationality", nationality==null?null:nationality.getThreeLetterIOCAcronym());
|
||||
json.put("countryCode", nationality==null?null:nationality.getCountryCode().getTwoLetterISOCode());
|
||||
json.put("boatClassName", competitor.getBoat().getBoatClass().getName());
|
||||
json.put("color", competitor.getColor() != null ? competitor.getColor().getAsHtml() : null);
|
||||
if(competitor.getFlagImage() != null) {
|
||||
json.put("flagImage", competitor.getFlagImage().toString());
|
||||
}
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -249,10 +249,10 @@ public interface ReplicableWithObjectInputStream<S, O extends OperationWithResul
|
||||
}
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
// FIXME why is the following call not performed in a finally clause? What are the consequences of not "cleaning up" in case the method terminates normally?
|
||||
setCurrentlyFillingFromInitialLoadOrApplyingOperationReceivedFromMaster(false);
|
||||
logger.log(Level.SEVERE, "apply", e);
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
setCurrentlyFillingFromInitialLoadOrApplyingOperationReceivedFromMaster(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -162,6 +162,8 @@ public class ReplicationServlet extends AbstractHttpServlet {
|
||||
Thread.currentThread().setContextClassLoader(replicable.getClass().getClassLoader());
|
||||
OperationWithResult<S, ?> operation = replicable.readOperation(is);
|
||||
Thread.currentThread().setContextClassLoader(oldContextClassLoader);
|
||||
logger.info("Applying operation of type " + operation.getClass().getName()
|
||||
+ " received from replica to replicable " + replicable.toString());
|
||||
replicable.apply(operation);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,30 +2,21 @@
|
||||
|
||||
With the development of [RaceLogTracking](racelog-tracking) and the [Tracking App](tracking-app) it is now possible to track races using only smartphones. This can be set up following the following steps.
|
||||
|
||||
1. Create Event, Regatta, Leaderboard,... as always.
|
||||
|
||||
Note: Make sure to have a LeaderboardGroup and have it attached to the event.
|
||||
1. Create Event, Regatta, Leaderboard,... as always. Make sure to make a LeaderboardGroup and attach it to the event.
|
||||
|
||||
2. Go to the Connectors/RaceLog Tracking tab in the AdminConsole and click the "Denote For RaceLog Tracking" symbol in the Actions bar (Green arrow pointing right).
|
||||
|
||||
3. Register (or create) the competitors for the leaderboard using the symbol also in the Actions bar (Face).
|
||||
|
||||
Note: It is also possible denote for RaceLog Tracking or register competitors to each race individually, but since this is usually the same for an entire event it is easier to do it for the whole leaderboard.
|
||||
3. Register (or create) the competitors for the leaderboard using the symbol also in the Actions bar. It is also possible denote for RaceLog Tracking or register competitors to each race individually, but since this is usually the same for an entire event it is easier to do it for the whole leaderboard.
|
||||
|
||||
4. Click the "Define Course Layout" symbol (Two flags/marks) on the Actions tab of the first race of the leaderboard. Create a course by defining first marks and than waypoints. Use the copy symbol (Two pieces of paper) to copy the course to other races.
|
||||
|
||||
Note: In the future it should be possible to do this for the entire leaderboard too, as the course does not change for many events.
|
||||
|
||||
5.(optional) If not using the Buoy-Positioning App, it is possible to set the mark locations in the course layout panel, using the "Set Mark Location" symbol on the right of the mark list.
|
||||
5. If not using the Buoy-Positioning App, it is possible to set the mark locations in the course layout panel, using the "Set Mark Location" symbol on the right of the mark list. If using the Race Committee App, make sure to only use the ByMarks Course Designer, as ByName can overwrite a manually created course with an empty one.
|
||||
|
||||
Note: If using the Race Committee App, make sure to only use the ByMarks Course Designer, as ByName will overwrite a manuelly created course with an empty one.
|
||||
|
||||
6. Map the smartphones the the competitors using the "Map Devices to Competitors and Mark" tab of the Leaderboard Actions bar (or for each race, but going over the leaderboard is usually easier, as above). Select each Competitor and scan the QR-Code with the Tracking-App. Do not forget to press (or remind the sailors to press) start tracking before the races start.
|
||||
6. Map the smartphones the the competitors using the "Map Devices to Competitors and Mark" tab of the Leaderboard Actions bar (or for each race, but going over the leaderboard is usually easier, as above). Select each Competitor and scan the QR-Code with the Tracking-App. Do not forget to press (or remind the sailors to press) start tracking before the races start. Mappings can be viewed (and deleted) in the "Map Devices to Competitors and Marks" window of each race.
|
||||
|
||||
7. To use the Buoy Positioning App click the "Invite Buoy Tenders" symbol in the Leaderboard Actions tab and send a QR-Code by email to be scanned using the App.
|
||||
|
||||
|
||||
- Um Tracking-Intervalle zu inspizieren, im Tab RaceLog Tracking unten links bei den einzelnen Rennen aus der Action Bar auf "Map Devices to Competitors and Marks". Dort siehst Du die Zuordnungstabelle und kannst zum einen Zuordnungen ganz entfernen, neue Zuordnungen manuell anlegen (da muss man dann allerdings mit der DeviceID 'rummachen; eher unpraktisch, aber fuer Notfaelle vielleicht irgendwann mal praktisch) und noch offene Tracking-Intervalle abschliessen. By default siehst Du da nur die Competitor-Zuordnungen; mit der Checkbox "Show Mappings for pinged Marks" kannst Du auch die Tonnen sehen
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user