2 * Copyright © 2009 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
35 #include <sys/types.h>
41 #include <glade/glade.h>
42 #include <gconf/gconf-client.h>
79 double lat; /* degrees (+N -S) */
80 double lon; /* degrees (+E -W) */
82 double ground_speed; /* m/s */
83 int course; /* degrees */
84 double climb_rate; /* m/s */
85 double hdop; /* unitless? */
95 struct aodata prev_data;
99 gboolean ascent; /* going up? */
112 double max_acceleration;
122 double pad_lat_total;
123 double pad_lon_total;
124 double pad_alt_total;
136 extern struct aostate aostate;
138 /* GPS is 'stable' when we've seen at least this many samples */
139 #define MIN_PAD_SAMPLES 10
142 aoview_monitor_disconnect(void);
145 aoview_monitor_connect(char *tty);
148 aoview_monitor_parse(const char *line);
151 aoview_monitor_reset(void);
153 struct aoview_serial *
154 aoview_serial_open(const char *tty);
157 aoview_serial_close(struct aoview_serial *serial);
159 typedef void (*aoview_serial_callback)(gpointer user_data, struct aoview_serial *serial, gint revents);
162 aoview_serial_set_callback(struct aoview_serial *serial,
163 aoview_serial_callback func);
166 aoview_serial_printf(struct aoview_serial *serial, char *format, ...);
169 aoview_serial_read(struct aoview_serial *serial, char *buf, int len);
172 aoview_serial_getc(struct aoview_serial *serial);
175 aoview_dev_dialog_init(GladeXML *xml);
178 aoview_usb_scan(struct usbdev ***devs_ret);
181 aoview_usbdev_free(struct usbdev *usbdev);
184 aoview_state_notify(struct aodata *data);
187 aoview_state_new(void);
190 aoview_state_init(GladeXML *xml);
193 aoview_pres_to_altitude(int16_t pres);
196 aoview_altitude_to_pres(int16_t alt);
199 aoview_fullname (char *dir, char *file);
202 aoview_basename(char *file);
205 aoview_add_plain_text_column (GtkTreeView *view, const gchar *title, gint model_column, gint width);
208 aoview_mkdir(char *dir);
211 aoview_log_init(GladeXML *xml);
214 aoview_log_set_serial(int serial);
217 aoview_log_get_serial(void);
220 aoview_log_printf(char *format, ...);
223 aoview_log_new(void);
226 aoview_table_start(void);
229 aoview_table_add_row(int column, char *label, char *format, ...);
232 aoview_table_finish(void);
235 aoview_table_init(GladeXML *xml);
238 aoview_table_clear(void);
242 extern char *aoview_file_dir;
245 aoview_file_finish(struct aoview_file *file);
248 aoview_file_start(struct aoview_file *file);
251 aoview_file_name(struct aoview_file *file);
254 aoview_file_set_serial(struct aoview_file *file, int serial);
257 aoview_file_get_serial(struct aoview_file *file);
260 aoview_file_printf(struct aoview_file *file, char *format, ...);
263 aoview_file_vprintf(struct aoview_file *file, char *format, va_list ap);
266 aoview_file_new(char *ext);
269 aoview_file_destroy(struct aoview_file *file);
272 aoview_file_init(GladeXML *xml);
274 /* aoview_eeprom.c */
277 aoview_eeprom_save(const char *device);
280 aoview_eeprom_init(GladeXML *xml);
283 void aoview_voice_open(void);
285 void aoview_voice_close(void);
287 void aoview_voice_speak(char *format, ...);
291 void aoview_label_init(GladeXML *xml);
294 aoview_label_show(struct aostate *state);
299 aoview_flite_start(void);
302 aoview_flite_stop(void);
304 #endif /* _AOVIEW_H_ */