micropeak: Export in lots of units
authorKeith Packard <keithp@keithp.com>
Fri, 4 Jan 2013 01:40:19 +0000 (17:40 -0800)
committerKeith Packard <keithp@keithp.com>
Fri, 4 Jan 2013 01:40:19 +0000 (17:40 -0800)
meters, feet, mach and gs

Signed-off-by: Keith Packard <keithp@keithp.com>
micropeak/MicroData.java

index fdfb2dc4e67fef8354b2130eb69e0bfb25ba4d37..d3c8c43e634cefc0b79105e229a765c73906e5ed 100644 (file)
@@ -265,10 +265,19 @@ public class MicroData {
 
        public void export (Writer f) throws IOException {
                PrintWriter     pw = new PrintWriter(f);
 
        public void export (Writer f) throws IOException {
                PrintWriter     pw = new PrintWriter(f);
-               pw.printf("  Time, Press, Height,  Speed,  Accel\n");
+               pw.printf("  Time, Press(Pa), Height(m), Height(f), Speed(m/s), Speed(ft/s), Speed(mach), Accel(m/s²), Accel(ft/s²),  Accel(g)\n");
                for (MicroDataPoint point : points()) {
                for (MicroDataPoint point : points()) {
-                       pw.printf("%6.3f,%6.0f,%7.1f,%7.2f,%7.2f\n",
-                                 point.time, point.pressure, point.height, point.speed, point.accel);
+                       pw.printf("%6.3f,%10.0f,%10.1f,%10.1f,%11.2f,%12.2f,%12.4f,%12.2f,%13.2f,%10.4f\n",
+                                 point.time,
+                                 point.pressure,
+                                 point.height,
+                                 AltosConvert.meters_to_feet(point.height),
+                                 point.speed,
+                                 AltosConvert.meters_to_feet(point.speed),
+                                 AltosConvert.meters_to_mach(point.speed),
+                                 point.accel,
+                                 AltosConvert.meters_to_feet(point.accel),
+                                 AltosConvert.meters_to_g(point.accel));
                }
        }
 
                }
        }