From e70f3dca01b15b75b0b8795eb71bd12817af4800 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 7 Feb 2015 14:43:11 -0800 Subject: 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 --- altosuilib/AltosDisplayThread.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'altosuilib/AltosDisplayThread.java') diff --git a/altosuilib/AltosDisplayThread.java b/altosuilib/AltosDisplayThread.java index 6b6e03e7..627088bc 100644 --- a/altosuilib/AltosDisplayThread.java +++ b/altosuilib/AltosDisplayThread.java @@ -224,8 +224,10 @@ public class AltosDisplayThread 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(); -- cgit v1.2.3