summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
da49904)
This makes sure we get complete GPS and setup information before
the flight starts.
To make this work, have data skipped when building time series
instead, and have realtime replay fast-forward through the initial
data
Signed-off-by: Keith Packard <keithp@keithp.com>
boolean done = false;
public void set_time(double time) {
boolean done = false;
public void set_time(double time) {
- if (last_time != AltosLib.MISSING) {
- semaphore.release();
- double delay = Math.min(time - last_time,10);
- if (delay > 0) {
- try {
- Thread.sleep((int) (delay * 1000));
- } catch (InterruptedException ie) {
+ if (time > -2) {
+ if (last_time != AltosLib.MISSING) {
+ semaphore.release();
+ double delay = Math.min(time - last_time,10);
+ if (delay > 0) {
+ try {
+ Thread.sleep((int) (delay * 1000));
+ } catch (InterruptedException ie) {
+ }
File file;
AltosReplay replay;
Thread t;
File file;
AltosReplay replay;
Thread t;
public AltosCalData cal_data() {
return replay.state.cal_data();
}
public AltosState read() {
public AltosCalData cal_data() {
return replay.state.cal_data();
}
public AltosState read() {
- switch (reads) {
- case 0:
- /* Tell the display that we're in pad mode */
- replay.state.set_state(AltosLib.ao_flight_pad);
- break;
- case 1:
- t = new Thread(replay);
- t.start();
- /* fall through */
- default:
- /* Wait for something to change */
- try {
- replay.semaphore.acquire();
- } catch (InterruptedException ie) {
- }
- break;
+ /* Wait for something to change */
+ try {
+ replay.semaphore.acquire();
+ } catch (InterruptedException ie) {
/* When done, let the display know */
if (replay.done)
/* When done, let the display know */
if (replay.done)
public File backing_file() { return file; }
public AltosReplayReader(AltosRecordSet record_set, File in_file) {
public File backing_file() { return file; }
public AltosReplayReader(AltosRecordSet record_set, File in_file) {
file = in_file;
name = file.getName();
replay = new AltosReplay(record_set);
file = in_file;
name = file.getName();
replay = new AltosReplay(record_set);
+ t = new Thread(replay);
+ t.start();
AltosTelemetryIterable telems;
AltosCalData cal_data;
AltosTelemetryIterable telems;
AltosCalData cal_data;
public void write_comments(PrintStream out) {
}
public void write_comments(PrintStream out) {
}
cal_data = new AltosCalData();
AltosTelemetryNullListener l = new AltosTelemetryNullListener(cal_data);
cal_data = new AltosCalData();
AltosTelemetryNullListener l = new AltosTelemetryNullListener(cal_data);
+ first_state = AltosLib.ao_flight_startup;
for (AltosTelemetry telem : telems) {
telem.provide_data(l);
for (AltosTelemetry telem : telems) {
telem.provide_data(l);
+ if (cal_data.state == AltosLib.ao_flight_pad)
+ first_state = cal_data.state;
if (l.cal_data_complete())
break;
}
if (l.cal_data_complete())
break;
}
}
public void capture_series(AltosDataListener listener) {
}
public void capture_series(AltosDataListener listener) {
- AltosCalData cal_data = cal_data();
-
+ cal_data.state = first_state;
for (AltosTelemetry telem : telems) {
for (AltosTelemetry telem : telems) {
- int tick = telem.tick();
- cal_data.set_tick(tick);
-
- /* Try to pick up at least one pre-boost value */
- if (cal_data.time() >= -2)
- telem.provide_data(listener);
+ telem.provide_data(listener);
if (listener.state() == AltosLib.ao_flight_landed)
break;
}
if (listener.state() == AltosLib.ao_flight_landed)
break;
}
public AltosUnits units;
ArrayList<AltosTimeValue> values;
boolean data_changed;
public AltosUnits units;
ArrayList<AltosTimeValue> values;
boolean data_changed;
public int compareTo(AltosTimeSeries other) {
return label.compareTo(other.label);
}
public void add(AltosTimeValue tv) {
public int compareTo(AltosTimeSeries other) {
return label.compareTo(other.label);
}
public void add(AltosTimeValue tv) {
- data_changed = true;
- values.add(tv);
+ if (tv.time >= min_time) {
+ data_changed = true;
+ values.add(tv);
+ }
}
public void erase_values() {
}
public void erase_values() {