diff options
| author | Keith Packard <keithp@keithp.com> | 2013-05-14 00:24:53 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2013-05-14 00:24:53 -0700 | 
| commit | 43f94e923a6a87520edcbb8fb4829e6ddf708908 (patch) | |
| tree | 418a5faf0b502845450f092961aa78235d5d22ea /altoslib/AltosRecord.java | |
| parent | c88aa32b979f379e3cf316dcb651e264c32a5283 (diff) | |
altoslib: Use sequence numbers to track GPS updates to AltosRecord
State objects now record what GPS sequence ID they have to know when
the GPS data has been updated. Record objects bump the GPS sequence
each time new GPS data is recorded. This way, record objects aren't
modified as they're iterated over to generate the list of state
objects which makes it possible to iterate multiple times and get the
same resulting set of states.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosRecord.java')
| -rw-r--r-- | altoslib/AltosRecord.java | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/altoslib/AltosRecord.java b/altoslib/AltosRecord.java index 07e910eb..5e4ed927 100644 --- a/altoslib/AltosRecord.java +++ b/altoslib/AltosRecord.java @@ -44,7 +44,7 @@ public class AltosRecord implements Comparable <AltosRecord>, Cloneable {  	public int	tick;  	public AltosGPS	gps; -	public boolean	new_gps; +	public int	gps_sequence;  	public double	time;	/* seconds since boost */ @@ -143,7 +143,7 @@ public class AltosRecord implements Comparable <AltosRecord>, Cloneable {  		state = old.state;  		tick = old.tick;  		gps = new AltosGPS(old.gps); -		new_gps = old.new_gps; +		gps_sequence = old.gps_sequence;  		companion = old.companion;  		kalman_acceleration = old.kalman_acceleration;  		kalman_speed = old.kalman_speed; @@ -161,7 +161,7 @@ public class AltosRecord implements Comparable <AltosRecord>, Cloneable {  		state = AltosLib.ao_flight_startup;  		tick = 0;  		gps = null; -		new_gps = false; +		gps_sequence = 0;  		companion = null;  		kalman_acceleration = MISSING; | 
