altosdroid: Use single object to pass data to UI
[fw/altos] / altoslib / AltosConfigData.java
index 847436cd0b0abc2d68a2fc0b1e7dec18b6686a91..fd38635cc0cd25c1e7e1560c5741e53ac8bafe09 100644 (file)
@@ -31,6 +31,7 @@ public class AltosConfigData implements Iterable<String> {
        public int      log_format;
        public int      log_space;
        public String   version;
+       public int      altitude_32;
 
        /* Strings returned */
        public LinkedList<String>       lines;
@@ -57,6 +58,7 @@ public class AltosConfigData implements Iterable<String> {
 
        /* HAS_LOG */
        public int      flight_log_max;
+       public int      log_fixed;
 
        /* HAS_IGNITE */
        public int      ignite_mode;
@@ -243,6 +245,7 @@ public class AltosConfigData implements Iterable<String> {
                pad_orientation = -1;
 
                flight_log_max = -1;
+               log_fixed = -1;
                ignite_mode = -1;
 
                aes_key = "";
@@ -274,6 +277,7 @@ public class AltosConfigData implements Iterable<String> {
                try { flight = get_int(line, "current-flight"); } catch (Exception e) {}
                try { log_format = get_int(line, "log-format"); } catch (Exception e) {}
                try { log_space = get_int(line, "log-space"); } catch (Exception e) {}
+               try { altitude_32 = get_int(line, "altitude-32"); } catch (Exception e) {}
                try { version = get_string(line, "software-version"); } catch (Exception e) {}
 
                /* Version also contains MS5607 info, which we ignore here */
@@ -314,6 +318,7 @@ public class AltosConfigData implements Iterable<String> {
 
                /* HAS_LOG */
                try { flight_log_max = get_int(line, "Max flight log:"); } catch (Exception e) {}
+               try { log_fixed = get_int(line, "Log fixed:"); } catch (Exception e) {}
 
                /* HAS_IGNITE */
                try { ignite_mode = get_int(line, "Ignite mode:"); } catch (Exception e) {}
@@ -484,6 +489,7 @@ public class AltosConfigData implements Iterable<String> {
                dest.set_serial(serial);
                dest.set_product(product);
                dest.set_version(version);
+               dest.set_altitude_32(altitude_32);
                dest.set_main_deploy(main_deploy);
                dest.set_apogee_delay(apogee_delay);
                dest.set_apogee_lockout(apogee_lockout);
@@ -495,6 +501,9 @@ public class AltosConfigData implements Iterable<String> {
                if (log_space() == 0)
                        max_enabled = false;
 
+               if (log_fixed > 0)
+                       max_enabled = false;
+
                switch (log_format) {
                case AltosLib.AO_LOG_FORMAT_TINY:
                        max_enabled = false;