mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-28 08:26:44 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
+2
-8
@@ -1,15 +1,9 @@
|
||||
package com.sap.sailing.gwt.ui.adminconsole;
|
||||
|
||||
public abstract class LatLngBoundsCalculaterForSelected implements LatLngBoundsCalculator {
|
||||
|
||||
private boolean zoomOnlyToSelectedCompetitors;
|
||||
|
||||
public void setZoomOnlyToSelectedCompetitors(boolean zoomOnlyToSelectedCompetitors) {
|
||||
this.zoomOnlyToSelectedCompetitors = zoomOnlyToSelectedCompetitors;
|
||||
}
|
||||
|
||||
public boolean isZoomOnlyToSelectedCompetitors() {
|
||||
return zoomOnlyToSelectedCompetitors;
|
||||
public boolean isZoomOnlyToSelectedCompetitors(RaceMap forMap) {
|
||||
return forMap.getSettings().getZoomSettings().isZoomToSelectedCompetitors();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -1353,7 +1353,7 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
|
||||
if (selectedCompetitors == null || !selectedCompetitors.iterator().hasNext()) {
|
||||
competitors = forMap.getCompetitorsToShow();
|
||||
} else {
|
||||
competitors = isZoomOnlyToSelectedCompetitors() ? selectedCompetitors : forMap.getCompetitorsToShow();
|
||||
competitors = isZoomOnlyToSelectedCompetitors(forMap) ? selectedCompetitors : forMap.getCompetitorsToShow();
|
||||
}
|
||||
for (CompetitorDTO competitor : competitors) {
|
||||
try {
|
||||
@@ -1386,7 +1386,7 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
|
||||
@Override
|
||||
public LatLngBounds calculateNewBounds(RaceMap forMap) {
|
||||
LatLngBounds newBounds = null;
|
||||
Iterable<CompetitorDTO> competitors = isZoomOnlyToSelectedCompetitors() ? forMap.competitorSelection.getSelectedCompetitors() : forMap.getCompetitorsToShow();
|
||||
Iterable<CompetitorDTO> competitors = isZoomOnlyToSelectedCompetitors(forMap) ? forMap.competitorSelection.getSelectedCompetitors() : forMap.getCompetitorsToShow();
|
||||
for (CompetitorDTO competitor : competitors) {
|
||||
Polyline tail = forMap.tails.get(competitor);
|
||||
LatLngBounds bounds = tail != null ? tail.getBounds() : null;
|
||||
|
||||
-6
@@ -54,12 +54,6 @@ public class RaceMapZoomSettings {
|
||||
LatLngBounds newBounds = null;
|
||||
if (typesToConsiderOnZoom != null) {
|
||||
for (ZoomTypes type : typesToConsiderOnZoom) {
|
||||
//Set the forSelected attribute for the corresponding calculaters
|
||||
if (type.calculater instanceof LatLngBoundsCalculaterForSelected) {
|
||||
((LatLngBoundsCalculaterForSelected) type.calculater)
|
||||
.setZoomOnlyToSelectedCompetitors(zoomToSelectedCompetitors);
|
||||
}
|
||||
|
||||
//Calculate the new bounds and extend the result
|
||||
LatLngBounds calculatedBounds = type.calculateNewBounds(forMap);
|
||||
if (calculatedBounds != null) {
|
||||
|
||||
+9
-7
@@ -329,12 +329,6 @@ public class WindChart extends SimpleChartPanel implements Component<WindChartSe
|
||||
if (timeOfLatestRequestInMillis == null || wind.timepoint>timeOfLatestRequestInMillis) {
|
||||
timeOfLatestRequestInMillis = wind.timepoint;
|
||||
}
|
||||
if (directionMax == null || wind.dampenedTrueWindFromDeg > directionMax) {
|
||||
directionMax = wind.dampenedTrueWindFromDeg;
|
||||
}
|
||||
if (directionMin == null || wind.dampenedTrueWindFromDeg < directionMin) {
|
||||
directionMin = wind.dampenedTrueWindFromDeg;
|
||||
}
|
||||
|
||||
Point newDirectionPoint = new Point(wind.timepoint, wind.dampenedTrueWindFromDeg);
|
||||
if (wind.dampenedTrueWindSpeedInKnots != null) {
|
||||
@@ -343,6 +337,14 @@ public class WindChart extends SimpleChartPanel implements Component<WindChartSe
|
||||
newDirectionPoint = recalculateDirectionPoint(directionMax, directionMin, newDirectionPoint);
|
||||
directionPoints[i] = newDirectionPoint;
|
||||
|
||||
double direction = newDirectionPoint.getY().doubleValue();
|
||||
if (directionMax == null || direction > directionMax) {
|
||||
directionMax = direction;
|
||||
}
|
||||
if (directionMin == null || direction < directionMin) {
|
||||
directionMin = direction;
|
||||
}
|
||||
|
||||
Point newSpeedPoint = new Point(wind.timepoint, wind.dampenedTrueWindSpeedInKnots);
|
||||
speedPoints[i++] = newSpeedPoint;
|
||||
}
|
||||
@@ -374,7 +376,7 @@ public class WindChart extends SimpleChartPanel implements Component<WindChartSe
|
||||
double y = directionPoint.getY().doubleValue();
|
||||
boolean recalculated = false;
|
||||
|
||||
if (yMax != null && yMin != null && (y <= yMin || yMax <= y)) {
|
||||
if (yMax != null && yMin != null && (y < yMin || yMax < y)) {
|
||||
double deltaMin = Math.abs(yMin - y);
|
||||
double deltaMax = Math.abs(yMax - y);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user