lose the --kml option, a few UI text tweaks
[fw/altos] / teststand / TestStand.java
index 39151381e723eacb9cec4d56768bd8f0b35be034..d13906a23cdf2f374b667b44945cafa5f4e5ba49 100644 (file)
@@ -134,20 +134,13 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
                                        }
                                });
                b.setToolTipText("Connect to TeleDongle and monitor telemetry");
-               b = addButton(1, 0, "Save Flight Data");
+               b = addButton(1, 0, "Save Data");
                b.addActionListener(new ActionListener() {
                                        public void actionPerformed(ActionEvent e) {
                                                SaveFlightData();
                                        }
                                });
                b.setToolTipText("Download and/or delete flight data from an altimeter");
-               b = addButton(2, 0, "Replay Flight");
-               b.addActionListener(new ActionListener() {
-                                       public void actionPerformed(ActionEvent e) {
-                                               Replay();
-                                       }
-                               });
-               b.setToolTipText("Watch an old flight in real-time");
                b = addButton(3, 0, "Graph Data");
                b.addActionListener(new ActionListener() {
                                        public void actionPerformed(ActionEvent e) {
@@ -162,7 +155,7 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
                                        }
                                });
                b.setToolTipText("Convert flight data for a spreadsheet or GoogleEarth");
-               b = addButton(0, 1, "Configure Altimeter");
+               b = addButton(0, 1, "Configure TeleFire");
                b.addActionListener(new ActionListener() {
                                        public void actionPerformed(ActionEvent e) {
                                                ConfigureTeleMetrum();
@@ -192,13 +185,6 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
                        });
                b.setToolTipText("Replace the firmware in any AltusMetrum product");
 
-               b = addButton(4, 1, "Fire Igniter");
-               b.addActionListener(new ActionListener() {
-                               public void actionPerformed(ActionEvent e) {
-                                       FireIgniter();
-                               }
-                       });
-               b.setToolTipText("Remote control of igniters for deployment testing");
                b = addButton(0, 2, "Scan Channels");
                b.addActionListener(new ActionListener() {
                                public void actionPerformed(ActionEvent e) {
@@ -206,27 +192,6 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
                                }
                        });
                b.setToolTipText("Find what channel an altimeter is sending telemetry on");
-               b = addButton(1, 2, "Load Maps");
-               b.addActionListener(new ActionListener() {
-                               public void actionPerformed(ActionEvent e) {
-                                       LoadMaps();
-                               }
-                       });
-               b.setToolTipText("Download satellite images for off-line flight monitoring");
-               b = addButton(2, 2, "Monitor Idle");
-               b.addActionListener(new ActionListener() {
-                               public void actionPerformed(ActionEvent e) {
-                                       IdleMonitor();
-                               }
-                       });
-               b.setToolTipText("Check flight readiness of altimeter in idle mode");
-
-//             b = addButton(3, 2, "Launch Controller");
-//             b.addActionListener(new ActionListener() {
-//                             public void actionPerformed(ActionEvent e) {
-//                                     LaunchController();
-//                             }
-//                     });
 
                b = addButton(4, 2, "Quit");
                b.addActionListener(new ActionListener() {
@@ -236,7 +201,7 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
                        });
                b.setToolTipText("Close all active windows and terminate TestStand");
 
-               setTitle("AltOS");
+               setTitle("Altus Metrum Test Stand");
 
                pane.doLayout();
                pane.validate();
@@ -287,36 +252,10 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
                AltosFlashUI.show(TestStand.this);
        }
 
-       void FireIgniter() {
-               new AltosIgniteUI(TestStand.this);
-       }
-
        void ScanChannels() {
                new AltosScanUI(TestStand.this, true);
        }
 
-       void LoadMaps() {
-               new AltosUIMapPreload(TestStand.this);
-       }
-
-       void LaunchController() {
-               new AltosLaunchUI(TestStand.this);
-       }
-
-       /*
-        * Replay a flight from telemetry data
-        */
-       private void Replay() {
-               AltosDataChooser chooser = new AltosDataChooser(
-                       TestStand.this);
-
-               AltosRecordSet set = chooser.runDialog();
-               if (set != null) {
-                       AltosReplayReader reader = new AltosReplayReader(set, chooser.file());
-                       new AltosFlightUI(voice, reader);
-               }
-       }
-
        /* Connect to TeleMetrum, either directly or through
         * a TeleDongle over the packet link
         */
@@ -374,13 +313,6 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
                new AltosConfigureUI(TestStand.this, voice);
        }
 
-       private void IdleMonitor() {
-               try {
-                       new AltosIdleMonitorUI(this);
-               } catch (Exception e) {
-               }
-       }
-
        static AltosWriter open_csv(File file) {
                try {
                        return new AltosCSV(file);
@@ -390,15 +322,6 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
                }
        }
 
