diff options
author | Keith Packard <keithp@keithp.com> | 2017-05-25 17:24:14 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-05-25 17:24:14 -0700 |
commit | f26cfe417c6977cf1e7e75a4f050e25f64d41859 (patch) | |
tree | 2f19ca9c93c3246b3eeadafee250f9dd3ee222d6 /altoslib/AltosEepromRecordTiny.java | |
parent | 7600116a191b3ac252a0f716d200d0e0b3500987 (diff) |
altoslib: Do data analysis on raw values rather than AltosState
Use AltosFlightSeries instead of a sequence of AltosState records when
processing saved data. This provides a better way of doing filtering
and plotting.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosEepromRecordTiny.java')
-rw-r--r-- | altoslib/AltosEepromRecordTiny.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/altoslib/AltosEepromRecordTiny.java b/altoslib/AltosEepromRecordTiny.java index e70f8cdc..705fbd9e 100644 --- a/altoslib/AltosEepromRecordTiny.java +++ b/altoslib/AltosEepromRecordTiny.java @@ -14,7 +14,7 @@ package org.altusmetrum.altoslib_11; -public class AltosEepromRecordTiny extends AltosEepromRecord { +public class AltosEepromRecordTiny extends AltosEepromRecord implements AltosDataProvider { public static final int record_length = 2; private int value() { @@ -50,21 +50,21 @@ public class AltosEepromRecordTiny extends AltosEepromRecord { return tick; } - public void update_state(AltosFlightListener state) { + public void provide_data(AltosDataListener listener, AltosCalData cal_data) { int value = data16(-header_length); - state.set_tick(tick()); + cal_data.set_tick(tick()); switch (cmd()) { case AltosLib.AO_LOG_FLIGHT: - state.set_state(AltosLib.ao_flight_pad); - state.set_flight(value); - state.set_boost_tick(0); + listener.set_state(AltosLib.ao_flight_pad); + cal_data.set_flight(value); + cal_data.set_boost_tick(); break; case AltosLib.AO_LOG_STATE: - state.set_state(value & 0x7fff); + listener.set_state(value & 0x7fff); break; case AltosLib.AO_LOG_SENSOR: - state.set_pressure(AltosConvert.barometer_to_pressure(value)); + listener.set_pressure(AltosConvert.barometer_to_pressure(value)); break; } } |