]> git.mxchange.org Git - flightgear.git/blob - src/Network/net_ctrls.hxx
Add David Culp's AI model manager code which is derived from David Luff's AI/ATC...
[flightgear.git] / src / Network / net_ctrls.hxx
1 // net_ctrls.hxx -- defines a common net I/O interface to the flight
2 //                  sim controls
3 //
4 // Written by Curtis Olson, started July 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_CTRLS_HXX
26 #define _NET_CTRLS_HXX
27
28
29 #ifndef __cplusplus                                                          
30 # error This library requires C++
31 #endif                                   
32
33 const int FG_NET_CTRLS_VERSION = 18;
34
35
36 // Define a structure containing the control parameters
37
38 class FGNetCtrls {
39
40 public:
41
42     int version;                         // increment when data values change
43
44     enum {
45         FG_MAX_ENGINES = 4,
46         FG_MAX_WHEELS = 16,
47         FG_MAX_TANKS = 6
48     };
49
50     // Aero controls
51     double aileron;                      // -1 ... 1
52     double elevator;                     // -1 ... 1
53     double elevator_trim;                // -1 ... 1
54     double rudder;                       // -1 ... 1
55     double flaps;                        //  0 ... 1
56
57     // Aero control faults
58     bool flaps_power;                    //  true = power available
59     bool flap_motor_ok;
60
61     // Engine controls
62     int num_engines;                     // number of valid engines
63     int magnetos[FG_MAX_ENGINES];
64     bool starter_power[FG_MAX_ENGINES];  // true = starter power
65     double throttle[FG_MAX_ENGINES];     //  0 ... 1
66     double mixture[FG_MAX_ENGINES];      //  0 ... 1
67     bool fuel_pump_power[FG_MAX_ENGINES];// true = on
68     double prop_advance[FG_MAX_ENGINES]; //  0 ... 1
69
70     // Engine faults
71     bool engine_ok[FG_MAX_ENGINES];
72     bool mag_left_ok[FG_MAX_ENGINES];
73     bool mag_right_ok[FG_MAX_ENGINES];
74     bool spark_plugs_ok[FG_MAX_ENGINES]; // false = fouled plugs
75     int oil_press_status[FG_MAX_ENGINES]; // 0 = normal, 1 = low, 2 = full fail
76     bool fuel_pump_ok[FG_MAX_ENGINES];
77
78     // Fuel management
79     int num_tanks;                       // number of valid tanks
80     bool fuel_selector[FG_MAX_TANKS];    // false = off, true = on
81
82     // Brake controls
83     int num_wheels;                      // number of valid wheels
84     double brake[FG_MAX_WHEELS];         //  0 ... 1
85     
86     // Landing Gear
87     bool gear_handle; // true=gear handle down; false= gear handle up
88
89     // Switches
90     bool master_bat;
91     bool master_alt;
92     bool master_avionics;
93
94     // wind and turbulance
95     double wind_speed_kt;
96     double wind_dir_deg;
97     double turbulence_norm;
98
99     // temp and pressure
100     double temp_c;
101     double press_inhg;
102
103     // other information about environment
104     double hground;                      // ground elevation (meters)
105     double magvar;                       // local magnetic variation in degs.
106
107     // simulation control
108     int speedup;                         // integer speedup multiplier
109     int freeze;                          // 0=normal
110                                          // 0x01=master
111                                          // 0x02=position
112                                          // 0x04=fuel
113 };
114
115
116 #endif // _NET_CTRLS_HXX
117
118