mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-16 10:48:47 +00:00
bug6150: static solution with iterations on each step
This commit is contained in:
+7
@@ -328,6 +328,7 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages,
|
||||
String clickChartToSetTime();
|
||||
String position();
|
||||
String windSourcesUsed();
|
||||
String windStatisticsLines();
|
||||
String errorTryingToUpdateWindSourcesToExclude(String raceName, String message);
|
||||
String feedback();
|
||||
String startStopPlaying();
|
||||
@@ -350,6 +351,9 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages,
|
||||
String courseMiddleLine();
|
||||
String showWindSpeedSeries();
|
||||
String showWindDirectionSeries();
|
||||
String showWindAverageLine();
|
||||
String showWindMinLine();
|
||||
String showWindMaxLine();
|
||||
String fleet();
|
||||
String boat();
|
||||
String boatClass();
|
||||
@@ -908,6 +912,9 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages,
|
||||
String windImport_ResultEntry(String raceName, String regattaName, int windFixesCount, String firstWindDate, String lastWindDate);
|
||||
String showWindSpeedSeriesTooltip();
|
||||
String showWindDirectionSeriesTooltip();
|
||||
String showWindAverageLineTooltip();
|
||||
String showWindMinLineTooltip();
|
||||
String showWindMaxLineTooltip();
|
||||
String combinedWindSourceTypeTooltip();
|
||||
String legMiddleWindSourceTypeTooltip();
|
||||
String courseBasedWindSourceTypeTooltip();
|
||||
|
||||
+7
@@ -358,6 +358,7 @@ raceCommitteeWindSourceTypeName=Race Committee
|
||||
clickChartToSetTime=Click on the chart to set the time
|
||||
position=Position
|
||||
windSourcesUsed=Wind Sources Used
|
||||
windStatisticsLines=Statistics Lines
|
||||
errorTryingToUpdateWindSourcesToExclude=Error trying to update wind sources to exclude for race {0}: {1}
|
||||
feedback=Feedback
|
||||
startStopPlaying=Start/Stop playing
|
||||
@@ -386,6 +387,9 @@ advantageLine=Advantage line
|
||||
courseMiddleLine=Course middle line
|
||||
showWindSpeedSeries=Show wind speed data
|
||||
showWindDirectionSeries=Show wind directions data
|
||||
showWindAverageLine=Show average line
|
||||
showWindMinLine=Show minimum line
|
||||
showWindMaxLine=Show maximum line
|
||||
fleet=Fleet
|
||||
boatClass=Boat Class
|
||||
setDelayToLive=Set delay to live
|
||||
@@ -919,6 +923,9 @@ routeconverterWindImport_Title=Import wind from Routerconverter / Sailing Analyt
|
||||
bravoWindImport_Title=Import wind from Bravo files
|
||||
showWindSpeedSeriesTooltip=Toggles the visibility of the wind speed for all data sources
|
||||
showWindDirectionSeriesTooltip=Toggles the visibility of the wind direction for all data sources
|
||||
showWindAverageLineTooltip=Toggles the visibility of the average wind direction and speed lines
|
||||
showWindMinLineTooltip=Toggles the visibility of the minimum wind direction and speed lines
|
||||
showWindMaxLineTooltip=Toggles the visibility of the maximum wind direction and speed lines
|
||||
combinedWindSourceTypeTooltip=Combines all other wind sources to one data set
|
||||
legMiddleWindSourceTypeTooltip=Combined wind at the mid point of a leg''s rhumb line
|
||||
courseBasedWindSourceTypeTooltip=A value based on the course layout (under the assumption, that the race starts with an upwind leg)
|
||||
|
||||
+7
@@ -356,6 +356,7 @@ raceCommitteeWindSourceTypeName=Wettfahrtleitung
|
||||
clickChartToSetTime=Klicke auf das Diagramm um die Zeit zu setzen
|
||||
position=Position
|
||||
windSourcesUsed=Benutzte Windquellen
|
||||
windStatisticsLines=Statistiklinien
|
||||
errorTryingToUpdateWindSourcesToExclude=Fehler beim Aktualisieren der auszuschließenden Windquellen für Rennen {0}: {1}
|
||||
feedback=Feedback
|
||||
startStopPlaying=Starten/Stoppen des abspielens
|
||||
@@ -384,6 +385,9 @@ advantageLine=Führungslinie
|
||||
courseMiddleLine=Kursmittellinie
|
||||
showWindSpeedSeries=Daten für Windgeschwindigkeit zeigen
|
||||
showWindDirectionSeries=Daten für Windrichtung zeigen
|
||||
showWindAverageLine=Durchschnittslinie zeigen
|
||||
showWindMinLine=Minimumlinie zeigen
|
||||
showWindMaxLine=Maximumlinie zeigen
|
||||
fleet=Flotte
|
||||
boatClass=Bootsklasse
|
||||
setDelayToLive=Verzögerung zu ''Live'' setzen
|
||||
@@ -904,6 +908,9 @@ routeconverterWindImport_Title=Wind aus Routerconverter / Sailing Analytics Expo
|
||||
bravoWindImport_Title=Wind aus Bravo-Dateien importieren
|
||||
showWindSpeedSeriesTooltip=Setzt die Sichtbarkeit der Windgeschwindigkeit aller Datenquellen
|
||||
showWindDirectionSeriesTooltip=Setzt die Sichtbarkeit der Windrichtung aller Datenquellen
|
||||
showWindAverageLineTooltip=Setzt die Sichtbarkeit der Durchschnittslinien für Windrichtung und Windgeschwindigkeit
|
||||
showWindMinLineTooltip=Setzt die Sichtbarkeit der Minimumlinien für Windrichtung und Windgeschwindigkeit
|
||||
showWindMaxLineTooltip=Setzt die Sichtbarkeit der Maximumlinien für Windrichtung und Windgeschwindigkeit
|
||||
combinedWindSourceTypeTooltip=Kombiniert alle Datenquellen zu einem Datensatz
|
||||
courseBasedWindSourceTypeTooltip=Ein Datenwert basierend auf dem Kurslayout (unter der Annahme, dass das Rennen gegen den Wind startet)
|
||||
trackBasedEstimationWindSourceTypeTooltip=Berechnet die Daten aus dem gefahrenen Kurs der Teilnehmer
|
||||
|
||||
+109
-1
@@ -79,6 +79,12 @@ public class WindChart extends AbstractRaceChart<WindChartSettings> implements R
|
||||
private final Map<WindSource, Point[]> windSourceDirectionPoints;
|
||||
private final Map<WindSource, Point[]> windSourceSpeedPoints;
|
||||
private Point firstPointOfFirstSeries;
|
||||
private PlotLine directionAveragePlotLine;
|
||||
private PlotLine directionMinPlotLine;
|
||||
private PlotLine directionMaxPlotLine;
|
||||
private PlotLine speedAveragePlotLine;
|
||||
private PlotLine speedMinPlotLine;
|
||||
private PlotLine speedMaxPlotLine;
|
||||
|
||||
private Long timeOfEarliestRequestInMillis;
|
||||
private Long timeOfLatestRequestInMillis;
|
||||
@@ -181,6 +187,12 @@ public class WindChart extends AbstractRaceChart<WindChartSettings> implements R
|
||||
}
|
||||
}));
|
||||
timePlotLine = chart.getXAxis().createPlotLine().setColor("#656565").setWidth(1.5).setDashStyle(DashStyle.SOLID);
|
||||
directionAveragePlotLine = chart.getYAxis(0).createPlotLine().setColor("#2060C0").setWidth(1.5).setDashStyle(DashStyle.SHORT_DASH);
|
||||
directionMinPlotLine = chart.getYAxis(0).createPlotLine().setColor("#20A020").setWidth(1.5).setDashStyle(DashStyle.SHORT_DASH);
|
||||
directionMaxPlotLine = chart.getYAxis(0).createPlotLine().setColor("#C02020").setWidth(1.5).setDashStyle(DashStyle.SHORT_DASH);
|
||||
speedAveragePlotLine = chart.getYAxis(1).createPlotLine().setColor("#2060C0").setWidth(1.5).setDashStyle(DashStyle.SHORT_DASH);
|
||||
speedMinPlotLine = chart.getYAxis(1).createPlotLine().setColor("#20A020").setWidth(1.5).setDashStyle(DashStyle.SHORT_DASH);
|
||||
speedMaxPlotLine = chart.getYAxis(1).createPlotLine().setColor("#C02020").setWidth(1.5).setDashStyle(DashStyle.SHORT_DASH);
|
||||
|
||||
chart.getYAxis(0).setAxisTitleText(stringMessages.fromDeg()).setStartOnTick(false)
|
||||
.setLabels(new YAxisLabels().setFormatter(new AxisLabelsFormatter() {
|
||||
@@ -444,6 +456,7 @@ public class WindChart extends AbstractRaceChart<WindChartSettings> implements R
|
||||
|
||||
timeOfEarliestRequestInMillis = newMinTimepoint;
|
||||
timeOfLatestRequestInMillis = newMaxTimepoint;
|
||||
updateStatPlotLines();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -477,9 +490,18 @@ public class WindChart extends AbstractRaceChart<WindChartSettings> implements R
|
||||
if (!oldWindSourceTypesToRequest.equals(getNamesOfWindSourceTypesOfWhichToDisplaySpeedOrDirection())) {
|
||||
clearCacheAndReload = true;
|
||||
}
|
||||
final boolean statLinesChanged = settings.isShowAverageLine() != newSettings.isShowAverageLine()
|
||||
|| settings.isShowMinLine() != newSettings.isShowMinLine()
|
||||
|| settings.isShowMaxLine() != newSettings.isShowMaxLine();
|
||||
settings.setShowAverageLine(newSettings.isShowAverageLine());
|
||||
settings.setShowMinLine(newSettings.isShowMinLine());
|
||||
settings.setShowMaxLine(newSettings.isShowMaxLine());
|
||||
if (clearCacheAndReload) {
|
||||
clearCacheAndReload();
|
||||
}
|
||||
if (statLinesChanged) {
|
||||
updateStatPlotLines();
|
||||
}
|
||||
updateVisibleSeries();
|
||||
}
|
||||
|
||||
@@ -550,6 +572,92 @@ public class WindChart extends AbstractRaceChart<WindChartSettings> implements R
|
||||
|
||||
private void clearChart() {
|
||||
chart.removeAllSeries();
|
||||
removeStatPlotLines();
|
||||
}
|
||||
|
||||
private void removeStatPlotLines() {
|
||||
chart.getYAxis(0).removePlotLine(directionAveragePlotLine);
|
||||
chart.getYAxis(0).removePlotLine(directionMinPlotLine);
|
||||
chart.getYAxis(0).removePlotLine(directionMaxPlotLine);
|
||||
chart.getYAxis(1).removePlotLine(speedAveragePlotLine);
|
||||
chart.getYAxis(1).removePlotLine(speedMinPlotLine);
|
||||
chart.getYAxis(1).removePlotLine(speedMaxPlotLine);
|
||||
}
|
||||
|
||||
private void updateStatPlotLines() {
|
||||
removeStatPlotLines();
|
||||
final boolean showAvg = settings.isShowAverageLine();
|
||||
final boolean showMin = settings.isShowMinLine();
|
||||
final boolean showMax = settings.isShowMaxLine();
|
||||
if (!showAvg && !showMin && !showMax) {
|
||||
return;
|
||||
}
|
||||
double dirSum = 0, dirMin = Double.MAX_VALUE, dirMax = -Double.MAX_VALUE;
|
||||
int dirCount = 0;
|
||||
double spdSum = 0, spdMin = Double.MAX_VALUE, spdMax = -Double.MAX_VALUE;
|
||||
int spdCount = 0;
|
||||
for (final Point[] points : windSourceDirectionPoints.values()) {
|
||||
if (points != null) {
|
||||
for (final Point p : points) {
|
||||
if (p != null && p.getY() != null) {
|
||||
final double v = p.getY().doubleValue();
|
||||
dirSum += v;
|
||||
if (v < dirMin) {
|
||||
dirMin = v;
|
||||
}
|
||||
if (v > dirMax) {
|
||||
dirMax = v;
|
||||
}
|
||||
dirCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (final Point[] points : windSourceSpeedPoints.values()) {
|
||||
if (points != null) {
|
||||
for (final Point p : points) {
|
||||
if (p != null && p.getY() != null) {
|
||||
final double v = p.getY().doubleValue();
|
||||
spdSum += v;
|
||||
if (v < spdMin) {
|
||||
spdMin = v;
|
||||
}
|
||||
if (v > spdMax) {
|
||||
spdMax = v;
|
||||
}
|
||||
spdCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dirCount > 0) {
|
||||
if (showAvg) {
|
||||
directionAveragePlotLine.setValue(dirSum / dirCount);
|
||||
chart.getYAxis(0).addPlotLines(directionAveragePlotLine);
|
||||
}
|
||||
if (showMin) {
|
||||
directionMinPlotLine.setValue(dirMin);
|
||||
chart.getYAxis(0).addPlotLines(directionMinPlotLine);
|
||||
}
|
||||
if (showMax) {
|
||||
directionMaxPlotLine.setValue(dirMax);
|
||||
chart.getYAxis(0).addPlotLines(directionMaxPlotLine);
|
||||
}
|
||||
}
|
||||
if (spdCount > 0) {
|
||||
if (showAvg) {
|
||||
speedAveragePlotLine.setValue(spdSum / spdCount);
|
||||
chart.getYAxis(1).addPlotLines(speedAveragePlotLine);
|
||||
}
|
||||
if (showMin) {
|
||||
speedMinPlotLine.setValue(spdMin);
|
||||
chart.getYAxis(1).addPlotLines(speedMinPlotLine);
|
||||
}
|
||||
if (showMax) {
|
||||
speedMaxPlotLine.setValue(spdMax);
|
||||
chart.getYAxis(1).addPlotLines(speedMaxPlotLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -688,7 +796,7 @@ public class WindChart extends AbstractRaceChart<WindChartSettings> implements R
|
||||
Set<WindSourceType> windDirectionSourcesToDisplay = new HashSet<>();
|
||||
windSpeedSourcesToDisplay.add(type);
|
||||
windDirectionSourcesToDisplay.add(type);
|
||||
WindChartSettings patched = new WindChartSettings(true,windSpeedSourcesToDisplay,true,windDirectionSourcesToDisplay,settings.getResolutionInMilliseconds());
|
||||
WindChartSettings patched = new WindChartSettings(true, windSpeedSourcesToDisplay, true, windDirectionSourcesToDisplay, settings.getResolutionInMilliseconds(), settings.isShowAverageLine(), settings.isShowMinLine(), settings.isShowMaxLine());
|
||||
updateSettings(patched);
|
||||
preselectFilter = windprovider;
|
||||
updateVisibleSeries();
|
||||
|
||||
+36
-2
@@ -22,6 +22,9 @@ public class WindChartSettings extends AbstractGenericSerializableSettings {
|
||||
|
||||
private BooleanSetting showWindSpeedSeries;
|
||||
private BooleanSetting showWindDirectionsSeries;
|
||||
private BooleanSetting showAverageLine;
|
||||
private BooleanSetting showMinLine;
|
||||
private BooleanSetting showMaxLine;
|
||||
|
||||
@Override
|
||||
protected void addChildSettings() {
|
||||
@@ -36,6 +39,9 @@ public class WindChartSettings extends AbstractGenericSerializableSettings {
|
||||
resolutionInMilliseconds = new LongSetting("resolutionInMilliseconds", this, DEFAULT_RESOLUTION_IN_MILLISECONDS);
|
||||
showWindSpeedSeries = new BooleanSetting("showWindSpeedSeries", this, true);
|
||||
showWindDirectionsSeries = new BooleanSetting("showWindDirectionsSeries", this, true);
|
||||
showAverageLine = new BooleanSetting("showAverageLine", this, false);
|
||||
showMinLine = new BooleanSetting("showMinLine", this, false);
|
||||
showMaxLine = new BooleanSetting("showMaxLine", this, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,14 +51,18 @@ public class WindChartSettings extends AbstractGenericSerializableSettings {
|
||||
super();
|
||||
}
|
||||
|
||||
public WindChartSettings(boolean showWindSpeedSeries, Set<WindSourceType> windSpeedSourcesToDisplay,
|
||||
boolean showWindDirectionsSeries, Set<WindSourceType> windDirectionSourcesToDisplay, long resolutionInMilliseconds) {
|
||||
public WindChartSettings(boolean showWindSpeedSeries, Set<WindSourceType> windSpeedSourcesToDisplay,
|
||||
boolean showWindDirectionsSeries, Set<WindSourceType> windDirectionSourcesToDisplay, long resolutionInMilliseconds,
|
||||
boolean showAverageLine, boolean showMinLine, boolean showMaxLine) {
|
||||
this();
|
||||
this.showWindSpeedSeries.setValue(showWindSpeedSeries);
|
||||
this.windSpeedSourcesToDisplay.setValues(windSpeedSourcesToDisplay);
|
||||
this.showWindDirectionsSeries.setValue(showWindDirectionsSeries);
|
||||
this.windDirectionSourcesToDisplay.setValues(windDirectionSourcesToDisplay);
|
||||
this.resolutionInMilliseconds.setValue(resolutionInMilliseconds);
|
||||
this.showAverageLine.setValue(showAverageLine);
|
||||
this.showMinLine.setValue(showMinLine);
|
||||
this.showMaxLine.setValue(showMaxLine);
|
||||
}
|
||||
|
||||
public Set<WindSourceType> getWindDirectionSourcesToDisplay() {
|
||||
@@ -98,4 +108,28 @@ public class WindChartSettings extends AbstractGenericSerializableSettings {
|
||||
this.windSpeedSourcesToDisplay.setValues(windSpeedSourcesToDisplay);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isShowAverageLine() {
|
||||
return showAverageLine.getValue();
|
||||
}
|
||||
|
||||
public void setShowAverageLine(final boolean showAverageLine) {
|
||||
this.showAverageLine.setValue(showAverageLine);
|
||||
}
|
||||
|
||||
public boolean isShowMinLine() {
|
||||
return showMinLine.getValue();
|
||||
}
|
||||
|
||||
public void setShowMinLine(final boolean showMinLine) {
|
||||
this.showMinLine.setValue(showMinLine);
|
||||
}
|
||||
|
||||
public boolean isShowMaxLine() {
|
||||
return showMaxLine.getValue();
|
||||
}
|
||||
|
||||
public void setShowMaxLine(final boolean showMaxLine) {
|
||||
this.showMaxLine.setValue(showMaxLine);
|
||||
}
|
||||
}
|
||||
|
||||
+21
-4
@@ -31,6 +31,9 @@ public class WindChartSettingsDialogComponent implements SettingsDialogComponent
|
||||
private final Map<WindSourceType, CheckBox> windSpeedCheckboxes;
|
||||
private CheckBox showWindSpeedSeriesCheckbox;
|
||||
private CheckBox showWindDirectionsSeriesCheckbox;
|
||||
private CheckBox showAverageLineCheckbox;
|
||||
private CheckBox showMinLineCheckbox;
|
||||
private CheckBox showMaxLineCheckbox;
|
||||
|
||||
private final StringMessages stringMessages;
|
||||
|
||||
@@ -110,7 +113,20 @@ public class WindChartSettingsDialogComponent implements SettingsDialogComponent
|
||||
checkbox.getElement().getStyle().setMarginLeft(15.0, Unit.PX);
|
||||
windSpeedSourcesPanel.add(checkbox);
|
||||
}
|
||||
|
||||
|
||||
vp.add(dialog.createHeadlineLabel(stringMessages.windStatisticsLines()));
|
||||
showAverageLineCheckbox = dialog.createCheckbox(stringMessages.showWindAverageLine());
|
||||
showAverageLineCheckbox.setTitle(stringMessages.showWindAverageLineTooltip());
|
||||
showAverageLineCheckbox.setValue(initialSettings.isShowAverageLine());
|
||||
vp.add(showAverageLineCheckbox);
|
||||
showMinLineCheckbox = dialog.createCheckbox(stringMessages.showWindMinLine());
|
||||
showMinLineCheckbox.setTitle(stringMessages.showWindMinLineTooltip());
|
||||
showMinLineCheckbox.setValue(initialSettings.isShowMinLine());
|
||||
vp.add(showMinLineCheckbox);
|
||||
showMaxLineCheckbox = dialog.createCheckbox(stringMessages.showWindMaxLine());
|
||||
showMaxLineCheckbox.setTitle(stringMessages.showWindMaxLineTooltip());
|
||||
showMaxLineCheckbox.setValue(initialSettings.isShowMaxLine());
|
||||
vp.add(showMaxLineCheckbox);
|
||||
return vp;
|
||||
}
|
||||
|
||||
@@ -134,9 +150,10 @@ public class WindChartSettingsDialogComponent implements SettingsDialogComponent
|
||||
windSpeedSourcesToDisplay.add(e.getKey());
|
||||
}
|
||||
}
|
||||
return new WindChartSettings(showWindSpeedSeriesCheckbox.getValue(), windSpeedSourcesToDisplay,
|
||||
showWindDirectionsSeriesCheckbox.getValue(), windDirectionSourcesToDisplay,
|
||||
resolutionInSecondsBox.getValue() == null ? -1 : resolutionInSecondsBox.getValue()*1000);
|
||||
return new WindChartSettings(showWindSpeedSeriesCheckbox.getValue(), windSpeedSourcesToDisplay,
|
||||
showWindDirectionsSeriesCheckbox.getValue(), windDirectionSourcesToDisplay,
|
||||
resolutionInSecondsBox.getValue() == null ? -1 : resolutionInSecondsBox.getValue()*1000,
|
||||
showAverageLineCheckbox.getValue(), showMinLineCheckbox.getValue(), showMaxLineCheckbox.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user