X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosDisplayThread.java;h=f7a1d03eb2ad7b1bfa0f9e8f6d6bc667eef23ddc;hp=03ce4efda1d918e88c693e9378bfd0795c08ac45;hb=3fe5c2f9fc01258d45c20070e9874d76bc6c8c07;hpb=3c2f601139d36761de6a8a2210545d082ef16133 diff --git a/altosui/AltosDisplayThread.java b/altosui/AltosDisplayThread.java index 03ce4efd..f7a1d03e 100644 --- a/altosui/AltosDisplayThread.java +++ b/altosui/AltosDisplayThread.java @@ -18,15 +18,9 @@ package altosui; import java.awt.*; -import java.awt.event.*; import javax.swing.*; -import javax.swing.filechooser.FileNameExtensionFilter; -import javax.swing.table.*; import java.io.*; -import java.util.*; import java.text.*; -import java.util.prefs.*; -import java.util.concurrent.LinkedBlockingQueue; import org.altusmetrum.AltosLib.*; public class AltosDisplayThread extends Thread { @@ -102,15 +96,15 @@ public class AltosDisplayThread extends Thread { state.state < Altos.ao_flight_landed && state.range >= 0) { - 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), + voice.speak("Height %s, bearing %s %d, elevation %d, range %s.\n", + AltosConvert.height.say(state.height), + 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)); + AltosConvert.distance.say(state.range)); } else if (state.state > Altos.ao_flight_pad) { - voice.speak("%d meters", (int) (state.height + 0.5)); + voice.speak(AltosConvert.height.say_units(state.height)); } else { reported_landing = 0; } @@ -129,9 +123,9 @@ public class AltosDisplayThread extends Thread { else voice.speak("rocket may have crashed"); if (state.from_pad != null) - voice.speak("Bearing %d degrees, range %d meters.", + voice.speak("Bearing %d degrees, range %s.", (int) (state.from_pad.bearing + 0.5), - (int) (state.from_pad.distance + 0.5)); + AltosConvert.distance.say_units(state.from_pad.distance)); ++reported_landing; if (state.state != Altos.ao_flight_landed) { state.state = Altos.ao_flight_landed; @@ -202,13 +196,13 @@ public class AltosDisplayThread extends Thread { voice.speak(state.data.state()); if ((old_state == null || old_state.state <= Altos.ao_flight_boost) && state.state > Altos.ao_flight_boost) { - voice.speak("max speed: %d meters per second.", - (int) (state.max_speed + 0.5)); + voice.speak("max speed: %s.", + AltosConvert.speed.say_units(state.max_speed + 0.5)); ret = true; } else if ((old_state == null || old_state.state < Altos.ao_flight_drogue) && state.state >= Altos.ao_flight_drogue) { - voice.speak("max height: %d meters.", - (int) (state.max_height + 0.5)); + voice.speak("max height: %s.", + AltosConvert.height.say_units(state.max_height + 0.5)); ret = true; } } @@ -228,7 +222,7 @@ public class AltosDisplayThread extends Thread { public void run() { boolean interrupted = false; - String line; + //String line; AltosState state = null; AltosState old_state = null; boolean told;