X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosEepromMetrum2.java;h=d137614a8949a30069d771d50260b7d8d921d6a1;hb=ae1174317fc476e39077f7dc257ec08709c6b301;hp=3b49483960bba25e18127c66a6f9218a8d8e47ad;hpb=528e2e41112cad8a81bccbb89c3bd202b818a506;p=fw%2Faltos diff --git a/altoslib/AltosEepromMetrum2.java b/altoslib/AltosEepromMetrum2.java index 3b494839..d137614a 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_1; +package org.altusmetrum.altoslib_4; import java.io.*; import java.util.*; @@ -59,7 +59,7 @@ public class AltosEepromMetrum2 extends AltosEeprom { public int year() { return data8(4); } public int month() { return data8(5); } public int day() { return data8(6); } - + /* AO_LOG_GPS_SAT elements */ public int nsat() { return data8(0); } public int more() { return data8(1); } @@ -133,12 +133,11 @@ public class AltosEepromMetrum2 extends AltosEeprom { gps.nsat = (flags & AltosLib.AO_GPS_NUM_SAT_MASK) >> AltosLib.AO_GPS_NUM_SAT_SHIFT; - gps.year = year(); + gps.year = 2000 + year(); gps.month = month(); gps.day = day(); break; case AltosLib.AO_LOG_GPS_SAT: - state.set_tick(tick); gps = state.make_temp_gps(true); int n = nsat(); @@ -153,7 +152,7 @@ public class AltosEepromMetrum2 extends AltosEeprom { } static public LinkedList read(FileInputStream input) { - LinkedList megas = new LinkedList(); + LinkedList metrums = new LinkedList(); for (;;) { try { @@ -161,9 +160,10 @@ public class AltosEepromMetrum2 extends AltosEeprom { if (line == null) break; try { - AltosEepromMetrum2 mega = new AltosEepromMetrum2(line); - if (mega.cmd != AltosLib.AO_LOG_INVALID) - megas.add(mega); + AltosEepromMetrum2 metrum = new AltosEepromMetrum2(line); + + if (metrum.cmd != AltosLib.AO_LOG_INVALID) + metrums.add(metrum); } catch (Exception e) { System.out.printf ("exception\n"); } @@ -172,6 +172,6 @@ public class AltosEepromMetrum2 extends AltosEeprom { } } - return megas; + return metrums; } }