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