From 054f2896b98a14051e0b818090f2de178bb77283 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 20 Mar 2016 21:54:08 -0700 Subject: [PATCH] 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 --- altosui/AltosIgniteUI.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 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"); -- 2.30.2