mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-25 05:23:51 +00:00
Merge branch 'master' into ubilabs--rcapp--bug-3010
This commit is contained in:
commit
02b729245c
24 files changed
+197
-43
No files matched your search
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# set up some constants
|
||||
## Manage2Sail
|
||||
M2SURL="http://manage2sail.com"
|
||||
M2SEVENTID="???xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx???"
|
||||
M2SACCESSTOKEN="???xyz???"
|
||||
M2SSTRING=${M2SURL}"/api/public/links/event/"${M2SEVENTID}"?accesstoken="${M2SACCESSTOKEN}"&mediaType=json"
|
||||
## Local JSON
|
||||
LOCALJSON="/tmp/???EVENT???results.json"
|
||||
LOCALJSON_OLD=$LOCALJSON.old
|
||||
## Mails (each email in new line)
|
||||
MAILINGLIST="/home/trac/mailinglists/???EVENT???updatemailinglist"
|
||||
## Eventname
|
||||
EVENTNAME="???Eventname Jahr???"
|
||||
## Misc
|
||||
DOSENDMAIL=false
|
||||
|
||||
### ROUTINE ###
|
||||
# get current json from manage2sail
|
||||
wget -O "$LOCALJSON" "$M2SSTRING" >/dev/null 2>&1
|
||||
if [ -f "$LOCALJSON_OLD" ]; then
|
||||
# results previously downloaded; now compare
|
||||
# sort by manage2sail Regattas.Id
|
||||
LOCALJSON_SORTED="${LOCALJSON}.sorted"
|
||||
LOCALJSON_OLD_SORTED="${LOCALJSON_OLD}.sorted"
|
||||
cat "$LOCALJSON" | jq -r '.Regattas|sort_by(.Name)' >"$LOCALJSON_SORTED"
|
||||
cat "$LOCALJSON_OLD" | jq -r '.Regattas|sort_by(.Name)' >"$LOCALJSON_OLD_SORTED"
|
||||
# filter only necessary values
|
||||
LOCALJSON_FORMATTED="${LOCALJSON}.formatted"
|
||||
LOCALJSON_OLD_FORMATTED="${LOCALJSON_OLD}.formatted"
|
||||
cat "$LOCALJSON_SORTED" | jq -r '.[]|{Final, LastPublishedRoundName, Published, Name, ClassName, Id}|select(.Published != null)' >"$LOCALJSON_FORMATTED"
|
||||
cat "$LOCALJSON_OLD_SORTED" | jq -r '.[]|{Final, LastPublishedRoundName, Published, Name, ClassName, Id}|select(.Published != null)' >"$LOCALJSON_OLD_FORMATTED"
|
||||
# diff sorted+formatted json
|
||||
diff -q "$LOCALJSON_OLD_FORMATTED" "$LOCALJSON_FORMATTED"
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "Found diff between $LOCALJSON_OLD_FORMATTED and $LOCALJSON_FORMATTED
|
||||
|
||||
`diff -q "$LOCALJSON_OLD_FORMATTED" "$LOCALJSON_FORMATTED"`
|
||||
|
||||
Sending mail."
|
||||
DOSENDMAIL=true
|
||||
fi
|
||||
fi
|
||||
if [ "$DOSENDMAIL" = "true" ]; then
|
||||
echo "`date` Sending mail to `cat "$MAILINGLIST"`"
|
||||
echo "$LOCALJSON has changed. Consider re-importing results for $EVENTNAME. Differences:
|
||||
|
||||
------------------
|
||||
`diff -U 6 "$LOCALJSON_OLD_FORMATTED" "$LOCALJSON_FORMATTED"`
|
||||
------------------
|
||||
|
||||
To unsubscribe, change $MAILINGLIST on `hostname`." | mail -s "SAP result import update: $EVENTNAME" `cat "$MAILINGLIST" | grep -v "^#"`
|
||||
fi
|
||||
|
||||
# move to old
|
||||
mv "$LOCALJSON" "$LOCALJSON_OLD"
|
||||
# clean up temporary files
|
||||
rm -rf "$LOCALJSON_SORTED" "$LOCALJSON_OLD_SORTED" "$LOCALJSON_FORMATTED" "$LOCALJSON_OLD_FORMATTED"
|
||||
+1
@@ -29,6 +29,7 @@ public class RibDashboardEntryPoint extends AbstractEntryPoint<StringMessages> {
|
||||
|
||||
@Override
|
||||
public void doOnModuleLoad() {
|
||||
|
||||
SailingServiceAsync sailingService = GWT.create(SailingService.class);
|
||||
EntryPointHelper.registerASyncService((ServiceDefTarget) sailingService, RemoteServiceMappingConstants.WEB_CONTEXT_PATH, RemoteServiceMappingConstants.sailingServiceRemotePath);
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-superDevMode -incremental -workDir "${project_loc:com.sap.sailing.gwt.ui}/.tmp/gwt-work" -war "${project_loc:com.sap.sailing.gwt.ui}" -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9997 -startupUrl /gwt/Home.html com.sap.sailing.gwt.home.Home -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -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/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.regattaoverview.RegattaOverview -startupUrl /gwt/DataMining.html com.sap.sailing.gwt.ui.DataMining -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.Simulator -startupUrl /gwt/VideoPopup.html com.sap.sailing.gwt.ui.VideoPopup com.sap.sailing.gwt.home.Desktop com.sap.sailing.gwt.home.Home com.sap.sailing.gwt.ui.AdminConsole com.sap.sailing.gwt.AutoPlay com.sap.sailing.gwt.ui.YoutubePopup com.sap.sailing.gwt.ui.Simulator com.sap.sailing.gwt.ui.Leaderboard com.sap.sailing.gwt.ui.PolarSheets com.sap.sailing.gwt.regattaoverview.RegattaOverview com.sap.sailing.gwt.ui.Spectator com.sap.sailing.gwt.ui.LeaderboardEditing com.sap.sailing.gwt.ui.DataMining com.sap.sailing.gwt.ui.RaceBoard com.sap.sailing.gwt.ui.EmbeddedMapAndWindChart"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-superDevMode -incremental -workDir "${project_loc:com.sap.sailing.gwt.ui}/.tmp/gwt-work" -war "${project_loc:com.sap.sailing.gwt.ui}" -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9997 -startupUrl /gwt/Home.html com.sap.sailing.gwt.home.Home -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/EmbeddedMapAndWindChart com.sap.sailing.gwt.ui.EmbeddedMapAndWindChart -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard -startupUrl /gwt/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.regattaoverview.RegattaOverview -startupUrl /gwt/DataMining.html com.sap.sailing.gwt.ui.DataMining -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.Simulator -startupUrl /gwt/VideoPopup.html com.sap.sailing.gwt.ui.VideoPopup com.sap.sailing.gwt.home.Desktop com.sap.sailing.gwt.home.Home com.sap.sailing.gwt.ui.AdminConsole com.sap.sailing.gwt.AutoPlay com.sap.sailing.gwt.ui.YoutubePopup com.sap.sailing.gwt.ui.Simulator com.sap.sailing.gwt.ui.Leaderboard com.sap.sailing.gwt.ui.PolarSheets com.sap.sailing.gwt.regattaoverview.RegattaOverview com.sap.sailing.gwt.ui.Spectator com.sap.sailing.gwt.ui.LeaderboardEditing com.sap.sailing.gwt.ui.DataMining com.sap.sailing.gwt.ui.RaceBoard com.sap.sailing.gwt.ui.EmbeddedMapAndWindChart"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.gwt.ui"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms1024m -Xmx3072m"/>
|
||||
</launchConfiguration>
|
||||
+2
-5
@@ -897,11 +897,8 @@ public class RegattaRaceStatesComponent extends SimplePanel implements Component
|
||||
return null;
|
||||
}
|
||||
private String createRegattaLink(RegattaOverviewEntryDTO entryDTO) {
|
||||
Map<String, String> leaderboardLinkParameters = new HashMap<String, String>();
|
||||
leaderboardLinkParameters.put("name", entryDTO.regattaName);
|
||||
leaderboardLinkParameters.put("showRaceDetails", String.valueOf(true));
|
||||
leaderboardLinkParameters.put("displayName", entryDTO.regattaDisplayName);
|
||||
String leaderboardLink = EntryPointLinkFactory.createLeaderboardLink(leaderboardLinkParameters);
|
||||
Map<String, String> leaderboardLinkParameters = Collections.emptyMap();
|
||||
String leaderboardLink = EntryPointLinkFactory.createLeaderboardTabLink(eventId.toString(), entryDTO.regattaName, leaderboardLinkParameters);
|
||||
return leaderboardLink;
|
||||
}
|
||||
public void setRepeatedInfoLabel(FlowPanel repeatedInfoLabel) {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
<inherits name='com.google.gwt.debug.Debug'/>
|
||||
|
||||
<!-- Highcharts API -->
|
||||
<inherits name='com.sap.sse.gwt.Highcharts_Autoinject' />
|
||||
<inherits name='com.sap.sse.gwt.Highcharts' />
|
||||
|
||||
<!-- Google Maps API -->
|
||||
<inherits name='com.google.gwt.ajaxloader.AjaxLoader' />
|
||||
|
||||
+2
@@ -33,6 +33,7 @@ import com.sap.sse.gwt.client.EntryPointHelper;
|
||||
import com.sap.sse.gwt.client.async.AsyncActionsExecutor;
|
||||
import com.sap.sse.gwt.client.async.MarkedAsyncCallback;
|
||||
import com.sap.sse.gwt.client.controls.filestorage.FileStoragePanel;
|
||||
import com.sap.sse.gwt.resources.Highcharts;
|
||||
import com.sap.sse.security.ui.client.component.UserManagementPanel;
|
||||
import com.sap.sse.security.ui.client.i18n.StringMessages;
|
||||
|
||||
@@ -45,6 +46,7 @@ public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint implements
|
||||
|
||||
@Override
|
||||
protected void doOnModuleLoad() {
|
||||
Highcharts.ensureInjectedWithMore();
|
||||
super.doOnModuleLoad();
|
||||
EntryPointHelper.registerASyncService((ServiceDefTarget) mediaService, RemoteServiceMappingConstants.mediaServiceRemotePath);
|
||||
createUI();
|
||||
|
||||
+8
-3
@@ -1,6 +1,7 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
@@ -9,7 +10,7 @@ import com.sap.sse.gwt.client.media.VideoDTO;
|
||||
|
||||
public class VideoCreateDialog extends VideoDialog {
|
||||
|
||||
public VideoCreateDialog(StringMessages stringMessages, DialogCallback<VideoDTO> callback) {
|
||||
public VideoCreateDialog(String initialTag, StringMessages stringMessages, DialogCallback<VideoDTO> callback) {
|
||||
super(new VideoParameterValidator(stringMessages), stringMessages, callback);
|
||||
createdAtLabel = new Label(creationDate.toString());
|
||||
titleTextBox = createTextBox(null);
|
||||
@@ -19,7 +20,11 @@ public class VideoCreateDialog extends VideoDialog {
|
||||
copyrightTextBox = createTextBox(null);
|
||||
copyrightTextBox.setVisibleLength(50);
|
||||
lengthIntegerBox = createIntegerBox(null, 10);
|
||||
tagsListEditor.setValue(Collections.<String>emptyList());
|
||||
List<String> tags = new ArrayList<>();
|
||||
if(initialTag != null && !initialTag.isEmpty()) {
|
||||
tags.add(initialTag);
|
||||
}
|
||||
tagsListEditor.setValue(tags);
|
||||
setSelectedMimeType(MimeType.unknown);
|
||||
}
|
||||
}
|
||||
+23
-4
@@ -28,6 +28,7 @@ import com.google.gwt.view.client.SingleSelectionModel;
|
||||
import com.sap.sailing.domain.common.impl.NaturalComparator;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.common.client.DateAndTimeFormatterUtil;
|
||||
import com.sap.sse.common.media.MediaTagConstants;
|
||||
import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback;
|
||||
import com.sap.sse.gwt.client.media.VideoDTO;
|
||||
|
||||
@@ -74,15 +75,33 @@ public class VideosListComposite extends Composite {
|
||||
videosControlsPanel.setSpacing(5);
|
||||
panel.add(videosControlsPanel);
|
||||
|
||||
Button createVideoBtn = new Button("Add video");
|
||||
Button createVideoBtn = new Button("Add gallery video");
|
||||
createVideoBtn.addClickHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
openCreateVideoDialog();
|
||||
openCreateVideoDialog(MediaTagConstants.GALLERY);
|
||||
}
|
||||
});
|
||||
videosControlsPanel.add(createVideoBtn);
|
||||
|
||||
Button addLiveStreamBtn = new Button("Add livestream video");
|
||||
addLiveStreamBtn.addClickHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
openCreateVideoDialog(MediaTagConstants.LIVESTREAM);
|
||||
}
|
||||
});
|
||||
videosControlsPanel.add(addLiveStreamBtn);
|
||||
|
||||
Button addHighlightBtn = new Button("Add highlight video");
|
||||
addHighlightBtn.addClickHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
openCreateVideoDialog(MediaTagConstants.HIGHLIGHT);
|
||||
}
|
||||
});
|
||||
videosControlsPanel.add(addHighlightBtn);
|
||||
|
||||
videoSelectionModel = new SingleSelectionModel<VideoDTO>();
|
||||
videoListDataProvider = new ListDataProvider<VideoDTO>();
|
||||
videoTable = createVideosTable();
|
||||
@@ -231,8 +250,8 @@ public class VideosListComposite extends Composite {
|
||||
return result;
|
||||
}
|
||||
|
||||
private void openCreateVideoDialog() {
|
||||
VideoCreateDialog dialog = new VideoCreateDialog(stringMessages, new DialogCallback<VideoDTO>() {
|
||||
private void openCreateVideoDialog(String initialTag) {
|
||||
VideoCreateDialog dialog = new VideoCreateDialog(initialTag, stringMessages, new DialogCallback<VideoDTO>() {
|
||||
@Override
|
||||
public void cancel() {
|
||||
}
|
||||
|
||||
+4
@@ -17,6 +17,10 @@ public class EntryPointLinkFactory extends AbstractEntryPointLinkFactory {
|
||||
return createEntryPointLink("/gwt/Leaderboard.html", parameters);
|
||||
}
|
||||
|
||||
public static String createLeaderboardTabLink(String eventId, String regattaId, Map<String, String> parameters) {
|
||||
return createEntryPointLink("/gwt/Home.html#/regatta/leaderboard/:eventId=" + eventId + "®attaId=" + regattaId, parameters);
|
||||
}
|
||||
|
||||
public static String createLeaderboardGroupLink(Map<String, String> parameters) {
|
||||
return createEntryPointLink("/gwt/Spectator.html", parameters);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1254,7 +1254,7 @@ sampleURL=Sample URL: {0}
|
||||
sapSportsOn=SAP Sports on
|
||||
followSapSports=Follow SAP Sports
|
||||
liveNow=Live now
|
||||
analyseRace=Analyse race
|
||||
analyseRace=Analyze race
|
||||
nextRaceStartingIn=Next race starts in
|
||||
startingIn={0} starts in
|
||||
raceIsPlanned=Planned
|
||||
|
||||
+1
-1
@@ -1244,7 +1244,7 @@ sampleURL=Sample URL: {0}
|
||||
sapSportsOn=SAP Sports on
|
||||
followSapSports=Follow SAP Sports
|
||||
liveNow=Live now
|
||||
analyseRace=Analyse race
|
||||
analyseRace=Analyze race
|
||||
nextRaceStartingIn=Next race starts in
|
||||
startingIn={0} starts in
|
||||
raceIsPlanned=Planned
|
||||
|
||||
+5
-3
@@ -1,10 +1,11 @@
|
||||
package com.sap.sailing.gwt.ui.client.shared.racemap;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.sap.sse.common.Util;
|
||||
|
||||
public class RaceMapHelpLinesSettings {
|
||||
|
||||
/**
|
||||
@@ -28,8 +29,9 @@ public class RaceMapHelpLinesSettings {
|
||||
visibleHelpLines.add(HelpLineTypes.BOATTAILS);
|
||||
}
|
||||
|
||||
public RaceMapHelpLinesSettings(Collection<HelpLineTypes> visibleHelpLines) {
|
||||
this.visibleHelpLines = new HashSet<HelpLineTypes>(visibleHelpLines);
|
||||
public RaceMapHelpLinesSettings(Iterable<HelpLineTypes> visibleHelpLines) {
|
||||
this.visibleHelpLines = new HashSet<>();
|
||||
Util.addAll(visibleHelpLines, this.visibleHelpLines);
|
||||
}
|
||||
|
||||
public boolean isVisible(HelpLineTypes helpLineType) {
|
||||
|
||||
+17
@@ -47,6 +47,23 @@ public class RaceMapSettings extends AbstractSettings {
|
||||
this.helpLinesSettings = new RaceMapHelpLinesSettings();
|
||||
}
|
||||
|
||||
/**
|
||||
* "Copy constructor" that produces a new settings object that equals the one passed as argument
|
||||
*/
|
||||
public RaceMapSettings(RaceMapSettings settings) {
|
||||
this.buoyZoneRadiusInMeters = settings.buoyZoneRadiusInMeters;
|
||||
this.helpLinesSettings = new RaceMapHelpLinesSettings(settings.getHelpLinesSettings().getVisibleHelpLineTypes());
|
||||
this.maneuverTypesToShow = settings.maneuverTypesToShow;
|
||||
this.showDouglasPeuckerPoints = settings.showDouglasPeuckerPoints;
|
||||
this.showOnlySelectedCompetitors = settings.showOnlySelectedCompetitors;
|
||||
this.showSelectedCompetitorsInfo = settings.showSelectedCompetitorsInfo;
|
||||
this.showSimulationOverlay = settings.showSimulationOverlay;
|
||||
this.showWindStreamletOverlay = settings.showWindStreamletOverlay;
|
||||
this.tailLengthInMilliseconds = settings.tailLengthInMilliseconds;
|
||||
this.windUp = settings.windUp;
|
||||
this.zoomSettings = new RaceMapZoomSettings(settings.zoomSettings.getTypesToConsiderOnZoom(), settings.zoomSettings.isZoomToSelectedCompetitors());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 0 if the tails are not visible {@link #getTailLengthInMilliseconds()} otherwise
|
||||
*/
|
||||
|
||||
+2
@@ -27,6 +27,7 @@ import com.sap.sse.datamining.shared.impl.UUIDDataMiningSession;
|
||||
import com.sap.sse.gwt.client.EntryPointHelper;
|
||||
import com.sap.sse.gwt.client.shared.components.ComponentResources;
|
||||
import com.sap.sse.gwt.client.shared.components.SettingsDialog;
|
||||
import com.sap.sse.gwt.resources.Highcharts;
|
||||
import com.sap.sse.gwt.shared.GwtHttpRequestUtils;
|
||||
|
||||
public class DataMiningEntryPoint extends AbstractSailingEntryPoint {
|
||||
@@ -38,6 +39,7 @@ public class DataMiningEntryPoint extends AbstractSailingEntryPoint {
|
||||
|
||||
@Override
|
||||
protected void doOnModuleLoad() {
|
||||
Highcharts.ensureInjectedWithMore();
|
||||
super.doOnModuleLoad();
|
||||
session = new UUIDDataMiningSession(UUID.randomUUID());
|
||||
|
||||
|
||||
+2
@@ -10,6 +10,7 @@ import com.sap.sailing.gwt.ui.client.AbstractSailingEntryPoint;
|
||||
import com.sap.sailing.gwt.ui.client.RegattaRefresher;
|
||||
import com.sap.sailing.gwt.ui.client.RegattasDisplayer;
|
||||
import com.sap.sailing.gwt.ui.shared.RegattaDTO;
|
||||
import com.sap.sse.gwt.resources.Highcharts;
|
||||
|
||||
public class PolarSheetsEntryPoint extends AbstractSailingEntryPoint implements RegattaRefresher {
|
||||
|
||||
@@ -17,6 +18,7 @@ public class PolarSheetsEntryPoint extends AbstractSailingEntryPoint implements
|
||||
|
||||
@Override
|
||||
protected void doOnModuleLoad() {
|
||||
Highcharts.ensureInjectedWithMore();
|
||||
super.doOnModuleLoad();
|
||||
|
||||
regattaDisplayers = new HashSet<RegattasDisplayer>();
|
||||
|
||||
+2
-2
@@ -66,7 +66,6 @@ public class EmbeddedMapAndWindChartEntryPoint extends AbstractSailingEntryPoint
|
||||
|
||||
@Override
|
||||
protected void doOnModuleLoad() {
|
||||
GWT.debugger(); // TODO remove again
|
||||
super.doOnModuleLoad();
|
||||
// read mandatory parameters
|
||||
regattaLikeName = Window.Location.getParameter(PARAM_REGATTA_LIKE_NAME);
|
||||
@@ -168,12 +167,13 @@ public class EmbeddedMapAndWindChartEntryPoint extends AbstractSailingEntryPoint
|
||||
map.setControls(ControlPosition.RIGHT_BOTTOM, backToLivePlayButton);
|
||||
}
|
||||
};
|
||||
final RaceMapSettings mapSettings = raceMap.getSettings();
|
||||
final RaceMapSettings mapSettings = new RaceMapSettings(raceMap.getSettings());
|
||||
mapSettings.setZoomSettings(new RaceMapZoomSettings(Arrays.asList(ZoomTypes.BUOYS), /* zoom to selection */ false));
|
||||
Set<HelpLineTypes> helpLineTypes = new HashSet<>();
|
||||
Util.addAll(mapSettings.getHelpLinesSettings().getVisibleHelpLineTypes(), helpLineTypes);
|
||||
helpLineTypes.add(HelpLineTypes.COURSEGEOMETRY);
|
||||
mapSettings.setHelpLinesSettings(new RaceMapHelpLinesSettings(helpLineTypes));
|
||||
mapSettings.setWindUp(true);
|
||||
raceMap.updateSettings(mapSettings);
|
||||
raceMap.onRaceSelectionChange(raceList);
|
||||
final WindChart windChart;
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
@GwtIncompatible
|
||||
public class RaceContext {
|
||||
private static final long TIME_BEFORE_START_TO_SHOW_RACES_AS_LIVE = 15 * 60 * 1000; // 15 min
|
||||
private static final long TIME_BEFORE_START_TO_SHOW_RACES_AS_LIVE = 60 * 60 * 1000; // 1 hour
|
||||
private static final long TIME_TO_SHOW_CANCELED_RACES_AS_LIVE = 5 * 60 * 1000; // 5 min
|
||||
|
||||
private final TimePoint now = MillisecondsTimePoint.now();
|
||||
|
||||
+2
@@ -16,6 +16,7 @@ import com.sap.sailing.gwt.ui.client.SimulatorService;
|
||||
import com.sap.sailing.gwt.ui.client.SimulatorServiceAsync;
|
||||
import com.sap.sailing.simulator.util.SailingSimulatorConstants;
|
||||
import com.sap.sse.gwt.client.EntryPointHelper;
|
||||
import com.sap.sse.gwt.resources.Highcharts;
|
||||
|
||||
public class SimulatorEntryPoint extends AbstractSailingEntryPoint {
|
||||
|
||||
@@ -45,6 +46,7 @@ public class SimulatorEntryPoint extends AbstractSailingEntryPoint {
|
||||
|
||||
@Override
|
||||
protected void doOnModuleLoad() {
|
||||
Highcharts.ensureInjectedWithExport();
|
||||
super.doOnModuleLoad();
|
||||
EntryPointHelper.registerASyncService((ServiceDefTarget) simulatorService, RemoteServiceMappingConstants.simulatorServiceRemotePath);
|
||||
checkUrlParameters();
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<inherits name='com.sap.sailing.gwt.ui.CommonConfigs'/>
|
||||
|
||||
<!-- Highcharts API -->
|
||||
<inherits name="com.sap.sse.gwt.Highcharts_Autoinject"/>
|
||||
<inherits name="com.sap.sse.gwt.Highcharts"/>
|
||||
|
||||
|
||||
<!-- Google Maps API -->
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
<!-- Highcharts API -->
|
||||
<inherits name="com.sap.sse.gwt.Highcharts_Autoinject" />
|
||||
<inherits name="com.sap.sse.gwt.Highcharts" />
|
||||
|
||||
<!-- Google Maps API -->
|
||||
<inherits name='com.google.gwt.ajaxloader.AjaxLoader' />
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
<inherits name="com.sap.sailing.simulator.Simulator" />
|
||||
|
||||
<!-- Highcharts API -->
|
||||
<inherits name="com.sap.sse.gwt.Highcharts_Autoinject" />
|
||||
<inherits name="com.sap.sse.gwt.Highcharts" />
|
||||
|
||||
<!-- Google Maps API -->
|
||||
<inherits name='com.google.gwt.ajaxloader.AjaxLoader' />
|
||||
|
||||
@@ -77,12 +77,16 @@ public class LeaderboardData extends ExportAction {
|
||||
private static final String STRONG_WIND_DESCRIPTION = "Strong";
|
||||
private static final String VERY_STRONG_WIND_DESCRIPTION = "Very Strong";
|
||||
|
||||
private final Map<RaceColumn, List<Competitor>> raceColumnToCompetitors;
|
||||
|
||||
public LeaderboardData(HttpServletRequest req, HttpServletResponse res, RacingEventService service) {
|
||||
super(req, res, service);
|
||||
this.raceColumnToCompetitors = new HashMap<>();
|
||||
}
|
||||
|
||||
public LeaderboardData(Leaderboard leaderboard) {
|
||||
super(leaderboard);
|
||||
this.raceColumnToCompetitors = new HashMap<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,24 +222,36 @@ public class LeaderboardData extends ExportAction {
|
||||
addNamedElementWithValue(raceElement, "same_day_index", sameDayGroupIndex);
|
||||
addNamedElementWithValue(raceElement, "is_live", "false");
|
||||
TimePoint timepointToBeUsed = MillisecondsTimePoint.now();
|
||||
List<Competitor> competitorsForColumn = this.raceColumnToCompetitors.get(column);
|
||||
if (competitorsForColumn == null) {
|
||||
competitorsForColumn = new ArrayList<>();
|
||||
}
|
||||
List<Competitor> competitors = leaderboard.getCompetitorsFromBestToWorst(column, timepointToBeUsed);
|
||||
for (Competitor competitorInLeaderboard : competitors) {
|
||||
MaxPointsReason mpr = leaderboard.getScoreCorrection().getMaxPointsReason(competitorInLeaderboard, column, timepointToBeUsed);
|
||||
if (mpr != null && !mpr.equals(MaxPointsReason.NONE)) {
|
||||
// add this competitor to the list to have him evaluated
|
||||
Element competitorElement = createCompetitorXML(competitorInLeaderboard, leaderboard, /*shortVersion*/ true, null);
|
||||
Element competitorRaceDataElement = new Element("competitor_race_data");
|
||||
MaxPointsReason maxPointsReason = leaderboard.getMaxPointsReason(competitorInLeaderboard, column, timepointToBeUsed);
|
||||
addNamedElementWithValue(competitorRaceDataElement, "max_points_reason", maxPointsReason.toString());
|
||||
boolean isDiscardedForCompetitor = leaderboard.isDiscarded(competitorInLeaderboard, column, timepointToBeUsed);
|
||||
addNamedElementWithValue(competitorRaceDataElement, "is_discarded", isDiscardedForCompetitor == true ? "true" : "false");
|
||||
Double finalRaceScore = leaderboard.getTotalPoints(competitorInLeaderboard, column, timepointToBeUsed);
|
||||
addNamedElementWithValue(competitorRaceDataElement, "final_race_score", finalRaceScore);
|
||||
competitorElement.addContent(competitorRaceDataElement);
|
||||
raceElement.addContent(competitorElement);
|
||||
raceConfidenceAndErrorMessages = updateConfidence("Competitor " + competitorInLeaderboard.getName() + " has no valid data for this race!", 0.2, raceConfidenceAndErrorMessages);
|
||||
// we must keep track of competitors that we are associated to fleets
|
||||
// in order to not export the score correction twice. This is needed
|
||||
// because the score correction does not know about fleets and we do not
|
||||
// know to which fleet the competitor belongs because no races are linked
|
||||
if (!competitorsForColumn.contains(competitorInLeaderboard)) {
|
||||
MaxPointsReason mpr = leaderboard.getScoreCorrection().getMaxPointsReason(competitorInLeaderboard, column, timepointToBeUsed);
|
||||
if (mpr != null && !mpr.equals(MaxPointsReason.NONE)) {
|
||||
// add this competitor to the list to have him evaluated
|
||||
Element competitorElement = createCompetitorXML(competitorInLeaderboard, leaderboard, /*shortVersion*/ true, null);
|
||||
Element competitorRaceDataElement = new Element("competitor_race_data");
|
||||
MaxPointsReason maxPointsReason = leaderboard.getMaxPointsReason(competitorInLeaderboard, column, timepointToBeUsed);
|
||||
addNamedElementWithValue(competitorRaceDataElement, "max_points_reason", maxPointsReason.toString());
|
||||
boolean isDiscardedForCompetitor = leaderboard.isDiscarded(competitorInLeaderboard, column, timepointToBeUsed);
|
||||
addNamedElementWithValue(competitorRaceDataElement, "is_discarded", isDiscardedForCompetitor == true ? "true" : "false");
|
||||
Double finalRaceScore = leaderboard.getTotalPoints(competitorInLeaderboard, column, timepointToBeUsed);
|
||||
addNamedElementWithValue(competitorRaceDataElement, "final_race_score", finalRaceScore);
|
||||
competitorElement.addContent(competitorRaceDataElement);
|
||||
raceElement.addContent(competitorElement);
|
||||
raceConfidenceAndErrorMessages = updateConfidence("Competitor " + competitorInLeaderboard.getName() + " has no valid data for this race!", 0.2, raceConfidenceAndErrorMessages);
|
||||
competitorsForColumn.add(competitorInLeaderboard);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.raceColumnToCompetitors.put(column, competitorsForColumn);
|
||||
return raceElement;
|
||||
}
|
||||
|
||||
@@ -332,6 +348,10 @@ public class LeaderboardData extends ExportAction {
|
||||
competitorToDistanceRank.put(competitorSorted, raceRankSorted);
|
||||
}
|
||||
|
||||
List<Competitor> competitorsForColumn = this.raceColumnToCompetitors.get(column);
|
||||
if (competitorsForColumn == null) {
|
||||
competitorsForColumn = new ArrayList<>();
|
||||
}
|
||||
// it can happen that there are competitors that did not race but got points
|
||||
int additionalCompetitorCount = 0;
|
||||
for (Competitor competitorInLeaderboard : leaderboard.getAllCompetitors()) {
|
||||
@@ -340,7 +360,7 @@ public class LeaderboardData extends ExportAction {
|
||||
// check if he has an overwritten score for that race
|
||||
MaxPointsReason mpr = leaderboard.getScoreCorrection().getMaxPointsReason(competitorInLeaderboard, column, race.getEndOfRace());
|
||||
Fleet fleetCompetitorIsSailingIn = column.getFleetOfCompetitor(competitorInLeaderboard);
|
||||
if (fleetCompetitorIsSailingIn != null && fleetCompetitorIsSailingIn.equals(fleet)) {
|
||||
if (fleetCompetitorIsSailingIn != null && fleetCompetitorIsSailingIn.equals(fleet) && !competitorsForColumn.contains(competitorInLeaderboard)) {
|
||||
if (mpr != null && !mpr.equals(MaxPointsReason.NONE)) {
|
||||
// add this competitor to the list to have him evaluated
|
||||
Element competitorElement = createCompetitorXML(competitorInLeaderboard, leaderboard, /*shortVersion*/ true, null);
|
||||
@@ -355,6 +375,7 @@ public class LeaderboardData extends ExportAction {
|
||||
raceElement.addContent(competitorElement);
|
||||
raceConfidenceAndErrorMessages = updateConfidence("Competitor " + competitorInLeaderboard.getName() + " has no valid data for this race!", 0.2, raceConfidenceAndErrorMessages);
|
||||
additionalCompetitorCount++;
|
||||
competitorsForColumn.add(competitorInLeaderboard);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -366,6 +387,9 @@ public class LeaderboardData extends ExportAction {
|
||||
Element competitorElement = createCompetitorXML(competitor, leaderboard, /*shortVersion*/ true, null);
|
||||
Element competitorRaceDataElement = new Element("competitor_race_data");
|
||||
MaxPointsReason maxPointsReason = leaderboard.getMaxPointsReason(competitor, column, race.getEndOfRace());
|
||||
if (maxPointsReason != null && !maxPointsReason.equals(MaxPointsReason.NONE)) {
|
||||
competitorsForColumn.add(competitor);
|
||||
}
|
||||
addNamedElementWithValue(competitorRaceDataElement, "max_points_reason", maxPointsReason.toString());
|
||||
boolean isDiscardedForCompetitor = leaderboard.isDiscarded(competitor, column, race.getEndOfRace());
|
||||
addNamedElementWithValue(competitorRaceDataElement, "is_discarded", isDiscardedForCompetitor == true ? "true" : "false");
|
||||
@@ -550,6 +574,7 @@ public class LeaderboardData extends ExportAction {
|
||||
raceElement.addContent(competitorElement);
|
||||
}
|
||||
|
||||
this.raceColumnToCompetitors.put(column, competitorsForColumn);
|
||||
raceElement.addContent(createDataConfidenceXML(raceConfidenceAndErrorMessages));
|
||||
raceElement.addContent(legs);
|
||||
return raceElement;
|
||||
|
||||
@@ -13,9 +13,22 @@ public class Highcharts {
|
||||
public static LegacyResources LEGACY = GWT.create(LegacyResources.class);
|
||||
public static void ensureInjected() {
|
||||
ScriptInjector.fromString(LEGACY.highcharts().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
|
||||
ScriptInjector.fromString(LEGACY.highchartsMore().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
|
||||
ScriptInjector.fromString(LEGACY.highchartsThemeGrid().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
|
||||
}
|
||||
|
||||
public static void ensureInjectedWithMore() {
|
||||
ensureInjected();
|
||||
ScriptInjector.fromString(LEGACY.highchartsMore().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
|
||||
ScriptInjector.fromString(LEGACY.highchartsModuleExport().getText()).setWindow(ScriptInjector.TOP_WINDOW)
|
||||
.inject();
|
||||
}
|
||||
|
||||
public static void ensureInjectedWithExport() {
|
||||
ensureInjected();
|
||||
ensureInjectedWithMore();
|
||||
ScriptInjector.fromString(LEGACY.highchartsMore().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
|
||||
ScriptInjector.fromString(LEGACY.highchartsModuleExport().getText()).setWindow(ScriptInjector.TOP_WINDOW)
|
||||
.inject();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -81,6 +81,8 @@ public class Activator implements BundleActivator {
|
||||
public static final String PROPERTY_NAME_REPLICATE_MASTER_EXCHANGE_NAME = "replicate.master.exchange.name";
|
||||
|
||||
private ReplicationInstancesManager replicationInstancesManager;
|
||||
|
||||
private ReplicationServiceImpl serverReplicationMasterService;
|
||||
|
||||
private static BundleContext defaultContext;
|
||||
|
||||
@@ -118,7 +120,7 @@ public class Activator implements BundleActivator {
|
||||
}
|
||||
replicationInstancesManager = new ReplicationInstancesManager();
|
||||
final OSGiReplicableTracker replicablesProvider = new OSGiReplicableTracker(bundleContext);
|
||||
ReplicationService serverReplicationMasterService = new ReplicationServiceImpl(
|
||||
serverReplicationMasterService = new ReplicationServiceImpl(
|
||||
exchangeName, exchangeHost, exchangePort, replicationInstancesManager, replicablesProvider);
|
||||
bundleContext.registerService(ReplicationService.class, serverReplicationMasterService, null);
|
||||
logger.info("Registered replication service "+serverReplicationMasterService+" using exchange name "+exchangeName+" on host "+exchangeHost);
|
||||
@@ -154,7 +156,6 @@ public class Activator implements BundleActivator {
|
||||
System.getProperty(PROPERTY_NAME_REPLICATE_MASTER_SERVLET_HOST),
|
||||
Integer.valueOf(System.getProperty(PROPERTY_NAME_REPLICATE_MASTER_SERVLET_PORT).trim()));
|
||||
try {
|
||||
// TODO pass on the replicables to wait for; failure to do so can cause the symptoms of bug 3015
|
||||
serverReplicationMasterService.startToReplicateFrom(master, replicables);
|
||||
logger.info("Automatic replication has been started.");
|
||||
} catch (ClassNotFoundException | IOException | InterruptedException e) {
|
||||
@@ -166,6 +167,9 @@ public class Activator implements BundleActivator {
|
||||
}
|
||||
|
||||
public void stop(BundleContext bundleContext) throws Exception {
|
||||
if (serverReplicationMasterService.getReplicatingFromMaster() != null) {
|
||||
serverReplicationMasterService.stopToReplicateFromMaster();
|
||||
}
|
||||
}
|
||||
|
||||
public static BundleContext getDefaultContext() {
|
||||
|
||||
Reference in new issue
Block a user