Add version numbers to java libraries
[fw/altos] / altoslib / AltosTelemetryRecordSensor.java
index cfaf90b03ccfb0b3b811b62008cdf4c27ef63c67..767a464a7e5e046e8534481d89f46e21345e1516 100644 (file)
@@ -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) {