X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=telegps%2FTeleGPSDisplayThread.java;h=a9c80dc00d537cd60cb87c892e72abfad257583f;hp=9de33098b46eb7c04a518e180bddecb0c7445215;hb=238e56e0f6ab2f623e0faf25298b38dc3a4aff74;hpb=ae1174317fc476e39077f7dc257ec08709c6b301 diff --git a/telegps/TeleGPSDisplayThread.java b/telegps/TeleGPSDisplayThread.java index 9de33098..a9c80dc0 100644 --- a/telegps/TeleGPSDisplayThread.java +++ b/telegps/TeleGPSDisplayThread.java @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -21,8 +22,8 @@ import java.awt.*; import javax.swing.*; import java.io.*; import java.text.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altosuilib_11.*; public class TeleGPSDisplayThread extends Thread { @@ -90,8 +91,6 @@ public class TeleGPSDisplayThread extends Thread { voice.speak("Height %s.\n", AltosConvert.height.say(state.height())); } - } else { - voice.speak("Height is unknown.\n"); } } @@ -131,7 +130,7 @@ public class TeleGPSDisplayThread extends Thread { } public synchronized void notice(boolean spoken) { - if (old_state != null && old_state.state != state.state) { + if (old_state != null && old_state.state() != state.state()) { report_time = now(); this.notify(); } else if (spoken) @@ -170,8 +169,10 @@ public class TeleGPSDisplayThread extends Thread { for (;;) { try { state = reader.read(); - if (state == null) + if (state == null) { + listener_state.running = false; break; + } reader.update(state); show_safely(); told = tell();