mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-25 06:58:39 +00:00
Merged ess-singapore containing the temporary fix for the igtimi windbot gps miscalculation, the update of MAX_HOPS for tractrac stored data, the fix for the race committee app and max_speed for xml export
This commit is contained in:
+18
-1
@@ -9,12 +9,29 @@ import com.sap.sailing.domain.igtimiadapter.IgtimiFixReceiver;
|
||||
import com.sap.sailing.domain.igtimiadapter.Sensor;
|
||||
|
||||
public class GpsLatLong extends Fix {
|
||||
public static final String IGTIMI_ENABLE_WORKAROUND_FOR_SINGLE_DIGIT_LATITUDES = "igtimi.enableWorkaroundForSingleDigitLatitudes";
|
||||
private static final long serialVersionUID = 5056284867725893553L;
|
||||
private final Position position;
|
||||
|
||||
public GpsLatLong(TimePoint timePoint, Sensor sensor, Map<Integer, Object> valuesPerSubindex) {
|
||||
super(sensor, timePoint);
|
||||
position = new DegreePosition(((Number) valuesPerSubindex.get(2)).doubleValue(), ((Number) valuesPerSubindex.get(1)).doubleValue());
|
||||
final double longitudeInDegrees = ((Number) valuesPerSubindex.get(1)).doubleValue();
|
||||
final double preliminaryLatitudeInDegrees = ((Number) valuesPerSubindex.get(2)).doubleValue();
|
||||
final double latitudeInDegrees;
|
||||
if (Boolean.valueOf(System.getProperty(IGTIMI_ENABLE_WORKAROUND_FOR_SINGLE_DIGIT_LATITUDES, "false"))) {
|
||||
final int degrees = (int) preliminaryLatitudeInDegrees;
|
||||
final double minutes = (preliminaryLatitudeInDegrees - degrees)*60.0;
|
||||
if (Math.abs(minutes) >= 10) {
|
||||
// the minutes have two digits; cannot have been a mis-parse
|
||||
latitudeInDegrees = preliminaryLatitudeInDegrees;
|
||||
} else {
|
||||
final double correctedMinutes = minutes + 10.0*(degrees%10);
|
||||
latitudeInDegrees = ((int) (degrees/10)) + correctedMinutes/60.0;
|
||||
}
|
||||
} else {
|
||||
latitudeInDegrees = preliminaryLatitudeInDegrees;
|
||||
}
|
||||
position = new DegreePosition(latitudeInDegrees, longitudeInDegrees);
|
||||
}
|
||||
|
||||
public Position getPosition() {
|
||||
|
||||
Reference in New Issue
Block a user