diff options
author | Keith Packard <keithp@keithp.com> | 2017-05-11 17:14:51 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-05-19 21:41:40 -0700 |
commit | 258808d296aeadaf150fa9b07e9c99a6bf1ca7c8 (patch) | |
tree | 2127cc9f8a85ffb8365542e709b224bd37bc0c2c /altoslib/AltosState.java | |
parent | a9aa2d3558c77eb444223eaa747c75916bc7bac1 (diff) |
altoslib: Create new abstraction underneath AltosState for recording values
Provides a way for the graph API to see raw data values, instead of
those cooked by AltosState.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosState.java')
-rw-r--r-- | altoslib/AltosState.java | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/altoslib/AltosState.java b/altoslib/AltosState.java index 8c3f93f0..6aa77139 100644 --- a/altoslib/AltosState.java +++ b/altoslib/AltosState.java @@ -24,7 +24,7 @@ package org.altusmetrum.altoslib_11; import java.io.*; -public class AltosState implements Cloneable { +public class AltosState extends AltosFlightListener implements Cloneable { public static final int set_position = 1; public static final int set_gps = 2; @@ -43,9 +43,7 @@ public class AltosState implements Cloneable { public double time; public double prev_time; public double time_change; - public int tick; private int prev_tick; - public int boost_tick; class AltosValue { double value; @@ -870,6 +868,8 @@ public class AltosState implements Cloneable { return; } + super.copy(old); + received_time = old.received_time; time = old.time; time_change = old.time_change; @@ -1071,11 +1071,6 @@ public class AltosState implements Cloneable { } } - public void set_boost_tick(int boost_tick) { - if (boost_tick != AltosLib.MISSING) - this.boost_tick = boost_tick; - } - public String state_name() { return AltosLib.state_name(state); } @@ -1502,23 +1497,10 @@ public class AltosState implements Cloneable { return tick != AltosLib.MISSING && serial != AltosLib.MISSING; } - public AltosGPS make_temp_gps(boolean sats) { - if (temp_gps == null) { - temp_gps = new AltosGPS(gps); - } - gps_pending = true; - if (sats) { - if (tick != temp_gps_sat_tick) - temp_gps.cc_gps_sat = null; - temp_gps_sat_tick = tick; - } - return temp_gps; - } - public void set_temp_gps() { set_gps(temp_gps, gps_sequence + 1); gps_pending = false; - temp_gps = null; + super.set_temp_gps(); } public void set_config_data(AltosConfigData config_data) { |