diff options
| author | Keith Packard <keithp@keithp.com> | 2009-07-09 20:55:10 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2009-07-09 20:55:10 -0700 |
| commit | 80cadf44f5f1accd6ddfca25c2af8d4d424f26d9 (patch) | |
| tree | 7ac48a9d861d7e7504023573ccfc29d54fa58b3e /aoview/aoview.h | |
| parent | 19630ef084866f4230e68ccf11284b30c68128b1 (diff) | |
Show speed. Format numbers. Timeout and report final status.
The speed value is now shown in the top label bar. Ascent shows
accelerometer-derived data, otherwise it's baro derived.
All of the numbers displayed are now given sensible printf formats so they
don't contain way too many digits.
Instead of doing periodic reporting based on flight tick count, data is
reported every 10 seconds based on wall time. After landing, or when no data
have been received for a while, final flight information is spoken.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'aoview/aoview.h')
| -rw-r--r-- | aoview/aoview.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/aoview/aoview.h b/aoview/aoview.h index 5c118a11..ac64833f 100644 --- a/aoview/aoview.h +++ b/aoview/aoview.h @@ -35,6 +35,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <assert.h> +#include <math.h> #include <gtk/gtk.h> #include <glade/glade.h> @@ -50,7 +51,7 @@ struct usbdev { int idVendor; }; -struct aostate { +struct aodata { char callsign[16]; int serial; int rssi; @@ -83,9 +84,17 @@ struct aostate { double hdop; /* unitless? */ int h_error; /* m */ int v_error; /* m */ +}; + +struct aostate { + struct aodata data; /* derived data */ + struct aodata prev_data; + + double report_time; + gboolean ascent; /* going up? */ int ground_altitude; @@ -96,11 +105,16 @@ struct aostate { double temperature; double main_sense; double drogue_sense; + double baro_speed; int max_height; double max_acceleration; double max_speed; + double lat; + double lon; + int gps_valid; + double pad_lat; double pad_lon; double pad_alt; @@ -112,8 +126,13 @@ struct aostate { double distance; double bearing; int gps_height; + + int speak_tick; + int speak_altitude; }; +extern struct aostate aostate; + /* GPS is 'stable' when we've seen at least this many samples */ #define MIN_PAD_SAMPLES 10 @@ -162,7 +181,7 @@ void aoview_usbdev_free(struct usbdev *usbdev); void -aoview_state_notify(struct aostate *state); +aoview_state_notify(struct aodata *data); void aoview_state_new(void); |
