summaryrefslogtreecommitdiff
path: root/altosui/AltosUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-08-02 16:33:52 -0700
committerKeith Packard <keithp@keithp.com>2016-08-02 16:55:11 -0700
commita6701283af7ed2b3016a910d6edbe4a5e8304581 (patch)
tree7dfb2ffaa3b28c5ea82e57d3b0959b74cdc301e6 /altosui/AltosUI.java
parent647690dbe084d188ba3973da631871a65f2dc50d (diff)
altoslib: Add a 'seconds' method to AltosGPS
This computes the time in seconds since the epoch from GPS time information. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosUI.java')
-rw-r--r--altosui/AltosUI.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java
index 2121690c..019bbb9e 100644
--- a/altosui/AltosUI.java
+++ b/altosui/AltosUI.java
@@ -546,14 +546,22 @@ public class AltosUI extends AltosUIFrame {
AltosStateIterable eef = record_iterable(file);
for (AltosState state : eef) {
- System.out.printf ("tick %d state %d height %g\n",
- state.tick, state.state(), state.height());
- if ((state.set & AltosState.set_gps) != 0)
- System.out.printf ("time %g lat %g lon %g alt %g\n",
- state.time_since_boost(),
+ if ((state.set & AltosState.set_gps) != 0) {
+ System.out.printf ("time %d %d-%d-%d %d:%d:%d lat %g lon %g alt %g\n",
+ state.gps.seconds(),
+ state.gps.year,
+ state.gps.month,
+ state.gps.day,
+ state.gps.hour,
+ state.gps.minute,
+ state.gps.second,
state.gps.lat,
state.gps.lon,
state.gps.alt);
+ } else {
+ System.out.printf ("tick %d state %d height %g\n",
+ state.tick, state.state(), state.height());
+ }
}
} catch (Exception e) {