telegps: Add flash device functionality
[fw/altos] / telegps / TeleGPS.java
index de2b4aa33f84d05c9ed1a8d658a39d5143613df8..7f34c763428b1cc750de4303620773e1a1398af7 100644 (file)
@@ -89,21 +89,19 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo
 
        /* Device menu */
        final static String     download_command = "download";
-       final static String     configure_command = "configure";
        final static String     export_command = "export";
        final static String     graph_command = "graph";
+       final static String     configure_command = "configure";
+       final static String     flash_command = "flash";
 
        static final String[][] device_menu_entries = new String[][] {
                { "Download Data",      download_command },
                { "Configure Device",   configure_command },
                { "Export Data",        export_command },
                { "Graph Data",         graph_command },
+               { "Flash Device",       flash_command },
        };
 
-//     private AltosInfoTable flightInfo;
-
-       boolean exit_on_close = false;
-
        void stop_display() {
                if (thread != null && thread.isAlive()) {
                        thread.interrupt();
@@ -240,6 +238,10 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo
        void graph() {
        }
 
+       void flash() {
+               AltosFlashUI.show(this);
+       }
+
        public void actionPerformed(ActionEvent ev) {
 
                /* File menu */
@@ -293,6 +295,10 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo
                        graph();
                        return;
                }
+               if (flash_command.equals(ev.getActionCommand())) {
+                       flash();
+                       return;
+               }
        }
 
        void add_frequency_menu(int serial, final AltosFlightReader reader) {