diff options
author | Keith Packard <keithp@keithp.com> | 2013-08-31 01:48:02 -0500 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-08-31 01:48:58 -0500 |
commit | f07f6d55edf5b97020680b3ce1d9e00bb3df64a6 (patch) | |
tree | d701ad9e7a598d2436eb66d3cd958409c364a374 /altoslib/AltosTelemetryReader.java | |
parent | de8d9c5630ae46378c50faf97f7d2e97fe139e30 (diff) |
altoslib/altosui: Get legacy telem working with new AltosState structure
Make AltosTelemetry work without AltosRecord
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosTelemetryReader.java')
-rw-r--r-- | altoslib/AltosTelemetryReader.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/altoslib/AltosTelemetryReader.java b/altoslib/AltosTelemetryReader.java index 3915927c..b1cc009c 100644 --- a/altoslib/AltosTelemetryReader.java +++ b/altoslib/AltosTelemetryReader.java @@ -35,9 +35,12 @@ public class AltosTelemetryReader extends AltosFlightReader { AltosLine l = telem.take(); if (l.line == null) throw new IOException("IO error"); - AltosRecord next = AltosTelemetry.parse(l.line, previous); - previous = next; - state = new AltosState (next, state); + AltosTelemetry telem = AltosTelemetryLegacy.parse(l.line); + if (state == null) + state = new AltosState(); + else + state = state.clone(); + telem.update_state(state); return state; } |