]> git.mxchange.org Git - flightgear.git/blob - src/Network/net_ctrls.hxx
Make several assumptions:
[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 = 20;
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     bool fuel_pump_power[FG_MAX_ENGINES];// true = on
56     double prop_advance[FG_MAX_ENGINES]; //  0 ... 1
57
58     // Engine faults
59     bool engine_ok[FG_MAX_ENGINES];
60     bool mag_left_ok[FG_MAX_ENGINES];
61     bool mag_right_ok[FG_MAX_ENGINES];
62     bool spark_plugs_ok[FG_MAX_ENGINES];  // false = fouled plugs
63     int oil_press_status[FG_MAX_ENGINES]; // 0 = normal, 1 = low, 2 = full fail
64     bool fuel_pump_ok[FG_MAX_ENGINES];
65
66     // Fuel management
67     int num_tanks;                       // number of valid tanks
68     bool fuel_selector[FG_MAX_TANKS];    // false = off, true = on
69
70     // Brake controls
71     double brake_left;
72     double brake_right;
73     double brake_parking;
74     
75     // Landing Gear
76     bool gear_handle; // true=gear handle down; false= gear handle up
77
78     // Switches
79     bool master_avionics;
80
81     // wind and turbulance
82     double wind_speed_kt;
83     double wind_dir_deg;
84     double turbulence_norm;
85
86     // temp and pressure
87     double temp_c;
88     double press_inhg;
89
90     // other information about environment
91     double hground;                      // ground elevation (meters)
92     double magvar;                       // local magnetic variation in degs.
93
94     // simulation control
95     int speedup;                         // integer speedup multiplier
96     int freeze;                          // 0=normal
97                                          // 0x01=master
98                                          // 0x02=position
99                                          // 0x04=fuel
100 };
101
102
103 #endif // _NET_CTRLS_HXX
104
105