X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=aoview%2Faoview.h;h=800349ec09c68ed9b1f1ce054e40dcd3e434a9b7;hb=ddfa2308c0be4c002f982ae9da6032ee7854117d;hp=5c118a111d64d8f2a3eb59c4ce13c12d702ee565;hpb=19630ef084866f4230e68ccf11284b30c68128b1;p=fw%2Faltos diff --git a/aoview/aoview.h b/aoview/aoview.h index 5c118a11..800349ec 100644 --- a/aoview/aoview.h +++ b/aoview/aoview.h @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -50,7 +51,7 @@ struct usbdev { int idVendor; }; -struct aostate { +struct aodata { char callsign[16]; int serial; int rssi; @@ -68,7 +69,8 @@ struct aostate { int flight_pres; int ground_pres; int nsat; - int locked; + int gps_locked; + int gps_connected; struct { int hour; int minute; @@ -83,9 +85,17 @@ struct aostate { double hdop; /* unitless? */ int h_error; /* m */ int v_error; /* m */ +}; + +struct aostate { + struct aodata data; /* derived data */ + struct aodata prev_data; + + double report_time; + gboolean ascent; /* going up? */ int ground_altitude; @@ -96,11 +106,16 @@ struct aostate { double temperature; double main_sense; double drogue_sense; + double baro_speed; int max_height; double max_acceleration; double max_speed; + double lat; + double lon; + int gps_valid; + double pad_lat; double pad_lon; double pad_alt; @@ -108,12 +123,18 @@ struct aostate { double pad_lon_total; double pad_alt_total; int npad; + int prev_npad; double distance; double bearing; int gps_height; + + int speak_tick; + int speak_altitude; }; +extern struct aostate aostate; + /* GPS is 'stable' when we've seen at least this many samples */ #define MIN_PAD_SAMPLES 10 @@ -162,7 +183,7 @@ void aoview_usbdev_free(struct usbdev *usbdev); void -aoview_state_notify(struct aostate *state); +aoview_state_notify(struct aodata *data); void aoview_state_new(void); @@ -207,7 +228,7 @@ void aoview_table_start(void); void -aoview_table_add_row(char *label, char *format, ...); +aoview_table_add_row(int column, char *label, char *format, ...); void aoview_table_finish(void);