-       static AltosWriter open_kml(File file) {
-               try {
-                       return new AltosKML(file);
-               } catch (FileNotFoundException fe) {
-                       System.out.printf("%s\n", fe.getMessage());
-                       return null;
-               }
-       }
-
        static AltosRecordSet record_set(File input) {
                try {
                        return AltosLib.record_set(input);
@@ -413,11 +336,9 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
 
        static final int process_none = 0;
        static final int process_csv = 1;
-       static final int process_kml = 2;
        static final int process_graph = 3;
-       static final int process_replay = 4;
-       static final int process_summary = 5;
-       static final int process_oneline = 6;
+       static final int process_summary = 4;
+       static final int process_oneline = 5;
 
        static boolean process_csv(File input) {
                AltosRecordSet set = record_set(input);
@@ -440,43 +361,6 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
                return true;
        }
 
-       static boolean process_kml(File input) {
-               AltosRecordSet set = record_set(input);
-               if (set == null)
-                       return false;
-
-               File output = Altos.replace_extension(input,".kml");
-               System.out.printf("Processing \"%s\" to \"%s\"\n", input, output);
-               if (input.equals(output)) {
-                       System.out.printf("Not processing '%s'\n", input);
-                       return false;
-               } else {
-                       AltosWriter writer = open_kml(output);
-                       if (writer == null)
-                               return false;
-                       AltosFlightSeries series = make_series(set);
-                       series.finish();
-                       writer.write(series);
-                       writer.close();
-                       return true;
-               }
-       }
-
-       static AltosReplayReader replay_file(File file) {
-               AltosRecordSet set = record_set(file);
-               if (set == null)
-                       return null;
-               return new AltosReplayReader(set, file);
-       }
-
-       static boolean process_replay(File file) {
-               AltosReplayReader reader = replay_file(file);
-               if (reader == null)
-                       return false;
-               AltosFlightUI flight_ui = new AltosFlightUI(new AltosVoice(), reader);
-               return true;
-       }
-
        static boolean process_graph(File file) {
                AltosRecordSet set = record_set(file);
                if (set == null)
@@ -496,7 +380,7 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
                        return false;
                System.out.printf("%s:\n", file.toString());
                AltosFlightSeries series = make_series(set);
-               AltosFlightStats stats = new AltosFlightStats(series);
+               TestStats stats = new TestStats(series);
                if (stats.serial != AltosLib.MISSING)
                        System.out.printf("Serial:       %5d\n", stats.serial);
                if (stats.flight != AltosLib.MISSING)
@@ -546,7 +430,7 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
                        return false;
                System.out.printf("%s", file.toString());
                AltosFlightSeries series = make_series(set);
-               AltosFlightStats stats = new AltosFlightStats(series);
+               TestStats stats = new TestStats(series);
                if (stats.max_height != AltosLib.MISSING)
                        System.out.printf(" height  %6.0f m", stats.max_height);
                if (stats.max_speed != AltosLib.MISSING)
@@ -562,12 +446,10 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
        public static void help(int code) {
                System.out.printf("Usage: teststand [OPTION]... [FILE]...\n");
                System.out.printf("  Options:\n");
-               System.out.printf("    --replay <filename>\t\trelive the glory of past flights \n");
                System.out.printf("    --graph <filename>\t\tgraph a flight\n");
                System.out.printf("    --summary <filename>\t\tText summary of a flight\n");
                System.out.printf("    --oneline <filename>\t\tOne line summary of a flight\n");
                System.out.printf("    --csv\tgenerate comma separated output for spreadsheets, etc\n");
-               System.out.printf("    --kml\tgenerate KML output for use with Google Earth\n");
                System.exit(code);
        }
 
@@ -592,10 +474,6 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
                        for (int i = 0; i < args.length; i++) {
                                if (args[i].equals("--help"))
                                        help(0);
-                               else if (args[i].equals("--replay"))
-                                       process = process_replay;
-                               else if (args[i].equals("--kml"))
-                                       process = process_kml;
                                else if (args[i].equals("--csv"))
                                        process = process_csv;
                                else if (args[i].equals("--graph"))
@@ -616,14 +494,6 @@ public class TestStand extends AltosUIFrame implements AltosEepromGrapher {
                                                if (!process_graph(file))
                                                        ++errors;
                                                break;
-                                       case process_replay:
-                                               if (!process_replay(file))
-                                                       ++errors;
-                                               break;
-                                       case process_kml:
-                                               if (!process_kml(file))
-                                                       ++errors;
-                                               break;
                                        case process_csv:
                                                if (!process_csv(file))
                                                        ++errors;