diff options
author | Keith Packard <keithp@keithp.com> | 2017-10-22 14:04:09 -0500 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-10-22 14:04:09 -0500 |
commit | 749400fd244eba38806c623d2a35722642230698 (patch) | |
tree | 39f95bc777544c6bd80f71ba824b81133edf6379 /altoslib/AltosDataListener.java | |
parent | e98235e314ac764509af26c93da9e6d1de8184ea (diff) |
altoslib: Move temp GPS API from cal_data to data_listener
This makes the API more consistent, and means that the listener is
responsible for mangaing the temp gps state. In particular, the
AltosDataListener set_gps API now calls the cal_data function.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosDataListener.java')
-rw-r--r-- | altoslib/AltosDataListener.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/altoslib/AltosDataListener.java b/altoslib/AltosDataListener.java index 359d04c9..9a1e1465 100644 --- a/altoslib/AltosDataListener.java +++ b/altoslib/AltosDataListener.java @@ -111,7 +111,18 @@ public abstract class AltosDataListener { public abstract void set_apogee_voltage(double volts); public abstract void set_main_voltage(double volts); - public abstract void set_gps(AltosGPS gps); + public void set_gps(AltosGPS gps) { + AltosCalData cal_data = cal_data(); + cal_data.set_cal_gps(gps); + } + + public AltosGPS make_temp_gps(boolean sats) { + return cal_data().make_temp_cal_gps(tick(), sats); + } + + public AltosGPS temp_gps() { + return cal_data().temp_cal_gps(); + } public abstract void set_orient(double orient); public abstract void set_gyro(double roll, double pitch, double yaw); |