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:
Simon Pamies
2014-02-24 10:19:13 +08:00
parent 76ed76542a
commit b3e2d28753
8 changed files with 169 additions and 5 deletions
@@ -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() {