Values in cal_data which are used to hold intermediate results need to
get reset back to their initial values before processing a series of
flight data again.
Signed-off-by: Keith Packard <keithp@keithp.com>
public int device_type = AltosLib.MISSING;
public void set_device_type(int device_type) {
public int device_type = AltosLib.MISSING;
public void set_device_type(int device_type) {
- if (device_type != AltosLib.MISSING)
+ if (device_type != AltosLib.MISSING) {
this.device_type = device_type;
this.device_type = device_type;
+ if (product == null)
+ set_product(AltosLib.product_name(device_type));
+ }
}
public int config_major = AltosLib.MISSING;
}
public int config_major = AltosLib.MISSING;
+ /* Reset all values which change during flight
+ */
+ public void reset() {
+ state = AltosLib.MISSING;
+ tick = AltosLib.MISSING;
+ prev_tick = AltosLib.MISSING;
+ temp_gps = null;
+ prev_gps = null;
+ temp_gps_sat_tick = AltosLib.MISSING;
+ accel = AltosLib.MISSING;
+ }
+
public int boost_tick = AltosLib.MISSING;
public void set_boost_tick() {
public int boost_tick = AltosLib.MISSING;
public void set_boost_tick() {
public void capture_series(AltosDataListener listener) {
AltosCalData cal_data = cal_data();
public void capture_series(AltosDataListener listener) {
AltosCalData cal_data = cal_data();
for (AltosEepromRecord record : ordered) {
record.provide_data(listener, cal_data);
}
for (AltosEepromRecord record : ordered) {
record.provide_data(listener, cal_data);
}
public void capture_series(AltosDataListener listener) {
AltosCalData cal_data = cal_data();
public void capture_series(AltosDataListener listener) {
AltosCalData cal_data = cal_data();
for (AltosTelemetry telem : telems) {
int tick = telem.tick();
cal_data.set_tick(tick);
for (AltosTelemetry telem : telems) {
int tick = telem.tick();
cal_data.set_tick(tick);
- if (cal_data.time() >= -1)
+
+ /* Try to pick up at least one pre-boost value */
+ if (cal_data.time() >= -2)
telem.provide_data(listener, cal_data);
if (listener.state == AltosLib.ao_flight_landed)
break;
telem.provide_data(listener, cal_data);
if (listener.state == AltosLib.ao_flight_landed)
break;
TreeSet<AltosTelemetryRecord> ordered;
public void capture_series(AltosDataListener listener) {
TreeSet<AltosTelemetryRecord> ordered;
public void capture_series(AltosDataListener listener) {
+ listener.cal_data.reset();
for (AltosTelemetryRecord record : ordered) {
record.update_state(listener);
}
for (AltosTelemetryRecord record : ordered) {
record.update_state(listener);
}