X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=aoview%2Faoview.h;h=b4d1315968ba248284f57678501dd639c223bed8;hp=7b5f0de5b7c5dd2ced0639032550ee4796721593;hb=31d5670a9144b943ce9c8cb00deb5fb659af0b1c;hpb=aa6d87aeb616dd62f0debaded297232022b4f8bd diff --git a/aoview/aoview.h b/aoview/aoview.h index 7b5f0de5..b4d13159 100644 --- a/aoview/aoview.h +++ b/aoview/aoview.h @@ -20,6 +20,10 @@ #define _GNU_SOURCE +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -31,6 +35,7 @@ #include #include #include +#include #include #include @@ -46,7 +51,7 @@ struct usbdev { int idVendor; }; -struct aostate { +struct aodata { char callsign[16]; int serial; int rssi; @@ -70,17 +75,80 @@ struct aostate { 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 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 alt; + 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; + 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 + 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); @@ -114,7 +182,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); @@ -159,7 +227,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); @@ -172,12 +240,17 @@ aoview_table_clear(void); struct aoview_file; +extern char *aoview_file_dir; + void aoview_file_finish(struct aoview_file *file); gboolean aoview_file_start(struct aoview_file *file); +const char * +aoview_file_name(struct aoview_file *file); + void aoview_file_set_serial(struct aoview_file *file, int serial); @@ -199,4 +272,34 @@ aoview_file_destroy(struct aoview_file *file); void aoview_file_init(GladeXML *xml); +/* aoview_eeprom.c */ + +gboolean +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_ */