altosdroid: Deal with AltosState changes
[fw/altos] / altoslib / AltosTelemetryFile.java
index 0b0e6a484c18a077a0bcdecc95b3c425c1acd5a9..40b9c9bfb85f1f25487112bae905f342bf197a7d 100644 (file)
@@ -46,7 +46,7 @@ class AltosTelemetryNullListener extends AltosDataListener {
        public void set_accel(double along, double across, double through) { }
        public void set_mag(double along, double across, double through) { }
        public void set_pyro_voltage(double volts) { }
-       public void set_ignitor_voltage(double[] voltage) { }
+       public void set_igniter_voltage(double[] voltage) { }
        public void set_pyro_fired(int pyro_mask) { }
        public void set_companion(AltosCompanion companion) { }
 
@@ -78,7 +78,7 @@ class AltosTelemetryNullListener extends AltosDataListener {
                /*
                 * TelemetryLocation
                 */
-               if (AltosLib.has_gps(cal_data.device_type) && cal_data.gps_ground_altitude == AltosLib.MISSING)
+               if (AltosLib.has_gps(cal_data.device_type) && cal_data.gps_pad == null)
                        return false;
 
                return true;
@@ -111,7 +111,6 @@ public class AltosTelemetryFile implements AltosRecordSet {
                                if (l.cal_data_complete())
                                        break;
                        }
-                       System.out.printf("Telemetry boost tick %d\n", cal_data.boost_tick);
                }
                return cal_data;
        }
@@ -124,7 +123,10 @@ public class AltosTelemetryFile implements AltosRecordSet {
                        cal_data.set_tick(tick);
                        if (cal_data.time() >= -1)
                                telem.provide_data(listener, cal_data);
+                       if (listener.state == AltosLib.ao_flight_landed)
+                               break;
                }
+               listener.finish();
        }
 
        public AltosTelemetryFile(FileInputStream input) {