From f26cfe417c6977cf1e7e75a4f050e25f64d41859 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 25 May 2017 17:24:14 -0700 Subject: altoslib: Do data analysis on raw values rather than AltosState Use AltosFlightSeries instead of a sequence of AltosState records when processing saved data. This provides a better way of doing filtering and plotting. Signed-off-by: Keith Packard --- altoslib/AltosDataListener.java | 69 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 altoslib/AltosDataListener.java (limited to 'altoslib/AltosDataListener.java') diff --git a/altoslib/AltosDataListener.java b/altoslib/AltosDataListener.java new file mode 100644 index 00000000..b644e817 --- /dev/null +++ b/altoslib/AltosDataListener.java @@ -0,0 +1,69 @@ +/* + * Copyright © 2017 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +package org.altusmetrum.altoslib_11; + +public abstract class AltosDataListener { + + public AltosCalData cal_data; + + public double time = AltosLib.MISSING; + + public void set_time(double time) { + if (time != AltosLib.MISSING) + this.time = time; + } + + public double time() { + return time; + } + + public int state = AltosLib.MISSING; + + public void set_state(int state) { + if (state != AltosLib.MISSING) + this.state = state; + } + + public abstract void set_rssi(int rssi, int status); + public abstract void set_received_time(long received_time); + + public abstract void set_acceleration(double accel); + public abstract void set_pressure(double pa); + public abstract void set_thrust(double N); + + public abstract void set_kalman(double height, double speed, double accel); + + public abstract void set_temperature(double deg_c); + public abstract void set_battery_voltage(double volts); + + public abstract void set_apogee_voltage(double volts); + public abstract void set_main_voltage(double volts); + + public abstract void set_gps(AltosGPS gps); + + public abstract void set_orient(double orient); + public abstract void set_gyro(double roll, double pitch, double yaw); + public abstract void set_accel_ground(double along, double across, double through); + public abstract void set_accel(double along, double across, double through); + public abstract void set_mag(double along, double across, double through); + public abstract void set_pyro_voltage(double volts); + public abstract void set_ignitor_voltage(double[] voltage); + public abstract void set_pyro_fired(int pyro_mask); + public abstract void set_companion(AltosCompanion companion); + + public AltosDataListener(AltosCalData cal_data) { + this.cal_data = cal_data; + } +} -- cgit v1.2.3