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>
64 struct aogps_time gps_time;
65 double lat; /* degrees (+N -S) */
66 double lon; /* degrees (+E -W) */
69 int gps_extended; /* has extra data */
70 double ground_speed; /* m/s */
71 int course; /* degrees */
72 double climb_rate; /* m/s */
73 double hdop; /* unitless? */
103 struct aodata prev_data;
107 gboolean ascent; /* going up? */
120 double max_acceleration;
129 double pad_lat_total;
130 double pad_lon_total;
131 double pad_alt_total;
143 extern struct aostate aostate;
145 /* GPS is 'stable' when we've seen at least this many samples */
146 #define MIN_PAD_SAMPLES 10
149 aoview_monitor_disconnect(void);
152 aoview_monitor_connect(char *tty);
155 aoview_monitor_parse(const char *line);
158 aoview_monitor_reset(void);
160 struct aoview_serial *
161 aoview_serial_open(const char *tty);
164 aoview_serial_close(struct aoview_serial *serial);
166 typedef void (*aoview_serial_callback)(gpointer user_data, struct aoview_serial *serial, gint revents);
169 aoview_serial_set_callback(struct aoview_serial *serial,
170 aoview_serial_callback func);
173 aoview_serial_printf(struct aoview_serial *serial, char *format, ...);
176 aoview_serial_read(struct aoview_serial *serial, char *buf, int len);
179 aoview_serial_getc(struct aoview_serial *serial);
182 aoview_dev_dialog_init(GladeXML *xml);
185 aoview_usb_scan(struct usbdev ***devs_ret);
188 aoview_usbdev_free(struct usbdev *usbdev);
191 aoview_state_notify(struct aodata *data);
194 aoview_state_new(void);
197 aoview_state_init(GladeXML *xml);
200 aoview_pres_to_altitude(int16_t pres);
203 aoview_altitude_to_pres(int16_t alt);
206 aoview_fullname (char *dir, char *file);
209 aoview_basename(char *file);
212 aoview_add_plain_text_column (GtkTreeView *view, const gchar *title, gint model_column, gint width);
215 aoview_mkdir(char *dir);
218 aoview_log_init(GladeXML *xml);
221 aoview_log_set_serial(int serial);
224 aoview_log_get_serial(void);
227 aoview_log_printf(char *format, ...);
230 aoview_log_new(void);
233 aoview_table_start(void);
236 aoview_table_add_row(int column, char *label, char *format, ...);
239 aoview_table_finish(void);
242 aoview_table_init(GladeXML *xml);
245 aoview_table_clear(void);
249 extern char *aoview_file_dir;
252 aoview_file_finish(struct aoview_file *file);
255 aoview_file_start(struct aoview_file *file);
258 aoview_file_name(struct aoview_file *file);
261 aoview_file_set_serial(struct aoview_file *file, int serial);
264 aoview_file_get_serial(struct aoview_file *file);
267 aoview_file_printf(struct aoview_file *file, char *format, ...);
270 aoview_file_vprintf(struct aoview_file *file, char *format, va_list ap);
273 aoview_file_new(char *ext);
276 aoview_file_destroy(struct aoview_file *file);
279 aoview_file_init(GladeXML *xml);
281 /* aoview_eeprom.c */
284 aoview_eeprom_save(const char *device);
287 aoview_eeprom_init(GladeXML *xml);
290 void aoview_voice_open(void);
292 void aoview_voice_close(void);
294 void aoview_voice_speak(char *format, ...);
298 void aoview_label_init(GladeXML *xml);
301 aoview_label_show(struct aostate *state);
306 aoview_flite_start(void);
309 aoview_flite_stop(void);
313 extern char *aoview_tty;
315 #endif /* _AOVIEW_H_ */