altoslib: Record whether flight data includes sensor values in AltosFlightStats
authorKeith Packard <keithp@keithp.com>
Sat, 7 Jun 2014 18:47:11 +0000 (11:47 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 7 Jun 2014 19:34:15 +0000 (12:34 -0700)
Provide a way to elide the usual flight data from a graph for TeleGPS

Signed-off-by: Keith Packard <keithp@keithp.com>
altoslib/AltosFlightStats.java

index 87e04293c4fa91a8684aaa38908a78cc27531207..b3305a05e7aea5ce57a72523af01da49d3999564 100644 (file)
@@ -35,6 +35,7 @@ public class AltosFlightStats {
        public int              hour, minute, second;
        public double           lat, lon;
        public double           pad_lat, pad_lon;
+       public boolean          has_flight_data;
        public boolean          has_gps;
        public boolean          has_other_adc;
        public boolean          has_rssi;
@@ -109,6 +110,7 @@ public class AltosFlightStats {
                hour = minute = second = AltosLib.MISSING;
                serial = flight = AltosLib.MISSING;
                lat = lon = AltosLib.MISSING;
+               has_flight_data = false;
                has_gps = false;
                has_other_adc = false;
                has_rssi = false;
@@ -126,6 +128,9 @@ public class AltosFlightStats {
                                has_rssi = true;
                        end_time = state.time;
 
+                       if (state.pressure() != AltosLib.MISSING)
+                               has_flight_data = true;
+
                        int state_id = state.state;
                        if (state.time >= boost_time && state_id < AltosLib.ao_flight_boost)
                                state_id = AltosLib.ao_flight_boost;