]> git.mxchange.org Git - flightgear.git/blob - src/Network/net_fdm.hxx
Add trim tab deflection to surface positions passed in net_fdm.
[flightgear.git] / src / Network / 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 - curt@flightgear.com, started September 2001.
5 //
6 // This file is in the Public Domain, and comes with no warranty.
7 //
8 // $Id$
9
10
11 #ifndef _NET_FDM_HXX
12 #define _NET_FDM_HXX
13
14
15 #ifndef __cplusplus                                                          
16 # error This library requires C++
17 #endif                                   
18
19 #include <time.h> // time_t
20
21 const int FG_NET_FDM_VERSION = 17;
22
23
24 // Define a structure containing the top level flight dynamics model
25 // parameters
26
27 class FGNetFDM {
28
29 public:
30
31     int version;                // increment when data values change
32     int pad;                    // keep doubles 64-bit aligned for some
33                                 // hardware platforms, such as the Sun
34                                 // SPARC, which don't like misaligned
35                                 // data
36
37     enum {
38         FG_MAX_ENGINES = 4,
39         FG_MAX_WHEELS = 3,
40         FG_MAX_TANKS = 4
41     };
42
43     // Positions
44     double longitude;           // geodetic (radians)
45     double latitude;            // geodetic (radians)
46     double altitude;            // above sea level (meters)
47     float agl;                  // above ground level (meters)
48     float phi;                  // roll (radians)
49     float theta;                // pitch (radians)
50     float psi;                  // yaw or true heading (radians)
51     float alpha;                // angle of attack
52     float beta;                 // side slip angle
53
54     // Velocities
55     float phidot;               // roll rate (radians/sec)
56     float thetadot;             // pitch rate (radians/sec)
57     float psidot;               // yaw rate (radians/sec)
58     float vcas;                 // calibrated airspeed
59     float climb_rate;           // feet per second
60     float v_north;              // north velocity in local/body frame, fps
61     float v_east;               // east velocity in local/body frame, fps
62     float v_down;               // down/vertical velocity in local/body frame, fps
63     float v_wind_body_north;    // north velocity in local/body frame
64                                 // relative to local airmass, fps
65     float v_wind_body_east;     // east velocity in local/body frame
66                                 // relative to local airmass, fps
67     float v_wind_body_down;     // down/vertical velocity in local/body
68                                 // frame relative to local airmass, fps
69
70     // Accelerations
71     float A_X_pilot;            // X accel in body frame ft/sec^2
72     float A_Y_pilot;            // Y accel in body frame ft/sec^2
73     float A_Z_pilot;            // Z accel in body frame ft/sec^2
74
75     // Stall
76     float stall_warning;        // 0.0 - 1.0 indicating the amount of stall
77     float slip_deg;             // slip ball deflection
78
79     // Pressure
80     
81     // Engine status
82     int num_engines;            // Number of valid engines
83     int eng_state[FG_MAX_ENGINES]; // Engine state (off, cranking, running)
84     float rpm[FG_MAX_ENGINES];  // Engine RPM rev/min
85     float fuel_flow[FG_MAX_ENGINES]; // Fuel flow gallons/hr
86     float EGT[FG_MAX_ENGINES];  // Exhuast gas temp deg F
87     float oil_temp[FG_MAX_ENGINES]; // Oil temp deg F
88     float oil_px[FG_MAX_ENGINES]; // Oil pressure psi
89
90     // Consumables
91     int num_tanks;              // Max number of fuel tanks
92     float fuel_quantity[FG_MAX_TANKS];
93
94     // Gear status
95     int num_wheels;
96     bool wow[FG_MAX_WHEELS];
97     float gear_pos[FG_MAX_WHEELS];
98     float gear_steer[FG_MAX_WHEELS];
99     float gear_compression[FG_MAX_WHEELS];
100
101     // Environment
102     time_t cur_time;            // current unix time
103     long int warp;              // offset in seconds to unix time
104     float visibility;           // visibility in meters (for env. effects)
105
106     // Control surface positions (normalized values)
107     float elevator;
108     float elevator_trim_tab;
109     float flaps;
110     float left_aileron;
111     float right_aileron;
112     float rudder;
113     float nose_wheel;
114     float speedbrake;
115     float spoilers;
116 };
117
118
119 #endif // _NET_FDM_HXX