1 // net_ctrls.hxx -- defines a common net I/O interface to the flight
4 // Written by Curtis Olson - http://www.flightgear.org/~curt
7 // This file is in the Public Domain, and comes with no warranty.
12 #ifndef _NET_CTRLS_HXX
13 #define _NET_CTRLS_HXX
15 #include <simgear/compiler.h>
17 // NOTE: this file defines an external interface structure. Due to
18 // variability between platforms and architectures, we only used fixed
19 // length types here. Specifically, integer types can vary in length.
20 // I am not aware of any platforms that don't use 4 bytes for float
21 // and 8 bytes for double.
27 const uint32_t FG_NET_CTRLS_VERSION = 26;
30 // Define a structure containing the control parameters
42 uint32_t version; // increment when data values change
45 double aileron; // -1 ... 1
46 double elevator; // -1 ... 1
47 double rudder; // -1 ... 1
48 double aileron_trim; // -1 ... 1
49 double elevator_trim; // -1 ... 1
50 double rudder_trim; // -1 ... 1
51 double flaps; // 0 ... 1
53 // Aero control faults
54 uint32_t flaps_power; // true = power available
55 uint32_t flap_motor_ok;
58 uint32_t num_engines; // number of valid engines
59 uint32_t master_bat[FG_MAX_ENGINES];
60 uint32_t master_alt[FG_MAX_ENGINES];
61 uint32_t magnetos[FG_MAX_ENGINES];
62 uint32_t starter_power[FG_MAX_ENGINES];// true = starter power
63 double throttle[FG_MAX_ENGINES]; // 0 ... 1
64 double mixture[FG_MAX_ENGINES]; // 0 ... 1
65 double condition[FG_MAX_ENGINES]; // 0 ... 1
66 uint32_t fuel_pump_power[FG_MAX_ENGINES];// true = on
67 double prop_advance[FG_MAX_ENGINES]; // 0 ... 1
70 uint32_t engine_ok[FG_MAX_ENGINES];
71 uint32_t mag_left_ok[FG_MAX_ENGINES];
72 uint32_t mag_right_ok[FG_MAX_ENGINES];
73 uint32_t spark_plugs_ok[FG_MAX_ENGINES]; // false = fouled plugs
74 uint32_t oil_press_status[FG_MAX_ENGINES];// 0 = normal, 1 = low, 2 = full fail
75 uint32_t fuel_pump_ok[FG_MAX_ENGINES];
78 uint32_t num_tanks; // number of valid tanks
79 uint32_t fuel_selector[FG_MAX_TANKS]; // false = off, true = on
80 uint32_t cross_feed; // false = off, true = on
85 double copilot_brake_left;
86 double copilot_brake_right;
90 uint32_t gear_handle; // true=gear handle down; false= gear handle up
93 uint32_t master_avionics;
95 // wind and turbulance
98 double turbulence_norm;
104 // other information about environment
105 double hground; // ground elevation (meters)
106 double magvar; // local magnetic variation in degs.
109 uint32_t icing; // icing status could me much
110 // more complex but I'm
111 // starting simple here.
113 // simulation control
114 uint32_t speedup; // integer speedup multiplier
115 uint32_t freeze; // 0=normal
122 #endif // _NET_CTRLS_HXX