]> git.mxchange.org Git - flightgear.git/blob - src/Network/net_gui.hxx
c69a1d291984977f4ea517edf0e3fb48aa074091
[flightgear.git] / src / Network / net_gui.hxx
1 // net_gui.hxx -- defines a simple subset I/O interface to the flight
2 //                     dynamics model variables
3 //
4 // Written by Curtis Olson - curt@flightgear.com, started January 2002.
5 //
6 // This file is in the Public Domain, and comes with no warranty.
7 //
8 // $Id$
9
10
11 #ifndef _NET_GUI_HXX
12 #define _NET_GUI_HXX
13
14
15 // NOTE: this file defines an external interface structure.  Due to
16 // variability between platforms and architectures, we only used fixed
17 // length types here.  Specifically, integer types can vary in length.
18 // I am not aware of any platforms that don't use 4 bytes for float
19 // and 8 bytes for double.
20
21 #ifdef HAVE_STDINT_H
22 # include <stdint.h>
23 #elif defined( _MSC_VER ) || defined(__MINGW32__) || defined(sun)
24 typedef signed short     int16_t;
25 typedef signed int       int32_t;
26 typedef unsigned short   uint16_t;
27 typedef unsigned int     uint32_t;
28 #else
29 # error "Port me! Platforms that don't have <stdint.h> need to define int8_t, et. al."
30 #endif
31
32 const uint32_t FG_NET_GUI_VERSION = 7;
33
34
35 // Define a structure containing the top level flight dynamics model
36 // parameters
37
38 class FGNetGUI {
39
40 public:
41
42     enum {
43         FG_MAX_ENGINES = 4,
44         FG_MAX_WHEELS = 3,
45         FG_MAX_TANKS = 4
46     };
47
48     uint32_t version;           // increment when data values change
49
50     // Positions
51     double longitude;           // geodetic (radians)
52     double latitude;            // geodetic (radians)
53     float altitude;             // above sea level (meters)
54     float agl;                  // above ground level (meters)
55     float phi;                  // roll (radians)
56     float theta;                // pitch (radians)
57     float psi;                  // yaw or true heading (radians)
58
59     // Velocities
60     float vcas;
61     float climb_rate;           // feet per second
62
63     // Consumables
64     uint32_t num_tanks;         // Max number of fuel tanks
65     float fuel_quantity[FG_MAX_TANKS];
66
67     // Environment
68     uint32_t cur_time;          // current unix time
69                                 // FIXME: make this uint64_t before 2038
70     uint32_t warp;              // offset in seconds to unix time
71     float ground_elev;          // ground elev (meters)
72
73     // Approach
74     float tuned_freq;           // currently tuned frequency
75     float nav_radial;           // target nav radial
76     uint32_t in_range;           // tuned navaid is in range?
77     float dist_nm;              // distance to tuned navaid in nautical miles
78     float course_deviation_deg; // degrees off target course
79     float gs_deviation_deg;     // degrees off target glide slope
80 };
81
82
83 #endif // _NET_GUI_HXX