X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosTelemetryRecordSensor.java;h=767a464a7e5e046e8534481d89f46e21345e1516;hp=cfaf90b03ccfb0b3b811b62008cdf4c27ef63c67;hb=8d1d8d2a3c129cdbd55427bcda0f26715b02f1ee;hpb=69e6df07976a56b49e07c242cd6e5b2cbd2a578d diff --git a/altoslib/AltosTelemetryRecordSensor.java b/altoslib/AltosTelemetryRecordSensor.java index cfaf90b0..767a464a 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 { @@ -61,8 +61,14 @@ public class AltosTelemetryRecordSensor extends AltosTelemetryRecordRaw { 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 +86,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) {