X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosuilib%2FAltosGraph.java;h=292437de9879f52076742f0ff42cc77d1de9bb66;hp=5e5a35cf3a7a8c0e9973208694fb5dc1eacc8291;hb=c8078d352a7f54a4a97d25af080155d3f875536a;hpb=bf684a4c290573a3aa627fd8ddf6f6ebbe5fa057 diff --git a/altosuilib/AltosGraph.java b/altosuilib/AltosGraph.java index 5e5a35cf..292437de 100644 --- a/altosuilib/AltosGraph.java +++ b/altosuilib/AltosGraph.java @@ -15,14 +15,14 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altosuilib_2; +package org.altusmetrum.altosuilib_3; import java.io.*; import java.util.ArrayList; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_4.*; +import org.altusmetrum.altoslib_5.*; import org.jfree.ui.*; import org.jfree.chart.*; @@ -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) @@ -319,19 +333,22 @@ public class AltosGraph extends AltosUIGraph { dbm_color, false, dbm_axis); - if (stats.has_other_adc) { - addSeries("Temperature", - AltosGraphDataPoint.data_temperature, - AltosConvert.temperature, - temperature_color, - false, - temperature_axis); + + if (stats.has_battery) addSeries("Battery Voltage", AltosGraphDataPoint.data_battery_voltage, voltage_units, battery_voltage_color, false, voltage_axis); + + if (stats.has_flight_adc) { + addSeries("Temperature", + AltosGraphDataPoint.data_temperature, + AltosConvert.temperature, + temperature_color, + false, + temperature_axis); addSeries("Drogue Voltage", AltosGraphDataPoint.data_drogue_voltage, voltage_units,