Integrate flite into aoview directly. Fix great circle computation.
[fw/altos] / aoview / aoview.h
index a3214128b480b38720a1010eaf67355a90741ce6..7807b2facb74580de34caf70d970892a6e00e0f5 100644 (file)
 
 #define _GNU_SOURCE
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -58,6 +62,11 @@ struct aostate {
        int     batt;
        int     drogue;
        int     main;
+       int     flight_accel;
+       int     ground_accel;
+       int     flight_vel;
+       int     flight_pres;
+       int     ground_pres;
        int     nsat;
        int     locked;
        struct {
@@ -65,26 +74,72 @@ struct aostate {
                int minute;
                int second;
        } gps_time;
-       double  lat;
-       double  lon;
-       int     alt;
+       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 */
+
+       /* derived data */
+
+       gboolean        ascent; /* going up? */
+
+       int     ground_altitude;
+       int     height;
+       double  speed;
+       double  acceleration;
+       double  battery;
+       double  temperature;
+       double  main_sense;
+       double  drogue_sense;
+
+       int     max_height;
+       double  max_acceleration;
+       double  max_speed;
+
+       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;
 };
 
+/* GPS is 'stable' when we've seen at least this many samples */
+#define MIN_PAD_SAMPLES        10
+
 void
 aoview_monitor_disconnect(void);
 
-void
+gboolean
 aoview_monitor_connect(char *tty);
 
+gboolean
+aoview_monitor_parse(char *line);
+
+void
+aoview_monitor_reset(void);
+
 struct aoview_serial *
 aoview_serial_open(const char *tty);
 
 void
 aoview_serial_close(struct aoview_serial *serial);
 
+typedef void (*aoview_serial_callback)(gpointer user_data, struct aoview_serial *serial, gint revents);
+
 void
 aoview_serial_set_callback(struct aoview_serial *serial,
-                          GSourceFunc func,
+                          aoview_serial_callback func,
                           gpointer data,
                           GDestroyNotify notify);
 
@@ -109,6 +164,9 @@ aoview_usbdev_free(struct usbdev *usbdev);
 void
 aoview_state_notify(struct aostate *state);
 
+void
+aoview_state_new(void);
+
 void
 aoview_state_init(GladeXML *xml);
 
@@ -142,6 +200,9 @@ aoview_log_get_serial(void);
 void
 aoview_log_printf(char *format, ...);
 
+void
+aoview_log_new(void);
+
 void
 aoview_table_start(void);
 
@@ -154,5 +215,71 @@ aoview_table_finish(void);
 void
 aoview_table_init(GladeXML *xml);
 
+void
+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);
+
+int
+aoview_file_get_serial(struct aoview_file *file);
+
+void
+aoview_file_printf(struct aoview_file *file, char *format, ...);
+
+void
+aoview_file_vprintf(struct aoview_file *file, char *format, va_list ap);
+
+struct aoview_file *
+aoview_file_new(char *ext);
+
+void
+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_ */