| 1 | // opengc_data.hxx -- Define structure of OpenGC/FG interface parameters |
| 2 | // |
| 3 | // Version by J. Wojnaroski for interface to Open Glass Displays |
| 4 | // |
| 5 | // Modified 02/12/01 - Update engine structure for multi-engine models |
| 6 | // - Added data preamble to id msg types |
| 7 | // |
| 8 | // Modified 01/23/02 - Converted portions of the Engine and Gear accesssors to properties |
| 9 | // - Removed data from navigation functions. OpenGC provides own |
| 10 | // |
| 11 | // This file defines the class/structure of the UDP packet that sends |
| 12 | // the simulation data created by FlightGear to the glass displays. It |
| 13 | // is required to "sync" the data types contained in the packet |
| 14 | // |
| 15 | // This program is free software; you can redistribute it and/or |
| 16 | // modify it under the terms of the GNU General Public License as |
| 17 | // published by the Free Software Foundation; either version 2 of the |
| 18 | // License, or (at your option) any later version. |
| 19 | // |
| 20 | // This program is distributed in the hope that it will be useful, but |
| 21 | // WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 23 | // General Public License for more details. |
| 24 | // |
| 25 | // You should have received a copy of the GNU General Public License |
| 26 | // along with this program; if not, write to the Free Software |
| 27 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 28 | // |
| 29 | |
| 30 | #ifndef _OPENGC_DATA_HXX |
| 31 | #define _OPENGC_DATA_HXX |
| 32 | |
| 33 | #ifndef __cplusplus |
| 34 | # error This library requires C++ |
| 35 | #endif |
| 36 | |
| 37 | const int OGC_VERSION = 4; |
| 38 | |
| 39 | class ogcFGData { |
| 40 | |
| 41 | public: |
| 42 | |
| 43 | // defines msg types and contents. The msg_content is used as a 'pointer' to |
| 44 | // a predefined set of msg strings |
| 45 | |
| 46 | int version_id; |
| 47 | int msg_type; |
| 48 | int msg_content; |
| 49 | int reserved; |
| 50 | |
| 51 | // position |
| 52 | |
| 53 | double latitude; |
| 54 | double longitude; |
| 55 | double elevation; |
| 56 | double magvar; |
| 57 | |
| 58 | // flight parameters |
| 59 | |
| 60 | double pitch; |
| 61 | double bank; |
| 62 | double heading; |
| 63 | double altitude; |
| 64 | double altitude_agl; // this can also be the radar altimeter |
| 65 | double v_kcas; |
| 66 | double groundspeed; |
| 67 | double vvi; |
| 68 | double mach; |
| 69 | double v_keas; // equivalent airspeed in knots |
| 70 | |
| 71 | // Data used by the FMC and autopilots |
| 72 | |
| 73 | double phi_dot; |
| 74 | double theta_dot; |
| 75 | double psi_dot; |
| 76 | |
| 77 | double alpha; |
| 78 | double alpha_dot; |
| 79 | double beta; |
| 80 | double beta_dot; |
| 81 | |
| 82 | // Control surface positions |
| 83 | |
| 84 | double left_aileron; |
| 85 | double right_aileron; |
| 86 | double aileron_trim; |
| 87 | double elevator; |
| 88 | double elevator_trim; |
| 89 | double rudder; |
| 90 | double rudder_trim; |
| 91 | double flaps; |
| 92 | double flaps_cmd; |
| 93 | |
| 94 | // gear positions 0 = up and 1 = down The 747 has 5 wheel bogey assemblies |
| 95 | |
| 96 | double gear_nose; |
| 97 | double gear_left; |
| 98 | double gear_right; |
| 99 | double gear_left_rear; |
| 100 | double gear_right_rear; |
| 101 | double parking_brake; |
| 102 | bool wow_main; // logical and of main gear |
| 103 | bool wow_nose; |
| 104 | // engine data |
| 105 | |
| 106 | double rpm[4]; // this is for pistons, jets see below |
| 107 | double n1_turbine[4]; |
| 108 | double epr[4]; |
| 109 | double egt[4]; |
| 110 | double n2_turbine[4]; |
| 111 | double fuel_flow[4]; |
| 112 | double man_pressure[4]; |
| 113 | double oil_pressure[4]; |
| 114 | double oil_temp[4]; |
| 115 | double oil_quantity[4]; |
| 116 | double hyd_pressure[4]; |
| 117 | double throttle[4]; |
| 118 | double mixture[4]; |
| 119 | double prop_advance[4]; |
| 120 | |
| 121 | // fuel system |
| 122 | int num_tanks; |
| 123 | double fuel_tank[9]; |
| 124 | |
| 125 | // Pressures and temperatures |
| 126 | |
| 127 | double static_temperature; |
| 128 | double total_temperature; |
| 129 | double static_pressure; |
| 130 | double total_pressure; |
| 131 | double dynamic_pressure; |
| 132 | |
| 133 | // more environmental data |
| 134 | double wind; |
| 135 | double wind_dir; |
| 136 | double sea_level_pressure; |
| 137 | }; |
| 138 | |
| 139 | #endif // _OPENGC_HXX |