X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Fao-view%2Faoview_state.c;h=838899a7c64cdc4e08ed70267f105a9fdd8729a7;hb=1a3b4c02a01187f8b7b9a9c97712476d0007ab35;hp=f8f0168546a7b5b488c370940226d2fa2aabd8b6;hpb=1de322b960005c9a16051afa1881fadb00f4bcd6;p=fw%2Faltos diff --git a/ao-tools/ao-view/aoview_state.c b/ao-tools/ao-view/aoview_state.c index f8f01685..838899a7 100644 --- a/ao-tools/ao-view/aoview_state.c +++ b/ao-tools/ao-view/aoview_state.c @@ -99,7 +99,7 @@ aoview_time(void) * Fill out the derived data fields */ static void -aoview_state_derive(struct aodata *data, struct aostate *state) +aoview_state_derive(struct cc_telem *data, struct aostate *state) { int i; double new_height; @@ -274,7 +274,7 @@ aoview_state_reset(void) } void -aoview_state_notify(struct aodata *data) +aoview_state_notify(struct cc_telem *data) { struct aostate *state = &aostate; aoview_state_derive(data, state); @@ -288,6 +288,7 @@ aoview_state_notify(struct aodata *data) aoview_table_add_row(0, "Rocket state", "%s", state->data.state); aoview_table_add_row(0, "Callsign", "%s", state->data.callsign); aoview_table_add_row(0, "Rocket serial", "%d", state->data.serial); + aoview_table_add_row(0, "Rocket flight", "%d", state->data.flight); aoview_table_add_row(0, "RSSI", "%6ddBm", state->data.rssi); aoview_table_add_row(0, "Height", "%6dm", state->height); @@ -314,6 +315,10 @@ aoview_state_notify(struct aodata *data) 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 date", "%04d-%02d-%02d", + state->gps.gps_time.year, + state->gps.gps_time.month, + state->gps.gps_time.day); aoview_table_add_row(1, "GPS time", "%02d:%02d:%02d", state->gps.gps_time.hour, state->gps.gps_time.minute, @@ -337,23 +342,14 @@ aoview_state_notify(struct aodata *data) } 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", + aoview_table_add_row(2, "Satellite id,C/N0", + "%3d,%2d", 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" : ""); + state->gps_tracking.sats[c].c_n0); } } aoview_table_finish();