altoslib: When log-format is missing, use product
[fw/altos] / altoslib / AltosState.java
index d65e3bd88fb2bc466ce97457d3d8c478ebefdfb7..9e8e22ac8d945168512db1266df11656c63cc9e4 100644 (file)
@@ -19,7 +19,7 @@
  * Track flight state from telemetry or eeprom data stream
  */
 
-package org.altusmetrum.altoslib_3;
+package org.altusmetrum.altoslib_4;
 
 public class AltosState implements Cloneable {
 
@@ -614,11 +614,14 @@ public class AltosState implements Cloneable {
        public double   ground_accel_avg;
 
        public int      log_format;
+       public String   product;
 
        public AltosMs5607      baro;
 
        public AltosCompanion   companion;
 
+       public int      pyro_fired;
+
        public void set_npad(int npad) {
                this.npad = npad;
                gps_waiting = MIN_PAD_SAMPLES - npad;
@@ -706,11 +709,14 @@ public class AltosState implements Cloneable {
                ground_accel_avg = AltosLib.MISSING;
 
                log_format = AltosLib.MISSING;
+               product = null;
                serial = AltosLib.MISSING;
                receiver_serial = AltosLib.MISSING;
 
                baro = null;
                companion = null;
+
+               pyro_fired = 0;
        }
 
        void finish_update() {
@@ -835,11 +841,14 @@ public class AltosState implements Cloneable {
                ground_accel_avg = old.ground_accel_avg;
 
                log_format = old.log_format;
+               product = old.product;
                serial = old.serial;
                receiver_serial = old.receiver_serial;
 
                baro = old.baro;
                companion = old.companion;
+
+               pyro_fired = old.pyro_fired;
        }
 
        void update_time() {
@@ -1114,6 +1123,10 @@ public class AltosState implements Cloneable {
                this.ignitor_voltage = voltage;
        }
 
+       public void set_pyro_fired(int fired) {
+               this.pyro_fired = fired;
+       }
+
        public double time_since_boost() {
                if (tick == AltosLib.MISSING)
                        return 0.0;