From d0fd53bdab2f480cd43b6d7010c2094f4fccda91 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 28 Jul 2010 21:49:23 -0700 Subject: Reset GPS ready status when GPS comes unlocked on the pad If GPS becomes unlocked, then report that in the UI and via voice. Signed-off-by: Keith Packard --- ao-tools/altosui/AltosUI.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'ao-tools/altosui/AltosUI.java') diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java index 5c771df2..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); @@ -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; } -- cgit v1.2.3