altoslib: Parse 'Log fixed:' configuration value
authorKeith Packard <keithp@keithp.com>
Mon, 18 Aug 2014 03:49:27 +0000 (20:49 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 18 Aug 2014 03:49:27 +0000 (20:49 -0700)
TeleGPS holds a single flight record and constantly appends data to it
instead of having separate flight records on the board. It reports
'Log fixed: 1' to let AltosLib know that the size of the per-flight
log is not configurable.

Signed-off-by: Keith Packard <keithp@keithp.com>
altoslib/AltosConfigData.java

index 134a0ed2ce0e1d7b3196794b1a45a57187475df7..fd38635cc0cd25c1e7e1560c5741e53ac8bafe09 100644 (file)
@@ -58,6 +58,7 @@ public class AltosConfigData implements Iterable<String> {
 
        /* HAS_LOG */
        public int      flight_log_max;
 
        /* HAS_LOG */
        public int      flight_log_max;
+       public int      log_fixed;
 
        /* HAS_IGNITE */
        public int      ignite_mode;
 
        /* HAS_IGNITE */
        public int      ignite_mode;
@@ -244,6 +245,7 @@ public class AltosConfigData implements Iterable<String> {
                pad_orientation = -1;
 
                flight_log_max = -1;
                pad_orientation = -1;
 
                flight_log_max = -1;
+               log_fixed = -1;
                ignite_mode = -1;
 
                aes_key = "";
                ignite_mode = -1;
 
                aes_key = "";
@@ -316,6 +318,7 @@ public class AltosConfigData implements Iterable<String> {
 
                /* HAS_LOG */
                try { flight_log_max = get_int(line, "Max flight log:"); } catch (Exception e) {}
 
                /* 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) {}
 
                /* HAS_IGNITE */
                try { ignite_mode = get_int(line, "Ignite mode:"); } catch (Exception e) {}
@@ -498,6 +501,9 @@ public class AltosConfigData implements Iterable<String> {
                if (log_space() == 0)
                        max_enabled = false;
 
                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;
                switch (log_format) {
                case AltosLib.AO_LOG_FORMAT_TINY:
                        max_enabled = false;