diff options
author | Keith Packard <keithp@keithp.com> | 2015-02-07 14:43:11 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2015-02-07 14:43:11 -0800 |
commit | e70f3dca01b15b75b0b8795eb71bd12817af4800 (patch) | |
tree | 7958f178d7456fc4d66f196ac1f31f7c0f4d106e /telegps/TeleGPS.java | |
parent | 08f07d0af123e1c307bc4c0c973da07fae8246b1 (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/TeleGPS.java')
-rw-r--r-- | telegps/TeleGPS.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index a4b221e8..41f88172 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -67,7 +67,6 @@ public class TeleGPS TeleGPSStatus telegps_status; TeleGPSStatusUpdate status_update; - javax.swing.Timer status_timer; JTabbedPane pane; @@ -147,6 +146,7 @@ public class TeleGPS public void show(AltosState state, AltosListenerState listener_state) { try { status_update.saved_state = state; + status_update.saved_listener_state = listener_state; if (state == null) state = new AltosState(); @@ -178,11 +178,7 @@ public class TeleGPS void disconnect() { setTitle("TeleGPS"); stop_display(); - if (status_timer != null) { - status_timer.stop(); - status_timer = null; - status_update = null; - } + telegps_status.stop(); telegps_status.disable_receive(); disable_frequency_menu(); @@ -404,8 +400,7 @@ public class TeleGPS public void set_reader(AltosFlightReader reader, AltosDevice device) { status_update = new TeleGPSStatusUpdate(telegps_status); - status_timer = new javax.swing.Timer(100, status_update); - status_timer.start(); + telegps_status.start(status_update); setTitle(String.format("TeleGPS %s", reader.name)); thread = new TeleGPSDisplayThread(this, voice(), this, reader); |