X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosUI.java;h=4994f093dcbfed6eb80e7c9534a2715fea65843a;hp=511c37093539fee08e7840862bc15e03088a807d;hb=d0fd53bdab2f480cd43b6d7010c2094f4fccda91;hpb=71da54a5ce255395376a44586782ab8b6f3b289f diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java index 511c3709..4994f093 100644 --- a/ao-tools/altosui/AltosUI.java +++ b/ao-tools/altosui/AltosUI.java @@ -243,17 +243,15 @@ public class AltosUI extends JFrame { flightInfoModel[i].finish(); } - static final int MIN_PAD_SAMPLES = 10; - public void show(AltosState state) { flightStatusModel.set(state); info_reset(); - if (state.npad >= MIN_PAD_SAMPLES) + if (state.gps_ready) info_add_row(0, "Ground state", "%s", "ready"); else info_add_row(0, "Ground state", "wait (%d)", - MIN_PAD_SAMPLES - state.npad); + state.gps_waiting); info_add_row(0, "Rocket state", "%s", state.data.state); info_add_row(0, "Callsign", "%s", state.data.callsign); info_add_row(0, "Rocket serial", "%6d", state.data.serial); @@ -374,7 +372,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)); @@ -413,6 +411,12 @@ public class AltosUI extends JFrame { (int) (state.max_height + 0.5)); } } + if (old_state == null || old_state.gps_ready != state.gps_ready) { + if (state.gps_ready) + voice.speak("GPS ready"); + else if (old_state != null) + voice.speak("GPS lost"); + } old_state = state; } @@ -474,7 +478,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 +617,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 +725,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