altosuilib: Display product/firmware version in stats table
authorKeith Packard <keithp@keithp.com>
Sun, 28 May 2017 21:03:51 +0000 (14:03 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 28 May 2017 21:04:21 +0000 (14:04 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
altosuilib/AltosFlightStatsTable.java

index 47bdb75f06527ba84cd14958207ff0c30f9c1ac6..beda38bf7aeb90900fe7cf1cbb647d794b057207 100644 (file)
@@ -89,8 +89,15 @@ public class AltosFlightStatsTable extends JComponent implements AltosFontListen
 
        public void set_stats(AltosFlightStats stats) {
                int y = 0;
-               if (stats.serial != AltosLib.MISSING)
-                       new FlightStat(layout, y++, "Serial", String.format("%d", stats.serial));
+               if (stats.serial != AltosLib.MISSING) {
+                       if (stats.product != null && stats.firmware_version != null)
+                               new FlightStat(layout, y++, "Device",
+                                              stats.product,
+                                              String.format("version %s", stats.firmware_version),
+                                              String.format("serial %d", stats.serial));
+                       else
+                               new FlightStat(layout, y++, "Serial", String.format("%d", stats.serial));
+               }
                if (stats.flight != AltosLib.MISSING)
                        new FlightStat(layout, y++, "Flight", String.format("%d", stats.flight));
                if (stats.year != AltosLib.MISSING && stats.hour != AltosLib.MISSING)