summaryrefslogtreecommitdiff
path: root/telegps/TeleGPSDisplayThread.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2015-02-07 14:43:11 -0800
committerKeith Packard <keithp@keithp.com>2015-02-07 14:43:11 -0800
commite70f3dca01b15b75b0b8795eb71bd12817af4800 (patch)
tree7958f178d7456fc4d66f196ac1f31f7c0f4d106e /telegps/TeleGPSDisplayThread.java
parent08f07d0af123e1c307bc4c0c973da07fae8246b1 (diff)
altoslib: Mark listener as 'not running' on EOF.
This adds a 'running' member to the AltosListenerState class, and when the replay reader reaches EOF, marks the listener as no longer running. AltosUI and TeleGPS now display 'done' in the 'Age' field when this occurs, to let the user know that the replay is over. Also make sure that the display timers are stopped when this happens, or when the window is closed. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'telegps/TeleGPSDisplayThread.java')
-rw-r--r--telegps/TeleGPSDisplayThread.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/telegps/TeleGPSDisplayThread.java b/telegps/TeleGPSDisplayThread.java
index 18b8d9fc..6305bf2f 100644
--- a/telegps/TeleGPSDisplayThread.java
+++ b/telegps/TeleGPSDisplayThread.java
@@ -168,8 +168,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();