altosuilib: Don't show 'Sats in view' for TeleGPS eeprom graphing
authorKeith Packard <keithp@keithp.com>
Sat, 7 Feb 2015 04:40:05 +0000 (20:40 -0800)
committerKeith Packard <keithp@keithp.com>
Sat, 7 Feb 2015 04:40:05 +0000 (20:40 -0800)
We don't log the visible sats from TeleGPS, only the basic GPS
info. Have AltosFlightStats track whether sat info is present, then
use that to elide the Sats In View graph entry as needed.

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

index 1b88cb9fc7e56e7b8b2abf7ae308571837c862ad..677230e1e057e558ef9f7fc0aa13105994cfda12 100644 (file)
@@ -37,6 +37,7 @@ public class AltosFlightStats {
        public double           pad_lat, pad_lon;
        public boolean          has_flight_data;
        public boolean          has_gps;
+       public boolean          has_gps_sats;
        public boolean          has_flight_adc;
        public boolean          has_battery;
        public boolean          has_rssi;
@@ -113,6 +114,7 @@ public class AltosFlightStats {
                lat = lon = AltosLib.MISSING;
                has_flight_data = false;
                has_gps = false;
+               has_gps_sats = false;
                has_flight_adc = false;
                has_battery = false;
                has_rssi = false;
@@ -174,6 +176,8 @@ public class AltosFlightStats {
                                lat = state.gps.lat;
                                lon = state.gps.lon;
                                has_gps = true;
+                               if (state.gps.cc_gps_sat != null)
+                                       has_gps_sats = true;
                        }
                        if (state.imu != null)
                                has_imu = true;
index 2e6d428d744658210a5a4f1f2dcfdc330c348a1e..854c869c7df23d201ae8caed0bb39869348f741c 100644 (file)
@@ -329,12 +329,14 @@ public class AltosGraph extends AltosUIGraph {
                                  gps_nsat_solution_color,
                                  false,
                                  nsat_axis);
-                       addSeries("GPS Satellites in View",
-                                 AltosGraphDataPoint.data_gps_nsat_view,
-                                 nsat_units,
-                                 gps_nsat_view_color,
-                                 false,
-                                 nsat_axis);
+                       if (stats.has_gps_sats) {
+                               addSeries("GPS Satellites in View",
+                                         AltosGraphDataPoint.data_gps_nsat_view,
+                                         nsat_units,
+                                         gps_nsat_view_color,
+                                         false,
+                                         nsat_axis);
+                       }
                        addSeries("GPS Course",
                                  AltosGraphDataPoint.data_gps_course,
                                  orient_units,