mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-30 17:36:40 +00:00
Merge branch 'gwt' into osgi_mvn_refactoring
This commit is contained in:
commit
aaca5b9ad9
2 files changed
+19
-7
No files matched your search
+2
-4
@@ -644,8 +644,7 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
|
||||
* to the wind's bearing at that time and place and determined the tack.
|
||||
*/
|
||||
private Tack getTack(Position where, TimePoint timePoint, Bearing boatBearing) {
|
||||
// TODO See bug #20; once track-based wind estimation is cached and hence fast, include it again in tack determination for improved accuracy
|
||||
Bearing wind = getWind(where, timePoint, WindSource.TRACK_BASED_ESTIMATION).getBearing();
|
||||
Bearing wind = getWind(where, timePoint).getBearing();
|
||||
Bearing difference = wind.getDifferenceTo(boatBearing);
|
||||
return difference.getDegrees() <= 0 ? Tack.STARBOARD : Tack.PORT;
|
||||
}
|
||||
@@ -838,8 +837,7 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
|
||||
}
|
||||
} else {
|
||||
// heading up or bearing away
|
||||
// TODO See bug #20; once track-based wind estimation is cached and hence fast, include it to improve accuracy
|
||||
Wind wind = getWind(maneuverPosition, maneuverTimePoint, WindSource.TRACK_BASED_ESTIMATION);
|
||||
Wind wind = getWind(maneuverPosition, maneuverTimePoint);
|
||||
Bearing windBearing = wind.getBearing();
|
||||
Bearing toWindBeforeManeuver = windBearing.getDifferenceTo(speedWithBearingOnApproximationAtBeginning.getBearing());
|
||||
Bearing toWindAfterManeuver = windBearing.getDifferenceTo(speedWithBearingOnApproximationAtEnd.getBearing());
|
||||
|
||||
+17
-3
@@ -842,9 +842,23 @@ public class RaceMapPanel extends FormPanel implements EventDisplayer, TimeListe
|
||||
boatMarkers.put(competitorDAO, boatMarker);
|
||||
} else {
|
||||
competitorDAOsOfUnusedMarkers.remove(competitorDAO);
|
||||
boatMarker.setLatLng(LatLng.newInstance(lastPos.position.latDeg, lastPos.position.lngDeg));
|
||||
boatMarker.setImage(getBoatImageURL(lastPos,
|
||||
competitorsSelectedInMap.contains(competitorDAO)));
|
||||
// check if anchors match; re-use marker with setImage only if anchors match
|
||||
Point newAnchor = getBoatImageRotator(lastPos,
|
||||
competitorsSelectedInMap.contains(competitorDAO)).getAnchor();
|
||||
Point oldAnchor = boatMarker.getIcon().getIconAnchor();
|
||||
if (oldAnchor.getX() == newAnchor.getX() && oldAnchor.getY() == newAnchor.getY()) {
|
||||
boatMarker.setLatLng(LatLng.newInstance(lastPos.position.latDeg,
|
||||
lastPos.position.lngDeg));
|
||||
boatMarker.setImage(getBoatImageURL(lastPos,
|
||||
competitorsSelectedInMap.contains(competitorDAO)));
|
||||
} else {
|
||||
// anchors don't match; replace marker
|
||||
map.removeOverlay(boatMarker);
|
||||
boatMarker = createBoatMarker(competitorDAO,
|
||||
competitorsSelectedInMap.contains(competitorDAO));
|
||||
map.addOverlay(boatMarker);
|
||||
boatMarkers.put(competitorDAO, boatMarker);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user