2 * Copyright © 2011 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
18 package org.altusmetrum.AltosLib;
21 public class AltosTelemetryRecordMegaSensor extends AltosTelemetryRecordRaw {
40 public AltosTelemetryRecordMegaSensor(int[] in_bytes, int in_rssi) {
60 System.out.printf ("telem record accel: %d\n", accel);
63 public AltosRecord update_state(AltosRecord previous) {
64 AltosRecord n = super.update_state(previous);
67 if (!(n instanceof AltosRecordMM)) {
68 System.out.printf("sensor making MM\n");
69 next = new AltosRecordMM(n);
71 System.out.printf("sensor has MM\n");
72 next = (AltosRecordMM) n;
75 System.out.printf("telem update_state accel: %d\n", accel);
80 next.imu.accel_x = accel_x;
81 next.imu.accel_y = accel_y;
82 next.imu.accel_z = accel_z;
84 next.imu.gyro_x = gyro_x;
85 next.imu.gyro_y = gyro_y;
86 next.imu.gyro_z = gyro_z;
94 next.seen |= AltosRecord.seen_sensor;