]> git.mxchange.org Git - flightgear.git/blob - src/Network/net_gui.hxx
7652ceb7d3f4d9964433c5f2726308b9f58e245c
[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__)
24 typedef signed char      int8_t;
25 typedef signed short     int16_t;
26 typedef signed int       int32_t;
27 typedef signed __int64   int64_t;
28 typedef unsigned char    uint8_t;
29 typedef unsigned short   uint16_t;
30 typedef unsigned int     uint32_t;
31 typedef unsigned __int64 uint64_t;
32 #else
33 # error "Port me! Platforms that don't have <stdint.h> need to define int8_t, et. al."
34 #endif
35
36 const uint16_t FG_NET_GUI_VERSION = 6;
37
38
39 // Define a structure containing the top level flight dynamics model
40 // parameters
41
42 class FGNetGUI {
43
44 public:
45
46     enum {
47         FG_MAX_ENGINES = 4,
48         FG_MAX_WHEELS = 3,
49         FG_MAX_TANKS = 4
50     };
51
52     uint16_t version;           // increment when data values change
53
54     // Positions
55     double longitude;           // geodetic (radians)
56     double latitude;            // geodetic (radians)
57     float altitude;             // above sea level (meters)
58     float agl;                  // above ground level (meters)
59     float phi;                  // roll (radians)
60     float theta;                // pitch (radians)
61     float psi;                  // yaw or true heading (radians)
62
63     // Velocities
64     float vcas;
65     float climb_rate;           // feet per second
66
67     // Consumables
68     uint8_t num_tanks;          // Max number of fuel tanks
69     float fuel_quantity[FG_MAX_TANKS];
70
71     // Environment
72     uint32_t cur_time;          // current unix time
73                                 // FIXME: make this uint64_t before 2038
74     uint32_t warp;              // offset in seconds to unix time
75     float ground_elev;          // ground elev (meters)
76
77     // Approach
78     float tuned_freq;           // currently tuned frequency
79     float nav_radial;           // target nav radial
80     uint8_t in_range;           // tuned navaid is in range?
81     float dist_nm;              // distance to tuned navaid in nautical miles
82     float course_deviation_deg; // degrees off target course
83     float gs_deviation_deg;     // degrees off target glide slope
84 };
85
86
87 #endif // _NET_GUI_HXX