mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-14 06:18:12 +00:00
Bug fixes and performance improvements
This commit is contained in:
1 parent
f0c50bfb90
commit
95037d86e1
2 files changed
+33
-17
No files matched your search
+22
-7
@@ -699,7 +699,9 @@ public class FixesAndTails {
|
||||
protected void searchMinMaxDetailValue(CompetitorDTO competitor) {
|
||||
Integer startIndex = null;
|
||||
|
||||
Double min = null;
|
||||
double min = 0;
|
||||
boolean minSet = false;
|
||||
int minIndex = -1;
|
||||
// Check if the previously found minimum is still shown and use its value
|
||||
if (minDetailValueFix.containsKey(competitor)) {
|
||||
int minFix = minDetailValueFix.get(competitor);
|
||||
@@ -708,10 +710,13 @@ public class FixesAndTails {
|
||||
startIndex = getFirstShownFix(competitor);
|
||||
} else if (minFix < fixes.get(competitor).size() && fixes.get(competitor).get(minFix).detailValue != null) {
|
||||
min = fixes.get(competitor).get(minFix).detailValue;
|
||||
minSet = true;
|
||||
}
|
||||
}
|
||||
|
||||
Double max = null;
|
||||
double max = 0;
|
||||
boolean maxSet = false;
|
||||
int maxIndex = -1;
|
||||
// Check if the previously found maximum is still shown and use its value
|
||||
if (maxDetailValueFix.containsKey(competitor)) {
|
||||
int maxFix = maxDetailValueFix.get(competitor);
|
||||
@@ -724,6 +729,7 @@ public class FixesAndTails {
|
||||
}
|
||||
} else if (maxFix < fixes.get(competitor).size() && fixes.get(competitor).get(maxFix).detailValue != null) {
|
||||
max = fixes.get(competitor).get(maxFix).detailValue;
|
||||
maxSet = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -743,7 +749,7 @@ public class FixesAndTails {
|
||||
&& lastShownFix.get(competitor).get() != null && lastShownFix.get(competitor).get() != -1 ?
|
||||
lastShownFix.get(competitor).get() + 1 : fixes.get(competitor).size();
|
||||
|
||||
|
||||
|
||||
for (int i = startIndex; i < end; i++) {
|
||||
Double value;
|
||||
try {
|
||||
@@ -752,18 +758,27 @@ public class FixesAndTails {
|
||||
break;
|
||||
}
|
||||
if (value != null) {
|
||||
if (min == null) min = value;
|
||||
if (max == null) max = value;
|
||||
if (!minSet) {
|
||||
min = value;
|
||||
minSet = true;
|
||||
}
|
||||
if (!maxSet) {
|
||||
max = value;
|
||||
maxSet = true;
|
||||
}
|
||||
if (value <= min) {
|
||||
min = value;
|
||||
minDetailValueFix.put(competitor, i);
|
||||
minIndex = i;
|
||||
}
|
||||
if (value >= max) {
|
||||
max = value;
|
||||
maxDetailValueFix.put(competitor, i);
|
||||
maxIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (minIndex > -1) minDetailValueFix.put(competitor, minIndex);
|
||||
if (maxIndex > -1) maxDetailValueFix.put(competitor, maxIndex);
|
||||
lastSearchedFix.put(competitor, end - 1);
|
||||
}
|
||||
|
||||
|
||||
+11
-10
@@ -165,7 +165,7 @@ import com.sap.sse.gwt.client.shared.components.SettingsDialogComponent;
|
||||
import com.sap.sse.gwt.client.shared.settings.ComponentContext;
|
||||
|
||||
public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> implements TimeListener, CompetitorSelectionChangeListener,
|
||||
RaceTimesInfoProviderListener, TailFactory, RequiresDataInitialization, RequiresResize, QuickRankProvider {
|
||||
RaceTimesInfoProviderListener, TailFactory, ColorMapperChangedListener, RequiresDataInitialization, RequiresResize, QuickRankProvider {
|
||||
/* Line colors */
|
||||
static final String ADVANTAGE_LINE_COLOR = "#ff9900"; // orange
|
||||
static final String START_LINE_COLOR = "#ffffff";
|
||||
@@ -2514,15 +2514,8 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
|
||||
}
|
||||
if (selectedDetailType != previous) {
|
||||
selectedDetailTypeChanged = true; // Causes an overwrite of what are now wrong detailValues
|
||||
fixesAndTails.resetColorMapper(new ValueRangeFlexibleBoundaries(0, 1, 0.2, 0.5), new ColorMapperChangedListener() {
|
||||
@Override
|
||||
public void onColorMappingChanged() {
|
||||
for (CompetitorDTO competitor : competitorSelection.getAllCompetitors()) {
|
||||
MultiColorPolylineOptions options = createTailStyle(competitor, displayHighlighted(competitor));
|
||||
fixesAndTails.getTail(competitor).setOptions(options);
|
||||
}
|
||||
}
|
||||
});
|
||||
fixesAndTails.resetColorMapper(new ValueRangeFlexibleBoundaries(0, 1, 0.2, 0.5), RaceMap.this);
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -3054,6 +3047,14 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
|
||||
FilterSet<CompetitorDTO, ? extends Filter<CompetitorDTO>> newFilterSet) {
|
||||
// nothing to do; if the list of filtered competitors has changed, a separate call to filteredCompetitorsListChanged will occur
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onColorMappingChanged() {
|
||||
for (CompetitorDTO competitor : competitorSelection.getAllCompetitors()) {
|
||||
MultiColorPolylineOptions options = createTailStyle(competitor, displayHighlighted(competitor));
|
||||
fixesAndTails.getTail(competitor).setOptions(options);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiColorPolylineOptions createTailStyle(CompetitorDTO competitor, DisplayMode displayMode) {
|
||||
|
||||
Reference in new issue
Block a user