]> git.mxchange.org Git - flightgear.git/blob - src/Network/net_fdm.hxx
e8262f02199cc398958ace2171da48f15fbaabe8
[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, started September 2001.
5 //
6 // Copyright (C) 2001  Curtis L. Olson  - curt@flightgear.com
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 //
22 // $Id$
23
24
25 #ifndef _NET_FDM_HXX
26 #define _NET_FDM_HXX
27
28
29 #ifndef __cplusplus                                                          
30 # error This library requires C++
31 #endif                                   
32
33 #include <time.h> // time_t
34
35 const int FG_NET_FDM_VERSION = 6;
36
37
38 // Define a structure containing the top level flight dynamics model
39 // parameters
40
41 class FGNetFDM {
42
43 public:
44
45     int version;                // increment when data values change
46     int pad;                    // keep doubles 64-bit aligned for some
47                                 // hardware platforms, such as the Sun
48                                 // SPARC, which don't like misaligned
49                                 // data
50
51     static const int FG_MAX_ENGINES = 4;
52     static const int FG_MAX_WHEELS = 3;
53     static const int FG_MAX_TANKS = 2;
54
55     // Positions
56     double longitude;           // geodetic (radians)
57     double latitude;            // geodetic (radians)
58     double altitude;            // above sea level (meters)
59     double agl;                 // above ground level (meters)
60     double phi;                 // roll (radians)
61     double theta;               // pitch (radians)
62     double psi;                 // yaw or true heading (radians)
63
64     // Velocities
65     double phidot;              // roll rate (radians/sec)
66     double thetadot;            // pitch rate (radians/sec)
67     double psidot;              // yaw rate (radians/sec)
68     double vcas;                // calibrated airspeed
69     double climb_rate;          // feet per second
70
71     // Accelerations
72     double A_X_pilot;           // X accel in body frame ft/sec^2
73     double A_Y_pilot;           // Y accel in body frame ft/sec^2
74     double A_Z_pilot;           // Z accel in body frame ft/sec^2
75
76     // Engine status
77     int num_engines;            // Number of valid engines
78     int eng_state[FG_MAX_ENGINES]; // Engine state (off, cranking, running)
79     double rpm[FG_MAX_ENGINES]; // Engine RPM rev/min
80     double fuel_flow[FG_MAX_ENGINES]; // Fuel flow gallons/hr
81     double EGT[FG_MAX_ENGINES]; // Exhuast gas temp deg F
82     double oil_temp[FG_MAX_ENGINES]; // Oil temp deg F
83     double oil_px[FG_MAX_ENGINES]; // Oil pressure psi
84
85     // Consumables
86     int num_tanks;              // Max number of fuel tanks
87     double fuel_quantity[FG_MAX_TANKS];
88
89     // Gear status
90     int num_wheels;
91     bool wow[FG_MAX_WHEELS];
92
93     // Environment
94     time_t cur_time;            // current unix time
95     long int warp;              // offset in seconds to unix time
96     double visibility;          // visibility in meters (for env. effects)
97 };
98
99
100 #endif // _NET_FDM_HXX