altoslib: Mark listener as 'not running' on EOF.
[fw/altos] / telegps / TeleGPSDisplayThread.java
index 9de33098b46eb7c04a518e180bddecb0c7445215..6305bf2f6929a61372b02800e2ec078c63a6c666 100644 (file)
@@ -21,8 +21,8 @@ import java.awt.*;
 import javax.swing.*;
 import java.io.*;
 import java.text.*;
 import javax.swing.*;
 import java.io.*;
 import java.text.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
 
 public class TeleGPSDisplayThread extends Thread {
 
 
 public class TeleGPSDisplayThread extends Thread {
 
@@ -90,8 +90,6 @@ public class TeleGPSDisplayThread extends Thread {
                                        voice.speak("Height %s.\n",
                                                    AltosConvert.height.say(state.height()));
                                }
                                        voice.speak("Height %s.\n",
                                                    AltosConvert.height.say(state.height()));
                                }
-                       } else {
-                               voice.speak("Height is unknown.\n");
                        }
                }
 
                        }
                }
 
@@ -170,8 +168,10 @@ public class TeleGPSDisplayThread extends Thread {
                        for (;;) {
                                try {
                                        state = reader.read();
                        for (;;) {
                                try {
                                        state = reader.read();
-                                       if (state == null)
+                                       if (state == null) {
+                                               listener_state.running = false;
                                                break;
                                                break;
+                                       }
                                        reader.update(state);
                                        show_safely();
                                        told = tell();
                                        reader.update(state);
                                        show_safely();
                                        told = tell();