diff options
author | Bdale Garbee <bdale@gag.com> | 2017-07-21 17:44:03 -0600 |
---|---|---|
committer | Bdale Garbee <bdale@gag.com> | 2017-07-21 17:44:03 -0600 |
commit | c8dbcaf69cd538a31ab6e2b568237ae7c8656a9a (patch) | |
tree | 213ec02db2e80f2e8c39772c0bde95d802900e53 /altoslib/AltosSensorTM.java | |
parent | 0cbfa444a9f9159cb509bb47ca5590fc1d709f64 (diff) | |
parent | ea3b5815b27005b2f4c3034715f656d28ea8534e (diff) |
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Diffstat (limited to 'altoslib/AltosSensorTM.java')
-rw-r--r-- | altoslib/AltosSensorTM.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/altoslib/AltosSensorTM.java b/altoslib/AltosSensorTM.java index 5d1b1b7f..bdedaa9c 100644 --- a/altoslib/AltosSensorTM.java +++ b/altoslib/AltosSensorTM.java @@ -16,7 +16,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_11; +package org.altusmetrum.altoslib_12; import java.util.concurrent.TimeoutException; @@ -29,18 +29,19 @@ public class AltosSensorTM { public int drogue; public int main; - static public void update_state(AltosState state, AltosLink link, AltosConfigData config_data) throws InterruptedException { + static public void provide_data(AltosDataListener listener, AltosLink link) throws InterruptedException { try { AltosSensorTM sensor_tm = new AltosSensorTM(link); + AltosCalData cal_data = listener.cal_data(); if (sensor_tm == null) return; - state.set_accel(sensor_tm.accel); - state.set_pressure(AltosConvert.barometer_to_pressure(sensor_tm.pres)); - state.set_temperature(AltosConvert.thermometer_to_temperature(sensor_tm.temp)); - state.set_battery_voltage(AltosConvert.cc_battery_to_voltage(sensor_tm.batt)); - state.set_apogee_voltage(AltosConvert.cc_ignitor_to_voltage(sensor_tm.drogue)); - state.set_main_voltage(AltosConvert.cc_ignitor_to_voltage(sensor_tm.main)); + listener.set_acceleration(cal_data.acceleration((sensor_tm.accel))); + listener.set_pressure(AltosConvert.barometer_to_pressure(sensor_tm.pres)); + listener.set_temperature(AltosConvert.thermometer_to_temperature(sensor_tm.temp)); + listener.set_battery_voltage(AltosConvert.cc_battery_to_voltage(sensor_tm.batt)); + listener.set_apogee_voltage(AltosConvert.cc_igniter_to_voltage(sensor_tm.drogue)); + listener.set_main_voltage(AltosConvert.cc_igniter_to_voltage(sensor_tm.main)); } catch (TimeoutException te) { } |