projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/lpc,altos/stmf0: Use -n flag to work around link editor issue
[fw/altos]
/
altoslib
/
AltosEepromMetrum2.java
diff --git
a/altoslib/AltosEepromMetrum2.java
b/altoslib/AltosEepromMetrum2.java
index f1bca6dc14344b118597ce25dafc1eb877e7f453..f685b3ce0e7eb2355d5f9e9fc1dca9fb57c0fcf5 100644
(file)
--- a/
altoslib/AltosEepromMetrum2.java
+++ b/
altoslib/AltosEepromMetrum2.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
*
* 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
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-15,7
+16,7
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_
3
;
+package org.altusmetrum.altoslib_
11
;
import java.io.*;
import java.util.*;
import java.io.*;
import java.util.*;
@@
-49,7
+50,8
@@
public class AltosEepromMetrum2 extends AltosEeprom {
/* AO_LOG_GPS_POS elements */
public int latitude() { return data32(0); }
public int longitude() { return data32(4); }
/* 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); }
/* AO_LOG_GPS_TIME elements */
public int hour() { return data8(0); }
@@
-59,7
+61,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 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); }
/* AO_LOG_GPS_SAT elements */
public int nsat() { return data8(0); }
public int more() { return data8(1); }
@@
-117,7
+120,10
@@
public class AltosEepromMetrum2 extends AltosEeprom {
gps = state.make_temp_gps(false);
gps.lat = latitude() / 1e7;
gps.lon = longitude() / 1e7;
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);
break;
case AltosLib.AO_LOG_GPS_TIME:
gps = state.make_temp_gps(false);
@@
-136,6
+142,7
@@
public class AltosEepromMetrum2 extends AltosEeprom {
gps.year = 2000 + year();
gps.month = month();
gps.day = day();
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);
break;
case AltosLib.AO_LOG_GPS_SAT:
gps = state.make_temp_gps(true);
@@
-161,7
+168,7
@@
public class AltosEepromMetrum2 extends AltosEeprom {
break;
try {
AltosEepromMetrum2 metrum = new AltosEepromMetrum2(line);
break;
try {
AltosEepromMetrum2 metrum = new AltosEepromMetrum2(line);
-
+
if (metrum.cmd != AltosLib.AO_LOG_INVALID)
metrums.add(metrum);
} catch (Exception e) {
if (metrum.cmd != AltosLib.AO_LOG_INVALID)
metrums.add(metrum);
} catch (Exception e) {