X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosDataPointReader.java;h=2316cf97e1e36bcf447869b4dae248c4a9ab0999;hp=4335421c21a96922e0ef0f3bf6f3026efcdcfb3f;hb=6e0d672b8a516a604d8ea1abd2bed113c608143f;hpb=f558cfa1df77c36a459168c1953d0945ee5a7f9f diff --git a/altosui/AltosDataPointReader.java b/altosui/AltosDataPointReader.java index 4335421c..2316cf97 100644 --- a/altosui/AltosDataPointReader.java +++ b/altosui/AltosDataPointReader.java @@ -4,11 +4,10 @@ package altosui; -import java.io.IOException; -import java.text.ParseException; import java.lang.UnsupportedOperationException; import java.util.NoSuchElementException; import java.util.Iterator; +import org.altusmetrum.AltosLib.*; class AltosDataPointReader implements Iterable { Iterator iter; @@ -59,6 +58,7 @@ class AltosDataPointReader implements Iterable { public double battery_voltage() { return record.battery_voltage(); } public double drogue_voltage() { return record.drogue_voltage(); } public double main_voltage() { return record.main_voltage(); } + public boolean has_accel() { return has_accel; } }; } @@ -68,10 +68,14 @@ class AltosDataPointReader implements Iterable { 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(); } };