X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosIgniteUI.java;h=debbf763481136e781ff274d165da27c2d0abb54;hp=4fff5d72a45fe3263877d00af6e1afedf50023d3;hb=0d691170a96545a9e57aad454de87541cea8c292;hpb=cb23b992be8ba40c97d8988c134a814a13ccd58c diff --git a/altosui/AltosIgniteUI.java b/altosui/AltosIgniteUI.java index 4fff5d72..debbf763 100644 --- a/altosui/AltosIgniteUI.java +++ b/altosui/AltosIgniteUI.java @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -24,8 +25,8 @@ import java.io.*; import java.text.*; import java.util.*; import java.util.concurrent.*; -import org.altusmetrum.altoslib_7.*; -import org.altusmetrum.altosuilib_7.*; +import org.altusmetrum.altoslib_12.*; +import org.altusmetrum.altosuilib_12.*; public class AltosIgniteUI extends AltosUIDialog @@ -48,6 +49,8 @@ public class AltosIgniteUI int time_remaining; boolean timer_running; + int poll_remaining; + LinkedBlockingQueue command_queue; class Igniter { @@ -210,6 +213,8 @@ public class AltosIgniteUI fired(); } else if (reply.startsWith("npyro")) { npyro = Integer.parseInt(reply.substring(6)); + if (npyro == AltosLib.MISSING) + npyro = 0; make_ui(); } } @@ -252,17 +257,18 @@ public class AltosIgniteUI boolean getting_status = false; - boolean visible = false; - void set_ignite_status() { getting_status = false; - if (!visible) { - visible = true; + poll_remaining = 2; + if (!isVisible()) setVisible(true); - } } void poll_ignite_status() { + if (poll_remaining > 0) { + --poll_remaining; + return; + } if (!getting_status) { getting_status = true; send_command("get_status");