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,
165 GDestroyNotify notify);
168 aoview_serial_printf(struct aoview_serial *serial, char *format, ...);
171 aoview_serial_read(struct aoview_serial *serial, char *buf, int len);
174 aoview_serial_getc(struct aoview_serial *serial);
177 aoview_dev_dialog_init(GladeXML *xml);
180 aoview_usb_scan(struct usbdev ***devs_ret);
183 aoview_usbdev_free(struct usbdev *usbdev);
186 aoview_state_notify(struct aodata *data);
189 aoview_state_new(void);
192 aoview_state_init(GladeXML *xml);
195 aoview_pres_to_altitude(int16_t pres);
198 aoview_altitude_to_pres(int16_t alt);
201 aoview_fullname (char *dir, char *file);
204 aoview_basename(char *file);
207 aoview_add_plain_text_column (GtkTreeView *view, const gchar *title, gint model_column, gint width);
210 aoview_mkdir(char *dir);
213 aoview_log_init(GladeXML *xml);
216 aoview_log_set_serial(int serial);
219 aoview_log_get_serial(void);
222 aoview_log_printf(char *format, ...);
225 aoview_log_new(void);
228 aoview_table_start(void);
231 aoview_table_add_row(int column, char *label, char *format, ...);
234 aoview_table_finish(void);
237 aoview_table_init(GladeXML *xml);
240 aoview_table_clear(void);
244 extern char *aoview_file_dir;
247 aoview_file_finish(struct aoview_file *file);
250 aoview_file_start(struct aoview_file *file);
253 aoview_file_name(struct aoview_file *file);
256 aoview_file_set_serial(struct aoview_file *file, int serial);
259 aoview_file_get_serial(struct aoview_file *file);
262 aoview_file_printf(struct aoview_file *file, char *format, ...);
265 aoview_file_vprintf(struct aoview_file *file, char *format, va_list ap);
268 aoview_file_new(char *ext);
271 aoview_file_destroy(struct aoview_file *file);
274 aoview_file_init(GladeXML *xml);
276 /* aoview_eeprom.c */
279 aoview_eeprom_save(const char *device);
282 aoview_eeprom_init(GladeXML *xml);
285 void aoview_voice_open(void);
287 void aoview_voice_close(void);
289 void aoview_voice_speak(char *format, ...);
293 void aoview_label_init(GladeXML *xml);
296 aoview_label_show(struct aostate *state);
301 aoview_flite_start(void);
304 aoview_flite_stop(void);
306 #endif /* _AOVIEW_H_ */