mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-02 02:13:55 +00:00
Merge branch 'updatable-charts' into spectator
Conflicts: java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.java java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties
This commit is contained in:
commit
69f5e4e84d
11 files changed
+55
-70
No files matched your search
+1
-1
@@ -143,7 +143,7 @@ public interface SailingService extends RemoteService {
|
||||
CompetitorInRaceDTO getCompetitorRaceData(RaceIdentifier race,
|
||||
CompetitorsAndTimePointsDTO competitorsAndTimePointsDTO, DetailType dataType) throws NoWindException;
|
||||
|
||||
CompetitorsAndTimePointsDTO getCompetitorsAndTimePoints(RaceIdentifier race, int steps);
|
||||
CompetitorsAndTimePointsDTO getCompetitorsAndTimePoints(RaceIdentifier race, long stepSize);
|
||||
|
||||
Map<CompetitorDTO, List<GPSFixDTO>> getDouglasPoints(RaceIdentifier raceIdentifier,
|
||||
Map<CompetitorDTO, Date> from, Map<CompetitorDTO, Date> to, double meters) throws NoWindException;
|
||||
|
||||
+1
-1
@@ -257,7 +257,7 @@ public interface SailingServiceAsync {
|
||||
* few seconds before the race starts, up to the end of the race. The result describes the race's competitors, their
|
||||
* mark passing times, the race start time and the list of time points according to the above specification.
|
||||
*/
|
||||
void getCompetitorsAndTimePoints(RaceIdentifier race, int steps, AsyncCallback<CompetitorsAndTimePointsDTO> callback);
|
||||
void getCompetitorsAndTimePoints(RaceIdentifier race, long stepSize, AsyncCallback<CompetitorsAndTimePointsDTO> callback);
|
||||
|
||||
void getLeaderboardGroups(AsyncCallback<List<LeaderboardGroupDTO>> callback);
|
||||
|
||||
|
||||
+2
-1
@@ -208,7 +208,6 @@ public interface StringMessages extends Messages {
|
||||
String locationNotAvailable();
|
||||
String startDateNotAvailable();
|
||||
String startDate();
|
||||
String numberOfStepsToLoadMustAtLeastBeTwo();
|
||||
String unknownManeuver();
|
||||
String tailLengthMustBeNonNegative();
|
||||
String failedToLoadRaceInformation(String message);
|
||||
@@ -252,6 +251,8 @@ public interface StringMessages extends Messages {
|
||||
String noLeaderboardGroupToLoad();
|
||||
String bearing();
|
||||
String zoom();
|
||||
String stepSizeMustBeGreaterThanNull();
|
||||
String stepSizeInSeconds();
|
||||
String refreshInterval();
|
||||
String refreshIntervalMustBeGreaterThanXSeconds(String seconds);
|
||||
}
|
||||
+3
-2
@@ -203,7 +203,6 @@ onlyLiveEvents=Only live events
|
||||
locationNotAvailable=Location not available
|
||||
startDateNotAvailable=Start date not available
|
||||
startDate=Start date
|
||||
numberOfStepsToLoadMustAtLeastBeTwo=Number of steps to load must at least be two
|
||||
unknownManeuver=Unknown maneuver
|
||||
tailLengthMustBeNonNegative=Tail length must be a number greater than or equal to zero
|
||||
failedToLoadRaceInformation=Failed to load race information: {0}
|
||||
@@ -243,9 +242,11 @@ autoZoomToBoats=Boats
|
||||
autoZoomToBuoys=Buoys
|
||||
autoZoomOff=Off
|
||||
autoZoomTails=Tails
|
||||
autoZoomSelectedCompetitors=Zoom only to selected competitors
|
||||
autoZoomSelectedCompetitors=Zoom only to selected competitors
|
||||
noLeaderboardGroupToLoad=No leaderboard group name was given
|
||||
bearing=Bearing
|
||||
zoom=Zoom
|
||||
stepSizeMustBeGreaterThanNull=Step size must be greater than 0
|
||||
stepSizeInSeconds=Step size in seconds
|
||||
refreshInterval=Refresh interval
|
||||
refreshIntervalMustBeGreaterThanXSeconds=Refresh interval must be greater than {0} seconds
|
||||
+3
-2
@@ -204,7 +204,6 @@ onlyLiveEvents=Nur Live-Rennen
|
||||
locationNotAvailable=Ort nicht verfügbar
|
||||
startDateNotAvailable=Startdatum nicht verfügbar
|
||||
startDate=Startdatum
|
||||
numberOfStepsToLoadMustAtLeastBeTwo=Anzahl zu ladender Schritte muss mindestens zwei sein
|
||||
unknownManeuver=Unbekanntes Manöver
|
||||
tailLengthMustBeNonNegative=Schweiflänge muss eine positive Zahl oder 0 sein
|
||||
failedToLoadRaceInformation=Daten zur Wettfahrt konnten nicht geladen werden: {0}
|
||||
@@ -244,9 +243,11 @@ autoZoomToBoats=Booten
|
||||
autoZoomToBuoys=Tonnen
|
||||
autoZoomOff=Aus
|
||||
autoZoomTails=Schweife
|
||||
autoZoomSelectedCompetitors=Nur zu ausgewählten Seglern zoomen
|
||||
autoZoomSelectedCompetitors=Nur zu ausgewählten Seglern zoomen
|
||||
noLeaderboardGroupToLoad=Es wurde kein Ranglisten-Gruppenname übergeben
|
||||
bearing=Kurs über Grund
|
||||
zoom=Zoom
|
||||
stepSizeMustBeGreaterThanNull=Die Schrittweite muss größer als 0 sein
|
||||
stepSizeInSeconds=Schrittweite in Sekunden
|
||||
refreshInterval=Aktualisierungs-Interval
|
||||
refreshIntervalMustBeGreaterThanXSeconds=Aktualisierungs-Interval muss größer als {0} Sekunden sein
|
||||
+9
-9
@@ -92,7 +92,7 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener, TimeL
|
||||
private final Label title;
|
||||
private final DeckPanel chartAndBusyIndicatorPanel;
|
||||
private final RaceSelectionProvider raceSelectionProvider;
|
||||
private int stepsToLoad = 100;
|
||||
private long stepSize = 5000;
|
||||
private final StringMessages stringMessages;
|
||||
private final Set<Series> seriesIsUsed;
|
||||
private int width, height;
|
||||
@@ -341,11 +341,11 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener, TimeL
|
||||
+ (System.currentTimeMillis() - starttime));
|
||||
starttime = System.currentTimeMillis();
|
||||
Double[] data = chartData.getRaceData(competitor);
|
||||
long[] timepoints = getCompetitorsAndTimePointsDTO().getTimePoints();
|
||||
List<Long> timepoints = getCompetitorsAndTimePointsDTO().getTimePoints();
|
||||
List<Point> competitorPoints = new ArrayList<Point>();
|
||||
for (int j = 0; j < getStepsToLoad(); j++) {
|
||||
for (int j = 0; j < timepoints.size(); j++) {
|
||||
if (data[j] != null) {
|
||||
Point competitorPoint = new Point(timepoints[j], data[j]);
|
||||
Point competitorPoint = new Point(timepoints.get(j), data[j]);
|
||||
competitorPoints.add(competitorPoint);
|
||||
}
|
||||
}
|
||||
@@ -491,7 +491,7 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener, TimeL
|
||||
* updating all settings.
|
||||
*/
|
||||
protected void updateSettingsOnly(ChartSettings newSettings) {
|
||||
setStepsToLoad(newSettings.getStepsToLoad());
|
||||
setStepsToLoad(newSettings.getStepSize());
|
||||
setCompetitorsAndTimePointsDTO(null);
|
||||
}
|
||||
|
||||
@@ -499,12 +499,12 @@ implements CompetitorSelectionChangeListener, RaceSelectionChangeListener, TimeL
|
||||
return stringMessages;
|
||||
}
|
||||
|
||||
protected int getStepsToLoad() {
|
||||
return stepsToLoad;
|
||||
protected long getStepsToLoad() {
|
||||
return stepSize;
|
||||
}
|
||||
|
||||
protected void setStepsToLoad(int stepsToLoad) {
|
||||
this.stepsToLoad = stepsToLoad;
|
||||
protected void setStepsToLoad(long stepSize) {
|
||||
this.stepSize = stepSize;
|
||||
}
|
||||
|
||||
protected DetailType getDataToShow() {
|
||||
|
||||
Executable → Regular
+13
-16
@@ -1,8 +1,8 @@
|
||||
package com.sap.sailing.gwt.ui.leaderboard;
|
||||
|
||||
import com.google.gwt.user.client.ui.DoubleBox;
|
||||
import com.google.gwt.user.client.ui.FocusWidget;
|
||||
import com.google.gwt.user.client.ui.Label;
|
||||
import com.google.gwt.user.client.ui.LongBox;
|
||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||
import com.sap.sailing.gwt.ui.client.DataEntryDialog;
|
||||
import com.sap.sailing.gwt.ui.client.DataEntryDialog.Validator;
|
||||
@@ -11,7 +11,7 @@ import com.sap.sailing.gwt.ui.shared.components.SettingsDialogComponent;
|
||||
|
||||
public abstract class AbstractChartSettingsComponent<SettingsType extends ChartSettings> implements SettingsDialogComponent<SettingsType> {
|
||||
|
||||
private LongBox stepsBox;
|
||||
private DoubleBox stepSizeBox;
|
||||
private final ChartSettings settings;
|
||||
private final StringMessages stringMessages;
|
||||
|
||||
@@ -23,15 +23,14 @@ public abstract class AbstractChartSettingsComponent<SettingsType extends ChartS
|
||||
@Override
|
||||
public VerticalPanel getAdditionalWidget(DataEntryDialog<SettingsType> dialog) {
|
||||
VerticalPanel panel = new VerticalPanel();
|
||||
Label lblSteps = new Label(getStringMessages().pointsToLoad());
|
||||
panel.add(lblSteps);
|
||||
stepsBox = dialog.createLongBox(settings.getStepsToLoad(), 4);
|
||||
panel.add(stepsBox);
|
||||
panel.add(new Label(getStringMessages().stepSizeInSeconds()));
|
||||
stepSizeBox = dialog.createDoubleBox(((double) settings.getStepSize()) / 1000, 5);
|
||||
panel.add(stepSizeBox);
|
||||
return panel;
|
||||
}
|
||||
|
||||
protected LongBox getStepsBox() {
|
||||
return stepsBox;
|
||||
protected DoubleBox getStepSizeBox() {
|
||||
return stepSizeBox;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,8 +39,8 @@ public abstract class AbstractChartSettingsComponent<SettingsType extends ChartS
|
||||
@Override
|
||||
public String getErrorMessage(SettingsType valueToValidate) {
|
||||
String errorMessage = null;
|
||||
if (valueToValidate.getStepsToLoad() < 2) {
|
||||
errorMessage = getStringMessages().numberOfStepsToLoadMustAtLeastBeTwo();
|
||||
if (valueToValidate.getStepSize() < 1) {
|
||||
errorMessage = getStringMessages().stepSizeMustBeGreaterThanNull();
|
||||
}
|
||||
return errorMessage;
|
||||
}
|
||||
@@ -50,7 +49,7 @@ public abstract class AbstractChartSettingsComponent<SettingsType extends ChartS
|
||||
|
||||
@Override
|
||||
public FocusWidget getFocusWidget() {
|
||||
return stepsBox;
|
||||
return stepSizeBox;
|
||||
}
|
||||
|
||||
protected StringMessages getStringMessages() {
|
||||
@@ -58,11 +57,9 @@ public abstract class AbstractChartSettingsComponent<SettingsType extends ChartS
|
||||
}
|
||||
|
||||
public ChartSettings getAbstractResult() {
|
||||
Long value = getStepsBox().getValue();
|
||||
if (value == null) {
|
||||
value = -1l;
|
||||
}
|
||||
return new ChartSettings(value.intValue());
|
||||
Double valueInSeconds = getStepSizeBox().getValue();
|
||||
Long value = valueInSeconds == null ? 0 : (long) (getStepSizeBox().getValue() * 1000);
|
||||
return new ChartSettings(value);
|
||||
}
|
||||
|
||||
}
|
||||
+6
-6
@@ -1,20 +1,20 @@
|
||||
package com.sap.sailing.gwt.ui.leaderboard;
|
||||
|
||||
public class ChartSettings {
|
||||
private final int stepsToLoad;
|
||||
private final long stepSize;
|
||||
|
||||
public ChartSettings(int stepsToLoad) {
|
||||
this.stepsToLoad = stepsToLoad;
|
||||
public ChartSettings(long stepSize) {
|
||||
this.stepSize = stepSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy-constructor
|
||||
*/
|
||||
public ChartSettings(ChartSettings superResult) {
|
||||
this(superResult.getStepsToLoad());
|
||||
this(superResult.getStepSize());
|
||||
}
|
||||
|
||||
public int getStepsToLoad() {
|
||||
return stepsToLoad;
|
||||
public long getStepSize() {
|
||||
return stepSize;
|
||||
}
|
||||
}
|
||||
+2
-17
@@ -1,27 +1,12 @@
|
||||
package com.sap.sailing.gwt.ui.leaderboard;
|
||||
|
||||
import com.sap.sailing.gwt.ui.client.DataEntryDialog.Validator;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.components.SettingsDialogComponent;
|
||||
|
||||
public class ChartSettingsComponent extends AbstractChartSettingsComponent<ChartSettings> implements SettingsDialogComponent<ChartSettings> {
|
||||
public class ChartSettingsComponent extends AbstractChartSettingsComponent<ChartSettings> {
|
||||
|
||||
public ChartSettingsComponent(ChartSettings settings, StringMessages stringMessages) {
|
||||
super(settings, stringMessages);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Validator<ChartSettings> getValidator() {
|
||||
return new Validator<ChartSettings>() {
|
||||
@Override
|
||||
public String getErrorMessage(ChartSettings valueToValidate) {
|
||||
String errorMessage = null;
|
||||
if (valueToValidate.getStepsToLoad() < 2) {
|
||||
errorMessage = getStringMessages().numberOfStepsToLoadMustAtLeastBeTwo();
|
||||
}
|
||||
return errorMessage;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChartSettings getResult() {
|
||||
|
||||
+6
-6
@@ -1350,10 +1350,10 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
|
||||
}
|
||||
for (CompetitorDTO competitorDTO : competitorAndTimePointsDTO.getCompetitors()) {
|
||||
Competitor competitor = getCompetitorById(trackedRace.getRace().getCompetitors(), competitorDTO.id);
|
||||
Double[] entries = new Double[competitorAndTimePointsDTO.getTimePoints().length];
|
||||
for (int i = 0; i < competitorAndTimePointsDTO.getTimePoints().length; i++) {
|
||||
MillisecondsTimePoint time = new MillisecondsTimePoint(
|
||||
competitorAndTimePointsDTO.getTimePoints()[i]);
|
||||
List<Long> timePoints = competitorAndTimePointsDTO.getTimePoints();
|
||||
Double[] entries = new Double[timePoints.size()];
|
||||
for (int i = 0; i < timePoints.size(); i++) {
|
||||
MillisecondsTimePoint time = new MillisecondsTimePoint(timePoints.get(i));
|
||||
entries[i] = getCompetitorRaceDataEntry(dataType, trackedRace, competitor, time);
|
||||
}
|
||||
competitorData.setRaceData(competitorDTO, entries);
|
||||
@@ -1506,8 +1506,8 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public CompetitorsAndTimePointsDTO getCompetitorsAndTimePoints(RaceIdentifier race, int steps) {
|
||||
CompetitorsAndTimePointsDTO competitorAndTimePointsDTO = new CompetitorsAndTimePointsDTO(steps);
|
||||
public CompetitorsAndTimePointsDTO getCompetitorsAndTimePoints(RaceIdentifier race, long stepSize) {
|
||||
CompetitorsAndTimePointsDTO competitorAndTimePointsDTO = new CompetitorsAndTimePointsDTO(stepSize);
|
||||
TrackedRace trackedRace = getExistingTrackedRace(race);
|
||||
if (trackedRace != null) {
|
||||
List<CompetitorDTO> competitors = new ArrayList<CompetitorDTO>();
|
||||
|
||||
+9
-9
@@ -1,6 +1,8 @@
|
||||
package com.sap.sailing.gwt.ui.shared;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
import com.sap.sailing.domain.common.impl.Util.Pair;
|
||||
@@ -27,21 +29,19 @@ public class CompetitorsAndTimePointsDTO implements IsSerializable {
|
||||
private HashMap<String, Pair<String, Long>[]> markPassings;
|
||||
private long startTime;
|
||||
private long timePointOfNewestEvent;
|
||||
private int steps;
|
||||
private long stepSize;
|
||||
|
||||
CompetitorsAndTimePointsDTO() {}
|
||||
|
||||
public CompetitorsAndTimePointsDTO(int steps) {
|
||||
public CompetitorsAndTimePointsDTO(long stepSize) {
|
||||
markPassings = new HashMap<String, Pair<String, Long>[]>();
|
||||
this.steps = steps;
|
||||
this.stepSize = stepSize;
|
||||
}
|
||||
|
||||
public long[] getTimePoints() {
|
||||
long[] result = new long[steps];
|
||||
int i=0;
|
||||
long stepsize = (timePointOfNewestEvent - startTime - MILLISECONDS_BEFORE_RACE_TO_INCLUDE) / steps;
|
||||
for (long time = startTime - MILLISECONDS_BEFORE_RACE_TO_INCLUDE; i<result.length && time < timePointOfNewestEvent; time += stepsize) {
|
||||
result[i++] = time;
|
||||
public List<Long> getTimePoints() {
|
||||
ArrayList<Long> result = new ArrayList<Long>();
|
||||
for (long time = startTime - MILLISECONDS_BEFORE_RACE_TO_INCLUDE; time < timePointOfNewestEvent; time += stepSize) {
|
||||
result.add(time);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user