diff options
author | Keith Packard <keithp@keithp.com> | 2011-03-30 11:48:03 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-03-30 11:48:03 -0700 |
commit | f558cfa1df77c36a459168c1953d0945ee5a7f9f (patch) | |
tree | 4fbc53c7ab676252acde905c6d85518a9d341da7 /altosui/AltosDataPointReader.java | |
parent | a9df9fc257eb2d7038d66ac7c2539aae4474bf12 (diff) |
altosui: Only plot acceleration when present in data file
Eliminates a bogus axis and data line for devices which do not have an
accelerometer.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosDataPointReader.java')
-rw-r--r-- | altosui/AltosDataPointReader.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/altosui/AltosDataPointReader.java b/altosui/AltosDataPointReader.java index ee57d2ce..4335421c 100644 --- a/altosui/AltosDataPointReader.java +++ b/altosui/AltosDataPointReader.java @@ -14,12 +14,18 @@ class AltosDataPointReader implements Iterable<AltosDataPoint> { Iterator<AltosRecord> iter; AltosState state; AltosRecord record; + boolean has_gps; + boolean has_accel; + boolean has_ignite; final static int MISSING = AltosRecord.MISSING; - public AltosDataPointReader(Iterable<AltosRecord> reader) { + public AltosDataPointReader(AltosRecordIterable reader) { this.iter = reader.iterator(); this.state = null; + has_accel = reader.has_accel(); + has_gps = reader.has_gps(); + has_ignite = reader.has_ignite(); } private void read_next_record() @@ -46,7 +52,7 @@ class AltosDataPointReader implements Iterable<AltosDataPoint> { public double acceleration() { return record.acceleration(); } public double pressure() { return record.raw_pressure(); } public double altitude() { return record.raw_altitude(); } - public double height() { return record.raw_height(); } + public double height() { return record.raw_height(); } public double accel_speed() { return record.accel_speed(); } public double baro_speed() { return state.baro_speed; } public double temperature() { return record.temperature(); } |