altosuilib: Set graph title to include product/serial/flight info
authorKeith Packard <keithp@keithp.com>
Sun, 28 May 2017 22:28:29 +0000 (15:28 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 28 May 2017 22:28:29 +0000 (15:28 -0700)
Better than "Flight"

Signed-off-by: Keith Packard <keithp@keithp.com>
altosuilib/AltosGraphNew.java
altosuilib/AltosUIAxis.java
altosuilib/AltosUIGraphNew.java

index c0afd652a7bd36ea22f08a4fadcbdbc9ca64dfe6..08a3373087fb95d22081e9aa3fbab7c59410c646 100644 (file)
@@ -90,6 +90,9 @@ public class AltosGraphNew extends AltosUIGraphNew {
                AltosUIAxis     gyro_axis, orient_axis, mag_axis;
                AltosUIAxis     course_axis, dop_axis;
 
+               if (stats.serial != AltosLib.MISSING && stats.product != null && stats.flight != AltosLib.MISSING)
+                       setName(String.format("%s %d flight %d\n", stats.product, stats.serial, stats.flight));
+
                height_axis = newAxis("Height", AltosConvert.height, height_color);
                pressure_axis = newAxis("Pressure", AltosConvert.pressure, pressure_color, 0);
                speed_axis = newAxis("Speed", AltosConvert.speed, speed_color);
index 40ee51615789f3d131bc1beb1f5d09dc729622a3..e8c315182fb0255467f6a31c485b2c3416b9f1d8 100644 (file)
@@ -60,7 +60,6 @@ public class AltosUIAxis extends NumberAxis {
        }
 
        public void set_enable(boolean enable) {
-               System.out.printf("axis %s set enable visible %d ref %d\n", label, visible, ref);
                if (enable) {
                        visible++;
                        if (visible > ref)
index 709541ffab5e8d2558e71cc80a78fa951d94b81c..b96399abfd2fe4945c035b405ef8b70f9053202a 100644 (file)
@@ -126,7 +126,7 @@ public class AltosUIGraphNew implements AltosUnitsListener {
                plot.setDomainPannable(true);
                plot.setRangePannable(true);
 
-               chart = new JFreeChart("Flight", JFreeChart.DEFAULT_TITLE_FONT,
+               chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
                                       plot, true);
 
                ChartUtilities.applyCurrentTheme(chart);