ao-tools/ao-cal-accel: Initialize byte count var 'l'
[fw/altos] / altosui / AltosIgniteUI.java
index 1a2dc4f1881c155e0c8ee26d2cedec9cf318d747..406b51cf2f1ef25edd7f3a2342745471ab98f802 100644 (file)
@@ -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_6.*;
-import org.altusmetrum.altosuilib_6.*;
+import org.altusmetrum.altoslib_13.*;
+import org.altusmetrum.altosuilib_13.*;
 
 public class AltosIgniteUI
        extends AltosUIDialog
@@ -48,6 +49,8 @@ public class AltosIgniteUI
        int             time_remaining;
        boolean         timer_running;
 
+       int             poll_remaining;
+
        LinkedBlockingQueue<String>     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");