]> git.mxchange.org Git - flightgear.git/blob - src/Network/net_ctrls.hxx
Add an "additive-switch" type.
[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 - http://www.flightgear.org/~curt
5 // Started July 2001.
6 //
7 // This file is in the Public Domain, and comes with no warranty.
8 //
9 // $Id$
10
11
12 #ifndef _NET_CTRLS_HXX
13 #define _NET_CTRLS_HXX
14
15
16 #ifndef __cplusplus                                                          
17 # error This library requires C++
18 #endif                                   
19
20 const int FG_NET_CTRLS_VERSION = 23;
21
22
23 // Define a structure containing the control parameters
24
25 class FGNetCtrls {
26
27 public:
28
29     int version;                         // increment when data values change
30
31     enum {
32         FG_MAX_ENGINES = 4,
33         FG_MAX_WHEELS = 16,
34         FG_MAX_TANKS = 6
35     };
36
37     // Aero controls
38     double aileron;                      // -1 ... 1
39     double elevator;                     // -1 ... 1
40     double elevator_trim;                // -1 ... 1
41     double rudder;                       // -1 ... 1
42     double flaps;                        //  0 ... 1
43
44     // Aero control faults
45     bool flaps_power;                    //  true = power available
46     bool flap_motor_ok;
47
48     // Engine controls
49     int num_engines;                     // number of valid engines
50     bool master_bat[FG_MAX_ENGINES];
51     bool master_alt[FG_MAX_ENGINES];
52     int magnetos[FG_MAX_ENGINES];
53     bool starter_power[FG_MAX_ENGINES];  // true = starter power
54     double throttle[FG_MAX_ENGINES];     //  0 ... 1
55     double mixture[FG_MAX_ENGINES];      //  0 ... 1
56     double condition[FG_MAX_ENGINES];    //  0 ... 1
57     bool fuel_pump_power[FG_MAX_ENGINES];// true = on
58     double prop_advance[FG_MAX_ENGINES]; //  0 ... 1
59
60     // Engine faults
61     bool engine_ok[FG_MAX_ENGINES];
62     bool mag_left_ok[FG_MAX_ENGINES];
63     bool mag_right_ok[FG_MAX_ENGINES];
64     bool spark_plugs_ok[FG_MAX_ENGINES];  // false = fouled plugs
65     int oil_press_status[FG_MAX_ENGINES]; // 0 = normal, 1 = low, 2 = full fail
66     bool fuel_pump_ok[FG_MAX_ENGINES];
67
68     // Fuel management
69     int num_tanks;                       // number of valid tanks
70     bool fuel_selector[FG_MAX_TANKS];    // false = off, true = on
71
72     // Brake controls
73     double brake_left;
74     double brake_right;
75     double copilot_brake_left;
76     double copilot_brake_right;
77     double brake_parking;
78     
79     // Landing Gear
80     bool gear_handle; // true=gear handle down; false= gear handle up
81
82     // Switches
83     bool master_avionics;
84
85     // wind and turbulance
86     double wind_speed_kt;
87     double wind_dir_deg;
88     double turbulence_norm;
89
90     // temp and pressure
91     double temp_c;
92     double press_inhg;
93
94     // other information about environment
95     double hground;                      // ground elevation (meters)
96     double magvar;                       // local magnetic variation in degs.
97
98     // hazards
99     bool icing;                          // icing status could me much
100                                          // more complex but I'm
101                                          // starting simple here.
102
103     // simulation control
104     int speedup;                         // integer speedup multiplier
105     int freeze;                          // 0=normal
106                                          // 0x01=master
107                                          // 0x02=position
108                                          // 0x04=fuel
109 };
110
111
112 #endif // _NET_CTRLS_HXX
113
114