altosui: report rocket ground bearing at landing only if known
[fw/altos] / ao-tools / altosui / AltosUI.java
index 511c37093539fee08e7840862bc15e03088a807d..5c771df20816993e6d700f9e481b0eb1a11f0d9f 100644 (file)
@@ -374,7 +374,7 @@ public class AltosUI extends JFrame {
                                        voice.speak("rocket landed safely");
                                else
                                        voice.speak("rocket may have crashed");
-                               if (state.gps != null)
+                               if (state.from_pad != null)
                                        voice.speak("bearing %d degrees, range %d meters",
                                                    (int) (state.from_pad.bearing + 0.5),
                                                    (int) (state.from_pad.distance + 0.5));
@@ -474,7 +474,6 @@ public class AltosUI extends JFrame {
                void close() {
                        serial.close();
                        serial.remove_monitor(telem);
-                       System.out.println("DisplayThread done");
                }
 
                public DeviceThread(AltosSerial s) {
@@ -614,6 +613,7 @@ public class AltosUI extends JFrame {
         * a TeleDongle over the packet link
         */
        private void SaveFlightData() {
+               new AltosEeprom(AltosUI.this);
        }
 
        /* Create the AltosUI menus
@@ -721,6 +721,13 @@ public class AltosUI extends JFrame {
                                        }
                                });
                        menu.add(radioitem);
+                       item = new JMenuItem("Test Voice",KeyEvent.VK_T);
+                       item.addActionListener(new ActionListener() {
+                                       public void actionPerformed(ActionEvent e) {
+                                               voice.speak("That's one small step for man; one giant leap for mankind.");
+                                       }
+                               });
+                       menu.add(item);
                }
 
                // Channel menu