altosui: Add Ignitor tab to Monitor Idle mode
authorKeith Packard <keithp@keithp.com>
Sun, 22 Jun 2014 01:27:42 +0000 (18:27 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 22 Jun 2014 01:27:42 +0000 (18:27 -0700)
Oops; missed adding this when I included it in the Monitor Flight window.

Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/AltosIdleMonitorUI.java

index dd69b6f18b25adb1646f0a403c229b61987b9307..63d862918ae8cc467eafadfe4d7d586d71d65af0 100644 (file)
@@ -33,9 +33,11 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
        AltosPad                pad;
        AltosInfoTable          flightInfo;
        AltosFlightStatus       flightStatus;
        AltosPad                pad;
        AltosInfoTable          flightInfo;
        AltosFlightStatus       flightStatus;
+       AltosIgnitor            ignitor;
        AltosIdleMonitor        thread;
        int                     serial;
        boolean                 remote;
        AltosIdleMonitor        thread;
        int                     serial;
        boolean                 remote;
+       boolean                 has_ignitor;
 
        void stop_display() {
                if (thread != null) {
 
        void stop_display() {
                if (thread != null) {
@@ -70,10 +72,22 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
 
        public void show(AltosState state, AltosListenerState listener_state) {
                status_update.saved_state = state;
 
        public void show(AltosState state, AltosListenerState listener_state) {
                status_update.saved_state = state;
+               if (ignitor.should_show(state)) {
+                       if (!has_ignitor) {
+                               pane.add("Ignitor", ignitor);
+                               has_ignitor = true;
+                       }
+               } else {
+                       if (has_ignitor) {
+                               pane.remove(ignitor);
+                               has_ignitor = false;
+                       }
+               }
 //             try {
                        pad.show(state, listener_state);
                        flightStatus.show(state, listener_state);
                        flightInfo.show(state, listener_state);
 //             try {
                        pad.show(state, listener_state);
                        flightStatus.show(state, listener_state);
                        flightInfo.show(state, listener_state);
+                       ignitor.show(state, listener_state);
 //             } catch (Exception e) {
 //                     System.out.print("Show exception " + e);
 //             }
 //             } catch (Exception e) {
 //                     System.out.print("Show exception " + e);
 //             }
@@ -222,6 +236,8 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
                flightInfo = new AltosInfoTable();
                pane.add("Table", new JScrollPane(flightInfo));
 
                flightInfo = new AltosInfoTable();
                pane.add("Table", new JScrollPane(flightInfo));
 
+               ignitor = new AltosIgnitor();
+
                /* Make the tabbed pane use the rest of the window space */
                bag.add(pane, constraints(0, 3, GridBagConstraints.BOTH));
 
                /* Make the tabbed pane use the rest of the window space */
                bag.add(pane, constraints(0, 3, GridBagConstraints.BOTH));