X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=aoview%2Faoview.h;h=ac64833fb3e301d9ab1f27ec461da39166b207ca;hp=6fb5e0988c691918fff4ee9172df94596668270f;hb=80cadf44f5f1accd6ddfca25c2af8d4d424f26d9;hpb=527d7c803ed9597b210634018cb2eb9d048d9846 diff --git a/aoview/aoview.h b/aoview/aoview.h index 6fb5e098..ac64833f 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; @@ -85,12 +86,68 @@ struct aostate { 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; + int height; + double speed; + double acceleration; + double battery; + 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; + double pad_lat_total; + double pad_lon_total; + double pad_alt_total; + int 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 + void aoview_monitor_disconnect(void); gboolean aoview_monitor_connect(char *tty); +gboolean +aoview_monitor_parse(const char *line); + +void +aoview_monitor_reset(void); + struct aoview_serial * aoview_serial_open(const char *tty); @@ -124,7 +181,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); @@ -182,6 +239,8 @@ aoview_table_clear(void); struct aoview_file; +extern char *aoview_file_dir; + void aoview_file_finish(struct aoview_file *file); @@ -220,4 +279,26 @@ aoview_eeprom_save(const char *device); void aoview_eeprom_init(GladeXML *xml); +/* aoview_voice.c */ +void aoview_voice_open(void); + +void aoview_voice_close(void); + +void aoview_voice_speak(char *format, ...); + +/* aoview_label.c */ + +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_ */