X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosGPS.java;h=99d48c388d3269c46d3846a2470b0e219ad210bc;hb=1085ec5d57e0ed5d132f2bbdac1a0b6a32c0ab4a;hp=285b5b45aca691e916ec000be19a4feff3f2a0b6;hpb=7339d2379713b5b7e4c4fe6bad89ed93f9d39e82;p=fw%2Faltos diff --git a/altoslib/AltosGPS.java b/altoslib/AltosGPS.java index 285b5b45..99d48c38 100644 --- a/altoslib/AltosGPS.java +++ b/altoslib/AltosGPS.java @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,13 +16,13 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_5; +package org.altusmetrum.altoslib_11; import java.text.*; import java.util.concurrent.*; import java.io.*; -public class AltosGPS implements Cloneable, Serializable { +public class AltosGPS implements Cloneable { public final static int MISSING = AltosLib.MISSING; @@ -195,10 +196,10 @@ public class AltosGPS implements Cloneable, Serializable { 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++]); } @@ -378,6 +379,7 @@ public class AltosGPS implements Cloneable, Serializable { 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);