]> git.mxchange.org Git - flightgear.git/blob - src/Network/net_ctrls.hxx
6bb9461b066b9bc62f954a26e27f01710a14ca41
[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 = 24;
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 rudder;                       // -1 ... 1
41     double aileron_trim;                 // -1 ... 1
42     double elevator_trim;                // -1 ... 1
43     double rudder_trim;                  // -1 ... 1
44     double flaps;                        //  0 ... 1
45
46     // Aero control faults
47     bool flaps_power;                    //  true = power available
48     bool flap_motor_ok;
49
50     // Engine controls
51     int num_engines;                     // number of valid engines
52     bool master_bat[FG_MAX_ENGINES];
53     bool master_alt[FG_MAX_ENGINES];
54     int magnetos[FG_MAX_ENGINES];
55     bool starter_power[FG_MAX_ENGINES];  // true = starter power
56     double throttle[FG_MAX_ENGINES];     //  0 ... 1
57     double mixture[FG_MAX_ENGINES];      //  0 ... 1
58     double condition[FG_MAX_ENGINES];    //  0 ... 1
59     bool fuel_pump_power[FG_MAX_ENGINES];// true = on
60     double prop_advance[FG_MAX_ENGINES]; //  0 ... 1
61
62     // Engine faults
63     bool engine_ok[FG_MAX_ENGINES];
64     bool mag_left_ok[FG_MAX_ENGINES];
65     bool mag_right_ok[FG_MAX_ENGINES];
66     bool spark_plugs_ok[FG_MAX_ENGINES];  // false = fouled plugs
67     int oil_press_status[FG_MAX_ENGINES]; // 0 = normal, 1 = low, 2 = full fail
68     bool fuel_pump_ok[FG_MAX_ENGINES];
69
70     // Fuel management
71     int num_tanks;                       // number of valid tanks
72     bool fuel_selector[FG_MAX_TANKS];    // false = off, true = on
73
74     // Brake controls
75     double brake_left;
76     double brake_right;
77     double copilot_brake_left;
78     double copilot_brake_right;
79     double brake_parking;
80     
81     // Landing Gear
82     bool gear_handle; // true=gear handle down; false= gear handle up
83
84     // Switches
85     bool master_avionics;
86
87     // wind and turbulance
88     double wind_speed_kt;
89     double wind_dir_deg;
90     double turbulence_norm;
91
92     // temp and pressure
93     double temp_c;
94     double press_inhg;
95
96     // other information about environment
97     double hground;                      // ground elevation (meters)
98     double magvar;                       // local magnetic variation in degs.
99
100     // hazards
101     bool icing;                          // icing status could me much
102                                          // more complex but I'm
103                                          // starting simple here.
104
105     // simulation control
106     int speedup;                         // integer speedup multiplier
107     int freeze;                          // 0=normal
108                                          // 0x01=master
109                                          // 0x02=position
110                                          // 0x04=fuel
111 };
112
113
114 #endif // _NET_CTRLS_HXX
115
116