summaryrefslogtreecommitdiff
path: root/altosui/AltosTelemetryIterable.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-03-30 11:48:03 -0700
committerKeith Packard <keithp@keithp.com>2011-03-30 11:48:03 -0700
commitf558cfa1df77c36a459168c1953d0945ee5a7f9f (patch)
tree4fbc53c7ab676252acde905c6d85518a9d341da7 /altosui/AltosTelemetryIterable.java
parenta9df9fc257eb2d7038d66ac7c2539aae4474bf12 (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/AltosTelemetryIterable.java')
-rw-r--r--altosui/AltosTelemetryIterable.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/altosui/AltosTelemetryIterable.java b/altosui/AltosTelemetryIterable.java
index 14b5f27f..44e5ad8f 100644
--- a/altosui/AltosTelemetryIterable.java
+++ b/altosui/AltosTelemetryIterable.java
@@ -28,6 +28,13 @@ public class AltosTelemetryIterable extends AltosRecordIterable {
return records.iterator();
}
+ boolean has_gps = false;
+ boolean has_accel = false;
+ boolean has_ignite = false;
+ public boolean has_gps() { return has_gps; }
+ public boolean has_accel() { return has_accel; }
+ public boolean has_ignite() { return has_ignite; };
+
public AltosTelemetryIterable (FileInputStream input) {
boolean saw_boost = false;
int current_tick = 0;
@@ -59,6 +66,12 @@ public class AltosTelemetryIterable extends AltosRecordIterable {
saw_boost = true;
boost_tick = record.tick;
}
+ if (record.accel != AltosRecord.MISSING)
+ has_accel = true;
+ if (record.gps != null)
+ has_gps = true;
+ if (record.main != AltosRecord.MISSING)
+ has_ignite = true;
records.add(record);
} catch (ParseException pe) {
System.out.printf("parse exception %s\n", pe.getMessage());