X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=aoview%2Faoview.h;h=62d0640b9a182b42101263cea45ff3a1936729b6;hp=d49bd6f4968e656d45a5ecc4194f0773a605cf27;hb=d7c2d358ed8a1afc9f0ba2bd830b10f6b56dc7b1;hpb=2e06772c8b6fd74f86e640ed97f0d5bc8c095c2f diff --git a/aoview/aoview.h b/aoview/aoview.h index d49bd6f4..62d0640b 100644 --- a/aoview/aoview.h +++ b/aoview/aoview.h @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -50,7 +51,31 @@ struct usbdev { int idVendor; }; -struct aostate { +struct aogps_time { + int hour; + int minute; + int second; +}; + +struct aogps { + int nsat; + int gps_locked; + int gps_connected; + struct aogps_time gps_time; + double lat; /* degrees (+N -S) */ + double lon; /* degrees (+E -W) */ + int alt; /* m */ + + int gps_extended; /* has extra data */ + double ground_speed; /* m/s */ + int course; /* degrees */ + double climb_rate; /* m/s */ + double hdop; /* unitless? */ + int h_error; /* m */ + int v_error; /* m */ +}; + +struct aodata { char callsign[16]; int serial; int rssi; @@ -67,25 +92,18 @@ struct aostate { int flight_vel; int flight_pres; int ground_pres; - int nsat; - int locked; - struct { - int hour; - int minute; - int second; - } gps_time; - double lat; /* degrees (+N -S) */ - double lon; /* degrees (+E -W) */ - int alt; /* m */ - double ground_speed; /* m/s */ - int course; /* degrees */ - double climb_rate; /* m/s */ - double hdop; /* unitless? */ - int h_error; /* m */ - int v_error; /* m */ + struct aogps gps; +}; + +struct aostate { + struct aodata data; /* derived data */ + struct aodata prev_data; + + double report_time; + gboolean ascent; /* going up? */ int ground_altitude; @@ -96,11 +114,15 @@ struct aostate { double temperature; double main_sense; double drogue_sense; + double baro_speed; int max_height; double max_acceleration; double max_speed; + struct aogps gps; + + int gps_valid; double pad_lat; double pad_lon; double pad_alt; @@ -108,11 +130,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 @@ -123,7 +152,10 @@ gboolean aoview_monitor_connect(char *tty); gboolean -aoview_monitor_parse(char *line); +aoview_monitor_parse(const char *line); + +void +aoview_monitor_reset(void); struct aoview_serial * aoview_serial_open(const char *tty); @@ -135,9 +167,7 @@ typedef void (*aoview_serial_callback)(gpointer user_data, struct aoview_serial void aoview_serial_set_callback(struct aoview_serial *serial, - aoview_serial_callback func, - gpointer data, - GDestroyNotify notify); + aoview_serial_callback func); void aoview_serial_printf(struct aoview_serial *serial, char *format, ...); @@ -158,7 +188,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); @@ -203,7 +233,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); @@ -270,4 +300,12 @@ void aoview_label_init(GladeXML *xml); void aoview_label_show(struct aostate *state); +/* aoview_flite.c */ + +FILE * +aoview_flite_start(void); + +void +aoview_flite_stop(void); + #endif /* _AOVIEW_H_ */