X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosEepromMetrum2.java;h=d9a65989d8f19bd4e833506d50d97424cbf541b9;hp=c1d62c0c7663fd8c64bdb078657dc3e0fe40512e;hb=ed2a08c50d6b8ebcc8c1d2f15e73c1f2a1e25041;hpb=488a527267decece48e6682e0e0c7fc29cbed329 diff --git a/altoslib/AltosEepromMetrum2.java b/altoslib/AltosEepromMetrum2.java index c1d62c0c..d9a65989 100644 --- a/altoslib/AltosEepromMetrum2.java +++ b/altoslib/AltosEepromMetrum2.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_2; +package org.altusmetrum.altoslib_5; import java.io.*; import java.util.*; @@ -49,7 +49,8 @@ public class AltosEepromMetrum2 extends AltosEeprom { /* AO_LOG_GPS_POS elements */ public int latitude() { return data32(0); } public int longitude() { return data32(4); } - public int altitude() { return data16(8); } + public int altitude_low() { return data16(8); } + public int altitude_high() { return data16(10); } /* AO_LOG_GPS_TIME elements */ public int hour() { return data8(0); } @@ -59,7 +60,8 @@ public class AltosEepromMetrum2 extends AltosEeprom { public int year() { return data8(4); } public int month() { return data8(5); } public int day() { return data8(6); } - + public int pdop() { return data8(7); } + /* AO_LOG_GPS_SAT elements */ public int nsat() { return data8(0); } public int more() { return data8(1); } @@ -117,7 +119,10 @@ public class AltosEepromMetrum2 extends AltosEeprom { gps = state.make_temp_gps(false); gps.lat = latitude() / 1e7; gps.lon = longitude() / 1e7; - gps.alt = altitude(); + if (state.altitude_32()) + gps.alt = (altitude_low() & 0xffff) | (altitude_high() << 16); + else + gps.alt = altitude_low(); break; case AltosLib.AO_LOG_GPS_TIME: gps = state.make_temp_gps(false); @@ -136,6 +141,7 @@ public class AltosEepromMetrum2 extends AltosEeprom { gps.year = 2000 + year(); gps.month = month(); gps.day = day(); + gps.pdop = pdop() / 10.0; break; case AltosLib.AO_LOG_GPS_SAT: gps = state.make_temp_gps(true); @@ -161,7 +167,7 @@ public class AltosEepromMetrum2 extends AltosEeprom { break; try { AltosEepromMetrum2 metrum = new AltosEepromMetrum2(line); - + if (metrum.cmd != AltosLib.AO_LOG_INVALID) metrums.add(metrum); } catch (Exception e) {