- public void write(AltosStateIterable states) {
- for (AltosState state : states) {
- if ((state.set & AltosState.set_gps) != 0)
- write(state);
- }
+ private int state(AltosFlightSeries series, double time) {
+ return (int) series.value_before(AltosFlightSeries.state_name, time);
+ }
+
+ private double height(AltosFlightSeries series, double time) {
+ return series.value(AltosFlightSeries.height_name, time);
+ }
+
+ public void write(AltosFlightSeries series) {
+ stats = new AltosFlightStats(series);
+ start(series.cal_data);
+ for (AltosGPSTimeValue gtv : series.gps_series)
+ write(gtv, series.cal_data, state(series, gtv.time), height(series, gtv.time));