altosdroid: Add map types and map preloading UIs
[fw/altos] / altoslib / AltosGPS.java
index 0154e95d7c96d3231d831d18973010a32f1989f9..6793adf1e4776febd5fd5c13a9f58cf61bbdacf4 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_5;
+package org.altusmetrum.altoslib_7;
 
 import java.text.*;
 import java.util.concurrent.*;
+import java.io.*;
 
-public class AltosGPS implements Cloneable {
+public class AltosGPS implements Cloneable, Serializable {
 
        public final static int MISSING = AltosLib.MISSING;
 
@@ -194,10 +195,10 @@ public class AltosGPS implements Cloneable {
                        lon = AltosParse.parse_coord(words[i++]);
                        alt = AltosParse.parse_int(words[i++]);
                        if (version > 1 || (i < words.length && !words[i].equals("SAT"))) {
-                               ground_speed = AltosParse.parse_double(AltosParse.strip_suffix(words[i++], "m/s(H)"));
+                               ground_speed = AltosParse.parse_double_net(AltosParse.strip_suffix(words[i++], "m/s(H)"));
                                course = AltosParse.parse_int(words[i++]);
-                               climb_rate = AltosParse.parse_double(AltosParse.strip_suffix(words[i++], "m/s(V)"));
-                               hdop = AltosParse.parse_double(AltosParse.strip_suffix(words[i++], "(hdop)"));
+                               climb_rate = AltosParse.parse_double_net(AltosParse.strip_suffix(words[i++], "m/s(V)"));
+                               hdop = AltosParse.parse_double_net(AltosParse.strip_suffix(words[i++], "(hdop)"));
                                h_error = AltosParse.parse_int(words[i++]);
                                v_error = AltosParse.parse_int(words[i++]);
                        }
@@ -377,6 +378,7 @@ public class AltosGPS implements Cloneable {
 
        public AltosGPS (AltosLink link, AltosConfigData config_data) throws TimeoutException, InterruptedException {
                boolean says_done = config_data.compare_version("1.0") >= 0;
+               init();
                link.printf("g\n");
                for (;;) {
                        String line = link.get_reply_no_dialog(5000);