mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-23 22:19:13 +00:00
Merge branch 'origin/master'
This commit is contained in:
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -476,7 +476,8 @@ public class ClientParamsPHP {
|
||||
}
|
||||
|
||||
public Race getRace() {
|
||||
return new Race(UUID.fromString(properties.get("RaceID")));
|
||||
final String raceId = properties.get("RaceID");
|
||||
return raceId == null ? null : new Race(UUID.fromString(raceId));
|
||||
}
|
||||
|
||||
public Event getEvent() {
|
||||
|
||||
+38
-32
@@ -284,41 +284,47 @@ public class TracTracRaceTrackerImpl extends AbstractRaceTrackerImpl implements
|
||||
final ClientParamsPHP clientParams;
|
||||
try {
|
||||
clientParams = new ClientParamsPHP(paramURL, new InputStreamReader(paramURL.openStream()));
|
||||
List<Pair<com.sap.sailing.domain.base.ControlPoint, NauticalSide>> newCourseControlPointsWithPassingSide = getControlPointsWithPassingSide(clientParams,
|
||||
new ControlPointProducer<com.sap.sailing.domain.base.ControlPoint>() {
|
||||
@Override
|
||||
public com.sap.sailing.domain.base.ControlPoint produceControlPoint(TracTracControlPoint ttControlPoint) {
|
||||
return domainFactory.getOrCreateControlPoint(ttControlPoint);
|
||||
}
|
||||
});
|
||||
if (getRaces() == null || getRaces().isEmpty()) {
|
||||
// create race definition / tracked race and add to event
|
||||
final String raceName = clientParams.getRace().getName();
|
||||
logger.log(Level.INFO, "Found data for non-existing race "+raceName+" in "+paramURL+". Creating RaceDefinition.");
|
||||
final Iterable<Competitor> competitors = getCompetitors(clientParams);
|
||||
final Iterable<com.sap.sailing.domain.tractracadapter.impl.ClientParamsPHP.Competitor> competitorsInClientParams = clientParams.getCompetitors();
|
||||
List<Pair<TracTracControlPoint, NauticalSide>> ttControlPointsAndPassingSide = getControlPointsWithPassingSide(clientParams,
|
||||
new ControlPointProducer<TracTracControlPoint>() {
|
||||
@Override
|
||||
public TracTracControlPoint produceControlPoint(TracTracControlPoint ttControlPoint) {
|
||||
return ttControlPoint;
|
||||
if (clientParams.getRace() != null) {
|
||||
List<Pair<com.sap.sailing.domain.base.ControlPoint, NauticalSide>> newCourseControlPointsWithPassingSide = getControlPointsWithPassingSide(
|
||||
clientParams, new ControlPointProducer<com.sap.sailing.domain.base.ControlPoint>() {
|
||||
@Override
|
||||
public com.sap.sailing.domain.base.ControlPoint produceControlPoint(
|
||||
TracTracControlPoint ttControlPoint) {
|
||||
return domainFactory.getOrCreateControlPoint(ttControlPoint);
|
||||
}
|
||||
});
|
||||
if (getRaces() == null || getRaces().isEmpty()) {
|
||||
// create race definition / tracked race and add to event
|
||||
final String raceName = clientParams.getRace().getName();
|
||||
logger.log(Level.INFO, "Found data for non-existing race " + raceName + " in " + paramURL
|
||||
+ ". Creating RaceDefinition.");
|
||||
final Iterable<Competitor> competitors = getCompetitors(clientParams);
|
||||
final Iterable<com.sap.sailing.domain.tractracadapter.impl.ClientParamsPHP.Competitor> competitorsInClientParams = clientParams
|
||||
.getCompetitors();
|
||||
List<Pair<TracTracControlPoint, NauticalSide>> ttControlPointsAndPassingSide = getControlPointsWithPassingSide(
|
||||
clientParams, new ControlPointProducer<TracTracControlPoint>() {
|
||||
@Override
|
||||
public TracTracControlPoint produceControlPoint(TracTracControlPoint ttControlPoint) {
|
||||
return ttControlPoint;
|
||||
}
|
||||
});
|
||||
Course course = domainFactory.createCourse(clientParams.getRace().getDefaultRoute()
|
||||
.getDescription(), ttControlPointsAndPassingSide);
|
||||
List<Sideline> sidelines = domainFactory.createSidelines(clientParams.getRace().getMetadata(),
|
||||
clientParams.getEvent().getControlPointList());
|
||||
DynamicTrackedRace trackedRace = domainFactory.getOrCreateRaceDefinitionAndTrackedRace(
|
||||
getTrackedRegatta(), clientParams.getRace().getId(), raceName, competitors,
|
||||
getDominantBoatClass(competitorsInClientParams), course, sidelines, windStore,
|
||||
delayToLiveInMillis, WindTrack.DEFAULT_MILLISECONDS_OVER_WHICH_TO_AVERAGE_WIND, /* raceDefinitionSetToUpdate */
|
||||
this, tracTracUpdateURI, tractracEvent.getId(), tracTracUsername, tracTracPassword);
|
||||
if (simulator != null) {
|
||||
simulator.setTrackedRace(trackedRace);
|
||||
}
|
||||
});
|
||||
Course course = domainFactory.createCourse(clientParams.getRace().getDefaultRoute().getDescription(), ttControlPointsAndPassingSide);
|
||||
List<Sideline> sidelines = domainFactory.createSidelines(
|
||||
clientParams.getRace().getMetadata(), clientParams.getEvent().getControlPointList());
|
||||
DynamicTrackedRace trackedRace = domainFactory.getOrCreateRaceDefinitionAndTrackedRace(
|
||||
getTrackedRegatta(), clientParams.getRace().getId(), raceName, competitors,
|
||||
getDominantBoatClass(competitorsInClientParams), course, sidelines, windStore, delayToLiveInMillis,
|
||||
WindTrack.DEFAULT_MILLISECONDS_OVER_WHICH_TO_AVERAGE_WIND, /* raceDefinitionSetToUpdate */ this, tracTracUpdateURI,
|
||||
tractracEvent.getId(), tracTracUsername, tracTracPassword);
|
||||
if (simulator != null) {
|
||||
simulator.setTrackedRace(trackedRace);
|
||||
}
|
||||
compareAndUpdateCourseIfNecessary(newCourseControlPointsWithPassingSide);
|
||||
updateStartStopTimesAndLiveDelay(clientParams, simulator);
|
||||
updateMarkPositionsIfNoPositionsReceivedYet(clientParams);
|
||||
}
|
||||
compareAndUpdateCourseIfNecessary(newCourseControlPointsWithPassingSide);
|
||||
updateStartStopTimesAndLiveDelay(clientParams, simulator);
|
||||
updateMarkPositionsIfNoPositionsReceivedYet(clientParams);
|
||||
} catch (Exception e) {
|
||||
logger.info("Exception " + e.getMessage() + " while trying to read clientparams.php for races " + getRaces());
|
||||
logger.log(Level.SEVERE, "scheduleClientParamsPHPPoller.run", e);
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="true"/>
|
||||
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
|
||||
<listEntry value="com.sap.sailing.gwt.ui.Simulator"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.YoutubePopup"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/gwt/AdminConsole.html"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
@@ -49,7 +48,7 @@
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war "${project_loc:com.sap.sailing.gwt.ui}" -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9997 -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/UserManagement.html com.sap.sailing.gwt.ui.UserManagement -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard -startupUrl /gwt/TvView.html com.sap.sailing.gwt.ui.TvView -startupUrl /gwt/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.ui.RegattaOverview -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.YoutubePopup com.sap.sailing.gwt.ui.Simulator"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war "${project_loc:com.sap.sailing.gwt.ui}" -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9997 -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/UserManagement.html com.sap.sailing.gwt.ui.UserManagement -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard -startupUrl /gwt/TvView.html com.sap.sailing.gwt.ui.TvView -startupUrl /gwt/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.ui.RegattaOverview -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.Simulator"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.gwt.ui"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m -XX:MaxPermSize=512m"/>
|
||||
</launchConfiguration>
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ if [[ $PARAM == "" ]]; then
|
||||
|
||||
if [[ $SERVER_STARTUP_NOTIFY != "" ]]; then
|
||||
if [[ ! -z "$ON_AMAZON" ]]; then
|
||||
echo "Go to $INSTANCE_DNS:$SERVER_PORT to reach your instance!" | `which mail` -s "Server $INSTANCE_ID started up!" -a env.sh $SERVER_STARTUP_NOTIFY
|
||||
echo "Go to http://$INSTANCE_DNS:$SERVER_PORT to reach your instance!" | `which mail` -s "Server $INSTANCE_ID started up!" -a env.sh $SERVER_STARTUP_NOTIFY
|
||||
else
|
||||
echo "OK" | `which mail` -s "Server $INSTANCE_ID started up!" -a env.sh $SERVER_STARTUP_NOTIFY
|
||||
fi
|
||||
|
||||
@@ -123,6 +123,12 @@ or
|
||||
ssh -i .ssh/SailingUser.pem sailing@ec2-54-246-247-194.eu-west-1.compute.amazonaws.com
|
||||
</pre>
|
||||
|
||||
If you want to connect your instance to a subdomain then log onto the main webserver with the Administrator key as root, open the file `/etc/httpd/conf.d/001-events.conf` and put something like this there. As you can see you have to specify the IP address and the port the java server is running on. Make sure to always use the internal IP.
|
||||
|
||||
<pre>
|
||||
Use Spectator idm.sapsailing.com "505 IDM 2013" 172.31.22.12 8888
|
||||
</pre>
|
||||
|
||||
### Testing code on a server
|
||||
|
||||
Starting a test is as easy as starting up a new instance. Just make sure that you fill the field RUN_TESTS and set it to `True`. Also set the field BUILD_FROM to a gitspec that matches the code branch that you want to test. After tests has been run and the server has been started you will get an email giving you all the details. You can then access your instance or simply shut it down.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# ORC/IRC support
|
||||
|
||||
## Rationale
|
||||
|
||||
## Purpose
|
||||
|
||||
Providing...
|
||||
|
||||
## Features
|
||||
|
||||
* Support for different handicap scoring systems
|
||||
* Time On Time
|
||||
* Time On Distance
|
||||
* Performance Curve
|
||||
* Performance Line
|
||||
|
||||
## Synergies
|
||||
|
||||
|
||||
## Risks
|
||||
|
||||
@@ -148,4 +148,18 @@ Competitor c = competitorDeserializer.deserialize(json);
|
||||
|
||||
3. Whenever you add a Domain Object to an instance, it somehow has to be replicated to the other instances. To do so, create an Operation which you can then `apply()` to the `RacingEventService`, which will then replicate it to other intsances (the operations are basically commands as in the Command pattern, with the added difficulty of operational transformation to provide a uniform final state when operations are applied in different orders on different instances). Internally, the apply-mechanism writes to an `ObjectOutputStream`, which on the other side is evaluated by an `ObjectInputStreamResolvingAgainstDomainFactory`. For this reason, all objects implementing the `IsManagedBySharedDomainFactory` interface are resolved against the domain factory via their `resolve()` implementation. This removes the chance of duplicate instances representing the same actual object.
|
||||
|
||||
4. Also, whenever a replica (slave) instance registers with the master instance, it is provided with the current state of the master as an initial load. To do so, the master instance exports its state via the `serializeForInitialReplication()` method in the `RacintEventServiceImpl`, while the replica recieves the object stream output by the master via the `initiallyFillFrom()` method. Again, an `ObjectInputStreamResolvingAgainstDomainFactory` is used.
|
||||
4. Also, whenever a replica (slave) instance registers with the master instance, it is provided with the current state of the master as an initial load. To do so, the master instance exports its state via the `serializeForInitialReplication()` method in the `RacintEventServiceImpl`, while the replica recieves the object stream output by the master via the `initiallyFillFrom()` method. Again, an `ObjectInputStreamResolvingAgainstDomainFactory` is used.
|
||||
|
||||
## Import Another Year of Magnetic Declination Values
|
||||
|
||||
Under java/com.sap.sailing.declination/resources we store magnetic declination values, using one file per year. The resolution at which we usually store those is one degree of latitude and longitude, each. When for a year those values aren't found in a file, an online request is performed to the [NOAA Service](http://www.ngdc.noaa.gov/geomag-web/) which can be time and bandwidth consuming. Therefore, it is a good idea to keep a file with cached declination values around for the current year.
|
||||
|
||||
To produce such a file, use the `main(...)` method of class `com.sap.sailing.declination.impl.DeclinationStore`. There are pre-defined launch configurations in place in the com.sap.sailing.declination bundle project. Adjust the from/to year parameters for the current year. The process usually takes several hours to complete at a one-degree resolution. Don't forget to commit the resulting resources/declination-<year> file to git.
|
||||
|
||||
Experience has shown that sometimes the SAP HTTP proxy doesn't properly resolve the NOAA service. In those cases, it is more convenient to run the process from either sapsailing.com or stg.sailtracks.de, using something like following command from a server's plugins/ directory after creating the resources/ subdirectory:
|
||||
|
||||
`java -cp com.sap.sailing.domain_*.jar:com.sap.sailing.domain.common_*.jar:com.sap.sailing.declination_*.jar:com.sap.sailing.domain.shared.android_*.jar com.sap.sailing.declination.impl.DeclinationStore 2014 2014 1`
|
||||
|
||||
Run this inside a tmux window to be sure that logging off does not interrupt the process. After the process completes, copy the resulting declination-<year> file to your git workspace to `java/com.sap.sailing.declination/resources` and commit.
|
||||
|
||||
There is also a script java/target/importdeclination that automates these steps.
|
||||
Reference in New Issue
Block a user