altoslib: Add log_space to AltosState
[fw/altos] / altoslib / AltosState.java
index 0970a88e60063d581bae6d474ae95c6dcc8c4ff0..d359d67aa1ca16cbeaa94e69ed57485fd17ffe19 100644 (file)
@@ -832,6 +832,7 @@ public class AltosState implements Cloneable, AltosHashable {
        public double   ground_accel_avg;
 
        public int      log_format;
+       public int      log_space;
        public String   product;
 
        public AltosMs5607      baro;
@@ -949,6 +950,7 @@ public class AltosState implements Cloneable, AltosHashable {
                ground_accel_avg = AltosLib.MISSING;
 
                log_format = AltosLib.MISSING;
+               log_space = AltosLib.MISSING;
                product = null;
                serial = AltosLib.MISSING;
                receiver_serial = AltosLib.MISSING;
@@ -1108,6 +1110,7 @@ public class AltosState implements Cloneable, AltosHashable {
                ground_accel_avg = old.ground_accel_avg;
 
                log_format = old.log_format;
+               log_space = old.log_space;
                product = old.product;
                serial = old.serial;
                receiver_serial = old.receiver_serial;
@@ -1226,6 +1229,10 @@ public class AltosState implements Cloneable, AltosHashable {
                }
        }
 
+       public void set_log_space(int log_space) {
+               this.log_space = log_space;
+       }
+
        public void set_flight_params(int apogee_delay, int main_deploy) {
                this.apogee_delay = apogee_delay;
                this.main_deploy = main_deploy;
@@ -1730,6 +1737,7 @@ public class AltosState implements Cloneable, AltosHashable {
                h.putDouble("ground_accel", ground_accel);
                h.putDouble("ground_accel_avg", ground_accel_avg);
                h.putInt("log_format", log_format);
+               h.putInt("log_space", log_space);
                h.putString("product", product);
                h.putHashable("baro", baro);
                h.putHashable("companion", companion);
@@ -1834,6 +1842,7 @@ public class AltosState implements Cloneable, AltosHashable {
                ground_accel = h.getDouble("ground_accel", ground_accel);
                ground_accel_avg = h.getDouble("ground_accel_avg", ground_accel_avg);
                log_format = h.getInt("log_format", log_format);
+               log_space = h.getInt("log_space", log_space);
                product = h.getString("product", product);
                baro = AltosMs5607.fromHashSet(h.getHash("baro"), baro);
                companion = AltosCompanion.fromHashSet(h.getHash("companion"), companion);