From: Keith Packard Date: Sat, 7 Jun 2014 18:49:14 +0000 (-0700) Subject: altosuilib: Show GPS instead of (missing) flight data for TeleGPS graphs X-Git-Tag: 1.3.2.3~4 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=5617919091d4c4a1e627470ddab0b45cf649f7a1;hp=e0dfa934ba76d6f913af37999e05c20e614bd3e9 altosuilib: Show GPS instead of (missing) flight data for TeleGPS graphs Signed-off-by: Keith Packard --- diff --git a/altosuilib/AltosGraph.java b/altosuilib/AltosGraph.java index 5e5a35cf..73c53a22 100644 --- a/altosuilib/AltosGraph.java +++ b/altosuilib/AltosGraph.java @@ -238,31 +238,39 @@ public class AltosGraph extends AltosUIGraph { course_axis = newAxis("Course", orient_units, gps_course_color, 0); addMarker("State", AltosGraphDataPoint.data_state, state_color); - addSeries("Height", - AltosGraphDataPoint.data_height, - AltosConvert.height, - height_color, - true, - height_axis); - addSeries("Pressure", - AltosGraphDataPoint.data_pressure, - pressure_units, - pressure_color, - false, - pressure_axis); - addSeries("Speed", - AltosGraphDataPoint.data_speed, - AltosConvert.speed, - speed_color, - true, - speed_axis); - addSeries("Acceleration", - AltosGraphDataPoint.data_accel, - AltosConvert.accel, - accel_color, - true, - accel_axis); + + if (stats.has_flight_data) { + addSeries("Height", + AltosGraphDataPoint.data_height, + AltosConvert.height, + height_color, + true, + height_axis); + addSeries("Pressure", + AltosGraphDataPoint.data_pressure, + pressure_units, + pressure_color, + false, + pressure_axis); + addSeries("Speed", + AltosGraphDataPoint.data_speed, + AltosConvert.speed, + speed_color, + true, + speed_axis); + addSeries("Acceleration", + AltosGraphDataPoint.data_accel, + AltosConvert.accel, + accel_color, + true, + accel_axis); + } if (stats.has_gps) { + boolean enable_gps = false; + + if (!stats.has_flight_data) + enable_gps = true; + addSeries("Range", AltosGraphDataPoint.data_range, AltosConvert.distance, @@ -273,12 +281,18 @@ public class AltosGraph extends AltosUIGraph { AltosGraphDataPoint.data_distance, AltosConvert.distance, distance_color, - false, + enable_gps, distance_axis); addSeries("GPS Height", AltosGraphDataPoint.data_gps_height, AltosConvert.height, gps_height_color, + enable_gps, + height_axis); + addSeries("GPS Altitude", + AltosGraphDataPoint.data_gps_altitude, + AltosConvert.height, + gps_height_color, false, height_axis); addSeries("GPS Satellites in Solution", @@ -303,13 +317,13 @@ public class AltosGraph extends AltosUIGraph { AltosGraphDataPoint.data_gps_ground_speed, AltosConvert.speed, gps_ground_speed_color, - false, + enable_gps, speed_axis); addSeries("GPS Climb Rate", AltosGraphDataPoint.data_gps_climb_rate, AltosConvert.speed, gps_climb_rate_color, - false, + enable_gps, speed_axis); } if (stats.has_rssi)