From 3c4278a29082a2af5911e22e59f8f52549f549e3 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 15 May 2016 13:56:21 -0700 Subject: [PATCH] altoslib: Add log_space to AltosState TeleGPS doesn't have flight_log_max value, but does have log_space which we can use for the same thing in monitor idle mode. Signed-off-by: Keith Packard --- altoslib/AltosState.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/altoslib/AltosState.java b/altoslib/AltosState.java index 0970a88e..d359d67a 100644 --- a/altoslib/AltosState.java +++ b/altoslib/AltosState.java @@ -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); -- 2.30.2