docs: Document altosui "Graph Data" button
[fw/altos] / ao-tools / altosui / AltosEepromIterable.java
index 2f1e7e9066db2e94f0a3d4bae33ccfd76c1764dc..f8e6d7e5a2e16126755d4d7568be479d42445074 100644 (file)
@@ -28,14 +28,6 @@ import java.text.*;
 import java.util.prefs.*;
 import java.util.concurrent.LinkedBlockingQueue;
 
-import altosui.AltosRecord;
-import altosui.AltosState;
-import altosui.AltosDeviceDialog;
-import altosui.AltosPreferences;
-import altosui.AltosLog;
-import altosui.AltosVoice;
-import altosui.AltosEepromMonitor;
-
 /*
  * AltosRecords with an index field so they can be sorted by tick while preserving
  * the original ordering for elements with matching ticks
@@ -317,6 +309,12 @@ public class AltosEepromIterable extends AltosRecordIterable {
                int flags = (good.b >> 8);
                int seconds = hour * 3600 + minute * 60 + second;
 
+               /* Make sure this looks like a good GPS value */
+               if ((flags & Altos.AO_GPS_NUM_SAT_MASK) >> Altos.AO_GPS_NUM_SAT_SHIFT < 4)
+                       flags = (flags & ~Altos.AO_GPS_NUM_SAT_MASK) | (4 << Altos.AO_GPS_NUM_SAT_SHIFT);
+               flags |= Altos.AO_GPS_RUNNING;
+               flags |= Altos.AO_GPS_VALID;
+
                int new_seconds = seconds + diff;
                if (new_seconds < 0)
                        new_seconds += 24 * 3600;