X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosDisplayThread.java;h=375965b904d68364e495a3c2081ab0de46dbad64;hb=dcfa56498d1b65a213b8aba9cbd6c4806532383c;hp=957ac0d69581f00693b59104739a1d23c335943d;hpb=eb77e806ded99532dc7eaa39c1893f075b028af6;p=fw%2Faltos diff --git a/ao-tools/altosui/AltosDisplayThread.java b/ao-tools/altosui/AltosDisplayThread.java index 957ac0d6..375965b9 100644 --- a/ao-tools/altosui/AltosDisplayThread.java +++ b/ao-tools/altosui/AltosDisplayThread.java @@ -38,6 +38,11 @@ public class AltosDisplayThread extends Thread { int crc_errors; AltosFlightDisplay display; + synchronized void show(AltosState state, int crc_errors) { + if (state != null) + display.show(state, crc_errors); + } + class IdleThread extends Thread { boolean started; @@ -64,8 +69,10 @@ public class AltosDisplayThread extends Thread { state.state < Altos.ao_flight_landed && state.range >= 0) { - voice.speak("Height %d, bearing %d, elevation %d, range %d.\n", + voice.speak("Height %d, bearing %s %d, elevation %d, range %d.\n", (int) (state.height + 0.5), + state.from_pad.bearing_words( + AltosGreatCircle.BEARING_VOICE), (int) (state.from_pad.bearing + 0.5), (int) (state.elevation + 0.5), (int) (state.range + 0.5)); @@ -93,6 +100,10 @@ public class AltosDisplayThread extends Thread { (int) (state.from_pad.bearing + 0.5), (int) (state.from_pad.distance + 0.5)); ++reported_landing; + if (state.state != Altos.ao_flight_landed) { + state.state = Altos.ao_flight_landed; + show(state, 0); + } } } @@ -180,11 +191,6 @@ public class AltosDisplayThread extends Thread { return ret; } - void show(AltosState state, int crc_errors) { - if (state != null) - display.show(state, crc_errors); - } - public void run() { boolean interrupted = false; String line;