]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/input_output/net_fdm.hxx
Merge branch 'next' of D:\Git_New\flightgear into next
[flightgear.git] / src / FDM / JSBSim / input_output / net_fdm.hxx
1 // net_fdm.hxx -- defines a common net I/O interface to the flight
2 //                dynamics model
3 //
4 // Written by Curtis Olson - http://www.flightgear.org/~curt
5 // Started September 2001.
6 //
7 // This file is in the Public Domain, and comes with no warranty.
8 //
9 // $Id$
10
11
12 #ifndef _NET_FDM_HXX
13 #define _NET_FDM_HXX
14
15
16 #include <time.h> // time_t
17
18 #include <simgear/misc/stdint.hxx> //not required for JSBSim
19
20
21 // NOTE: this file defines an external interface structure.  Due to
22 // variability between platforms and architectures, we only used fixed
23 // length types here.  Specifically, integer types can vary in length.
24 // I am not aware of any platforms that don't use 4 bytes for float
25 // and 8 bytes for double.
26
27 const uint32_t FG_NET_FDM_VERSION = 24;
28
29
30 // Define a structure containing the top level flight dynamics model
31 // parameters
32
33 class FGNetFDM {
34
35 public:
36
37     enum {
38         FG_MAX_ENGINES = 4,
39         FG_MAX_WHEELS = 3,
40         FG_MAX_TANKS = 4
41     };
42
43     uint32_t version;           // increment when data values change
44     uint32_t padding;           // padding
45
46     // Positions
47     double longitude;           // geodetic (radians)
48     double latitude;            // geodetic (radians)
49     double altitude;            // above sea level (meters)
50     float agl;                  // above ground level (meters)
51     float phi;                  // roll (radians)
52     float theta;                // pitch (radians)
53     float psi;                  // yaw or true heading (radians)
54     float alpha;                // angle of attack (radians)
55     float beta;                 // side slip angle (radians)
56
57     // Velocities
58     float phidot;               // roll rate (radians/sec)
59     float thetadot;             // pitch rate (radians/sec)
60     float psidot;               // yaw rate (radians/sec)
61     float vcas;                 // calibrated airspeed
62     float climb_rate;           // feet per second
63     float v_north;              // north velocity in local/body frame, fps
64     float v_east;               // east velocity in local/body frame, fps
65     float v_down;               // down/vertical velocity in local/body frame, fps
66     float v_wind_body_north;    // north velocity in local/body frame
67                                 // relative to local airmass, fps
68     float v_wind_body_east;     // east velocity in local/body frame
69                                 // relative to local airmass, fps
70     float v_wind_body_down;     // down/vertical velocity in local/body
71                                 // frame relative to local airmass, fps
72
73     // Accelerations
74     float A_X_pilot;            // X accel in body frame ft/sec^2
75     float A_Y_pilot;            // Y accel in body frame ft/sec^2
76     float A_Z_pilot;            // Z accel in body frame ft/sec^2
77
78     // Stall
79     float stall_warning;        // 0.0 - 1.0 indicating the amount of stall
80     float slip_deg;             // slip ball deflection
81
82     // Pressure
83     
84     // Engine status
85     uint32_t num_engines;            // Number of valid engines
86     uint32_t eng_state[FG_MAX_ENGINES];// Engine state (off, cranking, running)
87     float rpm[FG_MAX_ENGINES];       // Engine RPM rev/min
88     float fuel_flow[FG_MAX_ENGINES]; // Fuel flow gallons/hr
89     float fuel_px[FG_MAX_ENGINES];   // Fuel pressure psi
90     float egt[FG_MAX_ENGINES];       // Exhuast gas temp deg F
91     float cht[FG_MAX_ENGINES];       // Cylinder head temp deg F
92     float mp_osi[FG_MAX_ENGINES];    // Manifold pressure
93     float tit[FG_MAX_ENGINES];       // Turbine Inlet Temperature
94     float oil_temp[FG_MAX_ENGINES];  // Oil temp deg F
95     float oil_px[FG_MAX_ENGINES];    // Oil pressure psi
96
97     // Consumables
98     uint32_t num_tanks;         // Max number of fuel tanks
99     float fuel_quantity[FG_MAX_TANKS];
100
101     // Gear status
102     uint32_t num_wheels;
103     uint32_t wow[FG_MAX_WHEELS];
104     float gear_pos[FG_MAX_WHEELS];
105     float gear_steer[FG_MAX_WHEELS];
106     float gear_compression[FG_MAX_WHEELS];
107
108     // Environment
109     uint32_t cur_time;           // current unix time
110                                  // FIXME: make this uint64_t before 2038
111     int32_t warp;                // offset in seconds to unix time
112     float visibility;            // visibility in meters (for env. effects)
113
114     // Control surface positions (normalized values)
115     float elevator;
116     float elevator_trim_tab;
117     float left_flap;
118     float right_flap;
119     float left_aileron;
120     float right_aileron;
121     float rudder;
122     float nose_wheel;
123     float speedbrake;
124     float spoilers;
125 };
126
127
128 #endif // _NET_FDM_HXX