From: Keith Packard Date: Mon, 21 Mar 2016 04:54:08 +0000 (-0700) Subject: altosui: Delay between polling for igniter status in Fire Igniters X-Git-Tag: 1.6.3~2^2~78 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=054f2896b98a14051e0b818090f2de178bb77283 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 --- 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");