altosdroid: Deal with AltosState changes
[fw/altos] / altoslib / AltosDataListener.java
1 /*
2  * Copyright © 2017 Keith Packard <keithp@keithp.com>
3  *
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, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  */
14
15 package org.altusmetrum.altoslib_11;
16
17 public abstract class AltosDataListener {
18
19         public AltosCalData     cal_data = null;
20         public double           time = AltosLib.MISSING;
21         public int              state = AltosLib.MISSING;
22
23         public void set_time(double time) {
24                 if (time != AltosLib.MISSING)
25                         this.time = time;
26         }
27
28         public double time() {
29                 return time;
30         }
31
32         public void set_state(int state) {
33                 if (state != AltosLib.MISSING)
34                         this.state = state;
35         }
36
37         /* Called after all records are captured */
38         public void finish() {
39         }
40
41         public abstract void set_rssi(int rssi, int status);
42         public abstract void set_received_time(long received_time);
43
44         public abstract void set_acceleration(double accel);
45         public abstract void set_pressure(double pa);
46         public abstract void set_thrust(double N);
47
48         public abstract void set_kalman(double height, double speed, double accel);
49
50         public abstract void set_temperature(double deg_c);
51         public abstract void set_battery_voltage(double volts);
52
53         public abstract void set_apogee_voltage(double volts);
54         public abstract void set_main_voltage(double volts);
55
56         public abstract void set_gps(AltosGPS gps);
57
58         public abstract void set_orient(double orient);
59         public abstract void set_gyro(double roll, double pitch, double yaw);
60         public abstract void set_accel_ground(double along, double across, double through);
61         public abstract void set_accel(double along, double across, double through);
62         public abstract void set_mag(double along, double across, double through);
63         public abstract void set_pyro_voltage(double volts);
64         public abstract void set_igniter_voltage(double[] voltage);
65         public abstract void set_pyro_fired(int pyro_mask);
66         public abstract void set_companion(AltosCompanion companion);
67
68         public AltosDataListener() {
69         }
70
71         public AltosDataListener(AltosCalData cal_data) {
72                 this.cal_data = cal_data;
73         }
74 }