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>
78 double lat; /* degrees (+N -S) */
79 double lon; /* degrees (+E -W) */
81 double ground_speed; /* m/s */
82 int course; /* degrees */
83 double climb_rate; /* m/s */
84 double hdop; /* unitless? */
94 struct aodata prev_data;
98 gboolean ascent; /* going up? */
111 double max_acceleration;
121 double pad_lat_total;
122 double pad_lon_total;
123 double pad_alt_total;
135 extern struct aostate aostate;
137 /* GPS is 'stable' when we've seen at least this many samples */
138 #define MIN_PAD_SAMPLES 10
141 aoview_monitor_disconnect(void);
144 aoview_monitor_connect(char *tty);
147 aoview_monitor_parse(const char *line);
150 aoview_monitor_reset(void);
152 struct aoview_serial *
153 aoview_serial_open(const char *tty);
156 aoview_serial_close(struct aoview_serial *serial);
158 typedef void (*aoview_serial_callback)(gpointer user_data, struct aoview_serial *serial, gint revents);
161 aoview_serial_set_callback(struct aoview_serial *serial,
162 aoview_serial_callback func,
164 GDestroyNotify notify);
167 aoview_serial_printf(struct aoview_serial *serial, char *format, ...);
170 aoview_serial_read(struct aoview_serial *serial, char *buf, int len);
173 aoview_serial_getc(struct aoview_serial *serial);
176 aoview_dev_dialog_init(GladeXML *xml);
179 aoview_usb_scan(struct usbdev ***devs_ret);
182 aoview_usbdev_free(struct usbdev *usbdev);
185 aoview_state_notify(struct aodata *data);
188 aoview_state_new(void);
191 aoview_state_init(GladeXML *xml);
194 aoview_pres_to_altitude(int16_t pres);
197 aoview_altitude_to_pres(int16_t alt);
200 aoview_fullname (char *dir, char *file);
203 aoview_basename(char *file);
206 aoview_add_plain_text_column (GtkTreeView *view, const gchar *title, gint model_column, gint width);
209 aoview_mkdir(char *dir);
212 aoview_log_init(GladeXML *xml);
215 aoview_log_set_serial(int serial);
218 aoview_log_get_serial(void);
221 aoview_log_printf(char *format, ...);
224 aoview_log_new(void);
227 aoview_table_start(void);
230 aoview_table_add_row(int column, char *label, char *format, ...);
233 aoview_table_finish(void);
236 aoview_table_init(GladeXML *xml);
239 aoview_table_clear(void);
243 extern char *aoview_file_dir;
246 aoview_file_finish(struct aoview_file *file);
249 aoview_file_start(struct aoview_file *file);
252 aoview_file_name(struct aoview_file *file);
255 aoview_file_set_serial(struct aoview_file *file, int serial);
258 aoview_file_get_serial(struct aoview_file *file);
261 aoview_file_printf(struct aoview_file *file, char *format, ...);
264 aoview_file_vprintf(struct aoview_file *file, char *format, va_list ap);
267 aoview_file_new(char *ext);
270 aoview_file_destroy(struct aoview_file *file);
273 aoview_file_init(GladeXML *xml);
275 /* aoview_eeprom.c */
278 aoview_eeprom_save(const char *device);
281 aoview_eeprom_init(GladeXML *xml);
284 void aoview_voice_open(void);
286 void aoview_voice_close(void);
288 void aoview_voice_speak(char *format, ...);
292 void aoview_label_init(GladeXML *xml);
295 aoview_label_show(struct aostate *state);
300 aoview_flite_start(void);
303 aoview_flite_stop(void);
305 #endif /* _AOVIEW_H_ */