diff options
author | Bdale Garbee <bdale@gag.com> | 2009-08-19 00:49:24 -0600 |
---|---|---|
committer | Bdale Garbee <bdale@gag.com> | 2009-08-19 00:49:24 -0600 |
commit | 4486d9156e19e4280b42bcd422d81d04f2d04a92 (patch) | |
tree | d0313710d9040f63c6cb2f5f3d4b11c6208525f7 /ao-view/aoview_state.c | |
parent | dd09f0bc2b950c00f3b489878cd69ad8a003f46c (diff) | |
parent | 33edd62992a32b0ec8ca66d879fa300871db5937 (diff) |
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos0.5
Diffstat (limited to 'ao-view/aoview_state.c')
-rw-r--r-- | ao-view/aoview_state.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ao-view/aoview_state.c b/ao-view/aoview_state.c index 7efd33b0..f75066dd 100644 --- a/ao-view/aoview_state.c +++ b/ao-view/aoview_state.c @@ -168,6 +168,8 @@ aoview_state_derive(struct aodata *data, struct aostate *state) aoview_great_circle(state->pad_lat, state->pad_lon, state->gps.lat, state->gps.lon, &state->distance, &state->bearing); } + if (data->gps_tracking.channels) + state->gps_tracking = data->gps_tracking; if (state->npad) { state->gps_height = state->gps.alt - state->pad_alt; } else { @@ -308,6 +310,7 @@ aoview_state_notify(struct aodata *data) if (state->gps_valid) { aoview_state_add_deg(1, "Latitude", state->gps.lat, 'N', 'S'); aoview_state_add_deg(1, "Longitude", state->gps.lon, 'E', 'W'); + aoview_table_add_row(1, "GPS altitude", "%d", state->gps.alt); aoview_table_add_row(1, "GPS height", "%d", state->gps_height); aoview_table_add_row(1, "GPS time", "%02d:%02d:%02d", state->gps.gps_time.hour, @@ -330,6 +333,27 @@ aoview_state_notify(struct aodata *data) aoview_state_add_deg(1, "Pad longitude", state->pad_lon, 'E', 'W'); aoview_table_add_row(1, "Pad GPS alt", "%gm", state->pad_alt); } + if (state->gps.gps_connected) { + int nsat_vis = 0; + int nsat_locked = 0; + int c; + + for (c = 0; c < state->gps_tracking.channels; c++) { + if ((state->gps_tracking.sats[c].state & 0xff) == 0xbf) + nsat_locked++; + } + aoview_table_add_row(2, "Satellites Visible", "%d", state->gps_tracking.channels); + aoview_table_add_row(2, "Satellites Locked", "%d", nsat_locked); + for (c = 0; c < state->gps_tracking.channels; c++) { + aoview_table_add_row(2, "Satellite id,state,C/N0", + "%3d,%02x,%2d%s", + state->gps_tracking.sats[c].svid, + state->gps_tracking.sats[c].state, + state->gps_tracking.sats[c].c_n0, + (state->gps_tracking.sats[c].state & 0xff) == 0xbf ? + " LOCKED" : ""); + } + } aoview_table_finish(); aoview_label_show(state); aoview_speak_state(state); |