altosui: Prune telemetry file graphs to just the flight
authorKeith Packard <keithp@keithp.com>
Wed, 10 Aug 2011 21:34:39 +0000 (14:34 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 10 Aug 2011 21:34:39 +0000 (14:34 -0700)
Remove data earlier than 1 second before boost and data after landing.

Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/AltosDataPointReader.java

index fa48013..c3aabb0 100644 (file)
@@ -69,10 +69,14 @@ class AltosDataPointReader implements Iterable<AltosDataPoint> {
                 throw new UnsupportedOperationException(); 
             }
             public boolean hasNext() {
+               if (record != null && record.state == Altos.ao_flight_landed)
+                   return false;
                 return iter.hasNext();
             }
             public AltosDataPoint next() {
-                read_next_record();
+               do {
+                   read_next_record();
+               } while (record.time < -1.0 && hasNext());
                 return current_dp();
             }
         };