X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosTelemetryRecordSensor.java;h=e0e92c13d5ba2218d17119b0241db34e58400da3;hb=e711c708b0d2c8d8c2d72e34a795ad8e9b5ab5de;hp=cfaf90b03ccfb0b3b811b62008cdf4c27ef63c67;hpb=69e6df07976a56b49e07c242cd6e5b2cbd2a578d;p=fw%2Faltos diff --git a/altoslib/AltosTelemetryRecordSensor.java b/altoslib/AltosTelemetryRecordSensor.java index cfaf90b0..e0e92c13 100644 --- a/altoslib/AltosTelemetryRecordSensor.java +++ b/altoslib/AltosTelemetryRecordSensor.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.AltosLib; +package org.altusmetrum.altoslib_1; public class AltosTelemetryRecordSensor extends AltosTelemetryRecordRaw { @@ -36,10 +36,8 @@ public class AltosTelemetryRecordSensor extends AltosTelemetryRecordRaw { int accel_plus_g; int accel_minus_g; - int rssi; - - public AltosTelemetryRecordSensor(int[] in_bytes, int in_rssi) { - super(in_bytes); + public AltosTelemetryRecordSensor(int[] in_bytes, int rssi) { + super(in_bytes, rssi); state = uint8(5); accel = int16(6); @@ -57,12 +55,16 @@ public class AltosTelemetryRecordSensor extends AltosTelemetryRecordRaw { ground_accel = int16(26); accel_plus_g = int16(28); accel_minus_g = int16(30); - - rssi = in_rssi; } - public AltosRecord update_state(AltosRecord previous) { - AltosRecord next = super.update_state(previous); + public AltosRecord update_state(AltosRecord prev) { + AltosRecord n = super.update_state(prev); + + AltosRecordTM next; + if (!(n instanceof AltosRecordTM)) + next = new AltosRecordTM(n); + else + next = (AltosRecordTM) n; next.state = state; if (type == packet_type_TM_sensor) @@ -80,9 +82,9 @@ public class AltosTelemetryRecordSensor extends AltosTelemetryRecordRaw { next.main = AltosRecord.MISSING; } - next.acceleration = acceleration / 16.0; - next.speed = speed / 16.0; - next.height = height; + next.kalman_acceleration = acceleration / 16.0; + next.kalman_speed = speed / 16.0; + next.kalman_height = height; next.ground_pres = ground_pres; if (type == packet_type_TM_sensor) { @@ -95,8 +97,6 @@ public class AltosTelemetryRecordSensor extends AltosTelemetryRecordRaw { next.accel_minus_g = AltosRecord.MISSING; } - next.rssi = rssi; - next.seen |= AltosRecord.seen_sensor | AltosRecord.seen_temp_volt; return next;