diff options
author | Keith Packard <keithp@keithp.com> | 2013-02-09 01:59:18 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-02-10 00:30:32 -0800 |
commit | ab9caa22ea905844a99e08b5f6d3b072f094283e (patch) | |
tree | 4555f3f77eccb1390693157880c834030e7512d0 /micropeak/MicroDataPoint.java | |
parent | 9839b0b62d797a8616fc66038e3f3c68e2a214d0 (diff) |
micropeak: Use altosuilib graphing functions
Move these out of micropeak and into shared code
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'micropeak/MicroDataPoint.java')
-rw-r--r-- | micropeak/MicroDataPoint.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/micropeak/MicroDataPoint.java b/micropeak/MicroDataPoint.java index c58708e6..a81eb0d3 100644 --- a/micropeak/MicroDataPoint.java +++ b/micropeak/MicroDataPoint.java @@ -17,13 +17,36 @@ package org.altusmetrum.micropeak; -public class MicroDataPoint { +import org.altusmetrum.altosuilib_1.*; + +public class MicroDataPoint implements AltosUIDataPoint { public double time; public double pressure; public double height; public double speed; public double accel; + public static final int data_height = 0; + public static final int data_speed = 1; + public static final int data_accel = 2; + + public double x() { + return time; + } + + public double y(int index) { + switch (index) { + case data_height: + return height; + case data_speed: + return speed; + case data_accel: + return accel; + default: + return 0; + } + } + public MicroDataPoint (double pressure, double height, double speed, double accel, double time) { this.pressure = pressure; this.height = height; |