diff options
author | Keith Packard <keithp@keithp.com> | 2014-05-28 02:06:18 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-05-28 02:06:18 -0700 |
commit | 4a5ef9eaa8b809c56813625133120e7e91fc8e65 (patch) | |
tree | 7f296d8827b66f5e4c4a6c184dab8cb586afcba2 /altoslib/AltosEepromFile.java | |
parent | 3773e89c47d356c4df58edc5725c33bca89b9605 (diff) |
altoslib: When log-format is missing, use product
log-format was added for 1.0; earlier log files don't include that,
but do say which product they're from.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosEepromFile.java')
-rw-r--r-- | altoslib/AltosEepromFile.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/altoslib/AltosEepromFile.java b/altoslib/AltosEepromFile.java index 2a26c484..1664dc95 100644 --- a/altoslib/AltosEepromFile.java +++ b/altoslib/AltosEepromFile.java @@ -74,6 +74,15 @@ public class AltosEepromFile extends AltosStateIterable { start = headers.state(); start.set_state(AltosLib.ao_flight_pad); + if (start.log_format == AltosLib.MISSING) { + if (start.product != null) { + if (start.product.startsWith("TeleMetrum")) + start.log_format = AltosLib.AO_LOG_FORMAT_FULL; + else if (start.product.startsWith("TeleMini")) + start.log_format = AltosLib.AO_LOG_FORMAT_TINY; + } + } + switch (start.log_format) { case AltosLib.AO_LOG_FORMAT_FULL: body = new AltosEepromIterable(AltosEepromTM.read(input)); @@ -120,4 +129,4 @@ public class AltosEepromFile extends AltosStateIterable { } return new AltosEepromIterator(state, i); } -}
\ No newline at end of file +} |