micropeak: Update Makefile to versioned Java libraries
[fw/altos] / micropeak / MicroStats.java
index 056fac7d1d77d3538663cf79622819f7fafc9de9..abc1296bbcee04d4abca80aa2b253bcd1e8ab0a0 100644 (file)
@@ -18,8 +18,8 @@
 package org.altusmetrum.micropeak;
 
 import java.io.*;
-import org.altusmetrum.AltosLib.*;
-import org.altusmetrum.altosuilib.*;
+import org.altusmetrum.altoslib_1.*;
+import org.altusmetrum.altosuilib_1.*;
 
 public class MicroStats {
        double          coast_height;
@@ -58,12 +58,17 @@ public class MicroStats {
        }
 
        void find_apogee() {
-               apogee_height = 0;
+               apogee_height = data.apogee_height();
+               double searched_apogee = 0;
                apogee_time = 0;
                
+               /* This just finds the apogee time -- we've recorded the
+                * peak altitude separately in eeprom, and that could
+                * have occurred after the eeprom was full.
+                */
                for (MicroDataPoint point : data.points()) {
-                       if (point.height > apogee_height) {
-                               apogee_height = point.height;
+                       if (point.height > searched_apogee) {
+                               searched_apogee = point.height;
                                apogee_time = point.time;
                        }
                }