From: Keith Packard Date: Sun, 8 Feb 2015 04:36:10 +0000 (-0800) Subject: altosuilib: Don't offer to graph some GPS details that TM doesn't log X-Git-Tag: 1.6~3 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=c72d83ccd207b5300a90f2e84de6c5c96642478c;ds=sidebyside altosuilib: Don't offer to graph some GPS details that TM doesn't log When using a TM eeprom file, various minor GPS details are logged (course, ground speed, climb rate, etc). Make sure these aren't offered up for graphing. Signed-off-by: Keith Packard --- diff --git a/altoslib/AltosFlightStats.java b/altoslib/AltosFlightStats.java index 677230e1..555a34b5 100644 --- a/altoslib/AltosFlightStats.java +++ b/altoslib/AltosFlightStats.java @@ -38,6 +38,7 @@ public class AltosFlightStats { public boolean has_flight_data; public boolean has_gps; public boolean has_gps_sats; + public boolean has_gps_detail; public boolean has_flight_adc; public boolean has_battery; public boolean has_rssi; @@ -178,6 +179,8 @@ public class AltosFlightStats { has_gps = true; if (state.gps.cc_gps_sat != null) has_gps_sats = true; + if (state.gps.course != AltosLib.MISSING) + has_gps_detail = true; } if (state.imu != null) has_imu = true; diff --git a/altosuilib/AltosGraph.java b/altosuilib/AltosGraph.java index 854c869c..e2db9e12 100644 --- a/altosuilib/AltosGraph.java +++ b/altosuilib/AltosGraph.java @@ -337,42 +337,46 @@ public class AltosGraph extends AltosUIGraph { false, nsat_axis); } - addSeries("GPS Course", - AltosGraphDataPoint.data_gps_course, - orient_units, - gps_course_color, - false, - course_axis); - addSeries("GPS Ground Speed", - AltosGraphDataPoint.data_gps_ground_speed, - AltosConvert.speed, - gps_ground_speed_color, - enable_gps, - speed_axis); - addSeries("GPS Climb Rate", - AltosGraphDataPoint.data_gps_climb_rate, - AltosConvert.speed, - gps_climb_rate_color, - enable_gps, - speed_axis); + if (stats.has_gps_detail) { + addSeries("GPS Course", + AltosGraphDataPoint.data_gps_course, + orient_units, + gps_course_color, + false, + course_axis); + addSeries("GPS Ground Speed", + AltosGraphDataPoint.data_gps_ground_speed, + AltosConvert.speed, + gps_ground_speed_color, + enable_gps, + speed_axis); + addSeries("GPS Climb Rate", + AltosGraphDataPoint.data_gps_climb_rate, + AltosConvert.speed, + gps_climb_rate_color, + enable_gps, + speed_axis); + } addSeries("GPS Position DOP", AltosGraphDataPoint.data_gps_pdop, dop_units, gps_pdop_color, false, dop_axis); - addSeries("GPS Horizontal DOP", - AltosGraphDataPoint.data_gps_hdop, - dop_units, - gps_hdop_color, - false, - dop_axis); - addSeries("GPS Vertical DOP", - AltosGraphDataPoint.data_gps_vdop, - dop_units, - gps_vdop_color, - false, - dop_axis); + if (stats.has_gps_detail) { + addSeries("GPS Horizontal DOP", + AltosGraphDataPoint.data_gps_hdop, + dop_units, + gps_hdop_color, + false, + dop_axis); + addSeries("GPS Vertical DOP", + AltosGraphDataPoint.data_gps_vdop, + dop_units, + gps_vdop_color, + false, + dop_axis); + } } if (stats.has_rssi) addSeries("Received Signal Strength",