X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosState.java;h=e20ec9a7109dbcd493deac0b544f692f2e78cd38;hb=91606c89828e60d8cf9a5ea4ff75b951d6fc042a;hp=0645e4487df547fc4ca50c4c3c3d28c8886c0f2f;hpb=69e6df07976a56b49e07c242cd6e5b2cbd2a578d;p=fw%2Faltos diff --git a/altoslib/AltosState.java b/altoslib/AltosState.java index 0645e448..e20ec9a7 100644 --- a/altoslib/AltosState.java +++ b/altoslib/AltosState.java @@ -70,6 +70,8 @@ public class AltosState { public double gps_height; + public double pad_lat, pad_lon, pad_alt; + public int speak_tick; public double speak_altitude; @@ -158,7 +160,8 @@ public class AltosState { } ngps++; } - } + } else + pad_alt = ground_altitude; gps_waiting = MIN_PAD_SAMPLES - npad; if (gps_waiting < 0) @@ -171,14 +174,14 @@ public class AltosState { boost = (AltosLib.ao_flight_boost == state); /* Only look at accelerometer data under boost */ - if (boost && acceleration > max_acceleration) + if (boost && acceleration > max_acceleration && acceleration != AltosRecord.MISSING) max_acceleration = acceleration; - if (boost && speed > max_speed) + if (boost && speed > max_speed && speed != AltosRecord.MISSING) max_speed = speed; - if (boost && baro_speed > max_baro_speed) + if (boost && baro_speed > max_baro_speed && baro_speed != AltosRecord.MISSING) max_baro_speed = baro_speed; - if (height > max_height) + if (height > max_height && height != AltosRecord.MISSING) max_height = height; if (data.gps != null) { if (gps == null || !gps.locked || data.gps.locked)