diff options
author | Keith Packard <keithp@keithp.com> | 2016-03-20 21:54:08 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2016-03-20 21:54:08 -0700 |
commit | 054f2896b98a14051e0b818090f2de178bb77283 (patch) | |
tree | ea1bce3b8b41d8aa18e4b8e3ffac94f192998056 /altosui | |
parent | 1594691ea88ca84634eea237ac8137a5bdc19f5c (diff) |
altosui: Delay between polling for igniter status in Fire Igniters
This gives a remote like time to report the full status instead of
sending another request before the reply has been processed.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui')
-rw-r--r-- | altosui/AltosIgniteUI.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/altosui/AltosIgniteUI.java b/altosui/AltosIgniteUI.java index 01d58b5e..ce714f7b 100644 --- a/altosui/AltosIgniteUI.java +++ b/altosui/AltosIgniteUI.java @@ -48,6 +48,8 @@ public class AltosIgniteUI int time_remaining; boolean timer_running; + int poll_remaining; + LinkedBlockingQueue<String> command_queue; class Igniter { @@ -256,6 +258,7 @@ public class AltosIgniteUI void set_ignite_status() { getting_status = false; + poll_remaining = 2; if (!visible) { visible = true; setVisible(true); @@ -263,6 +266,10 @@ public class AltosIgniteUI } void poll_ignite_status() { + if (poll_remaining > 0) { + --poll_remaining; + return; + } if (!getting_status) { getting_status = true; send_command("get_status"); |