X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosEepromReader.java;h=03e738124f37e2bafd06f6327b42860f3cc4c1ee;hp=f1d6a6a7d8124b416f0e96246e3dbcf9730ba82e;hb=e66919aa46193bd8c7a1e86fb32a3367dae121f5;hpb=67b6952f7126704478ede5575e5e938d18fcc329 diff --git a/ao-tools/altosui/AltosEepromReader.java b/ao-tools/altosui/AltosEepromReader.java index f1d6a6a7..03e73812 100644 --- a/ao-tools/altosui/AltosEepromReader.java +++ b/ao-tools/altosui/AltosEepromReader.java @@ -95,7 +95,6 @@ public class AltosEepromReader extends AltosReader { boolean last_reported; double ground_pres; - double ground_accel; int n_pad_samples; @@ -140,9 +139,6 @@ public class AltosEepromReader extends AltosReader { ground_pres += state.pres; state.ground_pres = (int) (ground_pres / n_pad_samples); state.flight_pres = state.ground_pres; - ground_accel += state.accel; - state.ground_accel = (int) (ground_accel / n_pad_samples); - state.flight_accel = state.ground_accel; } else { state.flight_pres = (state.flight_pres * 15 + state.pres) / 16; state.flight_accel = (state.flight_accel * 15 + state.accel) / 16; @@ -345,6 +341,7 @@ public class AltosEepromReader extends AltosReader { tick = record.tick; if (record.cmd == Altos.AO_LOG_FLIGHT) { state.ground_accel = record.a; + state.flight_accel = record.a; state.flight = record.b; boost_tick = tick; seen |= seen_flight; @@ -391,6 +388,11 @@ public class AltosEepromReader extends AltosReader { } } records.add(record); + + /* Bail after reading the 'landed' record; we're all done */ + if (record.cmd == Altos.AO_LOG_STATE && + record.a == Altos.ao_flight_landed) + break; } } catch (IOException io) { } catch (ParseException pe) {