1 // controls.cxx -- defines a standard interface to all flight sim controls
3 // Written by Curtis Olson, started May 1997.
5 // Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 #include <Main/fg_props.hxx>
28 #include <simgear/sg_inlines.h>
29 #include "controls.hxx"
31 ////////////////////////////////////////////////////////////////////////
32 // Implementation of FGControls.
33 ////////////////////////////////////////////////////////////////////////
36 FGControls::FGControls() :
42 tailwheel_lock( true ),
43 battery_switch( true ),
44 external_power( false ),
45 APU_generator( false ),
56 instruments_norm( 0.0 ),
60 vertical_adjust( 0.0 ),
61 fore_aft_adjust( 0.0 ),
62 cmd_selector_valve( 0 ),
64 heading_select( 0.0 ),
65 altitude_select( 50000.0 ),
66 bank_angle_select( 30.0 ),
67 vertical_speed_select( 0.0 ),
73 auto_coordination = fgGetNode("/controls/flight/auto-coordination", true);
74 auto_coordination_factor = fgGetNode("/controls/flight/auto-coordination-factor", false );
75 if( NULL == auto_coordination_factor ) {
76 auto_coordination_factor = fgGetNode("/controls/flight/auto-coordination-factor", true );
77 auto_coordination_factor->setDoubleValue( 0.5 );
81 globals->set_controls( this );
85 void FGControls::reset_all()
88 set_aileron_trim( 0.0 );
90 set_elevator_trim( 0.0 );
92 set_rudder_trim( 0.0 );
95 set_speedbrake( 0.0 );
96 set_wing_sweep( 0.0 );
99 set_throttle( ALL_ENGINES, 0.0 );
100 set_starter( ALL_ENGINES, false );
101 set_magnetos( ALL_ENGINES, 0 );
102 set_fuel_pump( ALL_ENGINES, false );
103 set_fire_switch( ALL_ENGINES, false );
104 set_fire_bottle_discharge( ALL_ENGINES, false );
105 set_cutoff( ALL_ENGINES, true );
106 set_nitrous_injection( ALL_ENGINES, false );
107 set_cowl_flaps_norm( ALL_ENGINES, 1.0 );
108 set_feather( ALL_ENGINES, false );
109 set_ignition( ALL_ENGINES, false );
110 set_augmentation( ALL_ENGINES, false );
111 set_reverser( ALL_ENGINES, false );
112 set_water_injection( ALL_ENGINES, false );
113 set_condition( ALL_ENGINES, 1.0 );
114 throttle_idle = true;
115 set_fuel_selector( ALL_TANKS, true );
118 nose_wheel_steering = true;
122 catapult_launch_cmd = false;
123 tailwheel_lock = true;
124 set_carb_heat( ALL_ENGINES, false );
125 set_inlet_heat( ALL_ENGINES, false );
130 set_engine_pump( ALL_HYD_SYSTEMS, true );
131 set_electric_pump( ALL_HYD_SYSTEMS, true );
132 landing_lights = false;
133 turn_off_lights = false;
135 set_ejection_seat( ALL_EJECTION_SEATS, false );
136 set_eseat_status( ALL_EJECTION_SEATS, SEAT_SAFED );
137 set_cmd_selector_valve( CMD_SEL_NORM );
138 APU_fire_switch = false;
139 autothrottle_arm = false;
140 autothrottle_engage = false;
141 set_autopilot_engage( ALL_AUTOPILOTS, false );
143 brake_left = brake_right
144 = copilot_brake_left = copilot_brake_right
145 = brake_parking = 0.0;
147 set_fuel_selector(ALL_TANKS, false);
148 set_to_engine(ALL_TANKS, 0);
149 set_to_tank(ALL_TANKS, 0);
150 set_boost_pump(ALL_TANKS, false);
152 set_alternate_extension(ALL_WHEELS, false);
154 set_mixture(ALL_ENGINES, 1.0);
155 set_prop_advance(ALL_ENGINES, 1.0);
156 set_generator_breaker(ALL_ENGINES, false);
157 set_bus_tie(ALL_ENGINES, false);
158 set_engine_bleed(ALL_ENGINES, false);
159 set_feed_tank(ALL_ENGINES, -1); // feed off
160 set_cowl_flaps_norm(ALL_ENGINES, 0.0);
165 FGControls::~FGControls() {
167 globals->set_controls( NULL );
182 static inline void _SetRoot( simgear::TiedPropertyList & tiedProperties, const char * root, int index = 0 )
184 tiedProperties.setRoot( fgGetNode( root, index, true ) );
194 _SetRoot( _tiedProperties, "/controls/flight" );
196 _tiedProperties.Tie( "aileron", this, &FGControls::get_aileron, &FGControls::set_aileron )
197 ->setAttribute( SGPropertyNode::ARCHIVE, true );
199 _tiedProperties.Tie( "aileron-trim", this, &FGControls::get_aileron_trim, &FGControls::set_aileron_trim )
200 ->setAttribute( SGPropertyNode::ARCHIVE, true );
202 _tiedProperties.Tie( "elevator", this, &FGControls::get_elevator, &FGControls::set_elevator )
203 ->setAttribute( SGPropertyNode::ARCHIVE, true );
205 _tiedProperties.Tie( "elevator-trim", this, &FGControls::get_elevator_trim, &FGControls::set_elevator_trim )
206 ->setAttribute( SGPropertyNode::ARCHIVE, true );
208 _tiedProperties.Tie( "rudder", this, &FGControls::get_rudder, &FGControls::set_rudder )
209 ->setAttribute( SGPropertyNode::ARCHIVE, true );
211 _tiedProperties.Tie( "rudder-trim", this, &FGControls::get_rudder_trim, &FGControls::set_rudder_trim )
212 ->setAttribute( SGPropertyNode::ARCHIVE, true );
214 _tiedProperties.Tie( "flaps", this, &FGControls::get_flaps, &FGControls::set_flaps )
215 ->setAttribute( SGPropertyNode::ARCHIVE, true );
217 _tiedProperties.Tie( "slats", this, &FGControls::get_slats, &FGControls::set_slats )
218 ->setAttribute( SGPropertyNode::ARCHIVE, true );
220 _tiedProperties.Tie( "BLC", this, &FGControls::get_BLC, &FGControls::set_BLC )
221 ->setAttribute( SGPropertyNode::ARCHIVE, true );
223 _tiedProperties.Tie( "spoilers", this, &FGControls::get_spoilers, &FGControls::set_spoilers )
224 ->setAttribute( SGPropertyNode::ARCHIVE, true );
226 _tiedProperties.Tie( "speedbrake", this, &FGControls::get_speedbrake, &FGControls::set_speedbrake )
227 ->setAttribute( SGPropertyNode::ARCHIVE, true );
229 _tiedProperties.Tie( "wing-sweep", this, &FGControls::get_wing_sweep, &FGControls::set_wing_sweep )
230 ->setAttribute( SGPropertyNode::ARCHIVE, true );
232 _tiedProperties.Tie( "wing-fold", this, &FGControls::get_wing_fold, &FGControls::set_wing_fold )
233 ->setAttribute( SGPropertyNode::ARCHIVE, true );
235 _tiedProperties.Tie( "drag-chute", this, &FGControls::get_drag_chute, &FGControls::set_drag_chute )
236 ->setAttribute( SGPropertyNode::ARCHIVE, true );
239 _tiedProperties.setRoot( fgGetNode("/controls/engines", true ) );
241 _tiedProperties.Tie( "throttle_idle", this, &FGControls::get_throttle_idle, &FGControls::set_throttle_idle )
242 ->setAttribute( SGPropertyNode::ARCHIVE, true );
244 for (index = 0; index < MAX_ENGINES; index++) {
245 _SetRoot(_tiedProperties, "/controls/engines/engine", index );
247 _tiedProperties.Tie( "throttle", this, index, &FGControls::get_throttle, &FGControls::set_throttle )
248 ->setAttribute( SGPropertyNode::ARCHIVE, true );
250 _tiedProperties.Tie( "starter", this, index, &FGControls::get_starter, &FGControls::set_starter )
251 ->setAttribute( SGPropertyNode::ARCHIVE, true );
253 _tiedProperties.Tie( "fuel-pump", this, index, &FGControls::get_fuel_pump, &FGControls::set_fuel_pump )
254 ->setAttribute( SGPropertyNode::ARCHIVE, true );
256 _tiedProperties.Tie( "fire-switch", this, index, &FGControls::get_fire_switch, &FGControls::set_fire_switch )
257 ->setAttribute( SGPropertyNode::ARCHIVE, true );
259 _tiedProperties.Tie( "fire-bottle-discharge", this, index, &FGControls::get_fire_bottle_discharge, &FGControls::set_fire_bottle_discharge )
260 ->setAttribute( SGPropertyNode::ARCHIVE, true );
262 _tiedProperties.Tie( "cutoff", this, index, &FGControls::get_cutoff, &FGControls::set_cutoff )
263 ->setAttribute( SGPropertyNode::ARCHIVE, true );
265 _tiedProperties.Tie( "mixture", this, index, &FGControls::get_mixture, &FGControls::set_mixture )
266 ->setAttribute( SGPropertyNode::ARCHIVE, true );
268 _tiedProperties.Tie( "propeller-pitch", this, index, &FGControls::get_prop_advance, &FGControls::set_prop_advance )
269 ->setAttribute( SGPropertyNode::ARCHIVE, true );
271 _tiedProperties.Tie( "magnetos", this, index, &FGControls::get_magnetos, &FGControls::set_magnetos )
272 ->setAttribute( SGPropertyNode::ARCHIVE, true );
274 _tiedProperties.Tie( "feed_tank", this, index, &FGControls::get_feed_tank, &FGControls::set_feed_tank )
275 ->setAttribute( SGPropertyNode::ARCHIVE, true );
277 _tiedProperties.Tie( "WEP", this, index, &FGControls::get_nitrous_injection, &FGControls::set_nitrous_injection )
278 ->setAttribute( SGPropertyNode::ARCHIVE, true );
280 _tiedProperties.Tie( "cowl-flaps-norm", this, index, &FGControls::get_cowl_flaps_norm, &FGControls::set_cowl_flaps_norm )
281 ->setAttribute( SGPropertyNode::ARCHIVE, true );
283 _tiedProperties.Tie( "propeller-feather", this, index, &FGControls::get_feather, &FGControls::set_feather )
284 ->setAttribute( SGPropertyNode::ARCHIVE, true );
286 _tiedProperties.Tie( "ignition", this, index, &FGControls::get_ignition, &FGControls::set_ignition )
287 ->setAttribute( SGPropertyNode::ARCHIVE, true );
289 _tiedProperties.Tie( "augmentation", this, index, &FGControls::get_augmentation, &FGControls::set_augmentation )
290 ->setAttribute( SGPropertyNode::ARCHIVE, true );
292 _tiedProperties.Tie( "reverser", this, index, &FGControls::get_reverser, &FGControls::set_reverser )
293 ->setAttribute( SGPropertyNode::ARCHIVE, true );
295 _tiedProperties.Tie( "water-injection", this, index, &FGControls::get_water_injection, &FGControls::set_water_injection )
296 ->setAttribute( SGPropertyNode::ARCHIVE, true );
298 _tiedProperties.Tie( "condition", this, index, &FGControls::get_condition, &FGControls::set_condition )
299 ->setAttribute( SGPropertyNode::ARCHIVE, true );
303 _SetRoot( _tiedProperties, "/controls/fuel" );
305 _tiedProperties.Tie( "dump-valve", this, &FGControls::get_dump_valve, &FGControls::set_dump_valve)
306 ->setAttribute( SGPropertyNode::ARCHIVE, true );
308 for (index = 0; index < MAX_TANKS; index++) {
309 _SetRoot( _tiedProperties, "/controls/fuel/tank", index );
311 _tiedProperties.Tie( "fuel_selector", this, index, &FGControls::get_fuel_selector, &FGControls::set_fuel_selector)
312 ->setAttribute( SGPropertyNode::ARCHIVE, true );
314 _tiedProperties.Tie( "to_engine", this, index, &FGControls::get_to_engine, &FGControls::set_to_engine)
315 ->setAttribute( SGPropertyNode::ARCHIVE, true );
317 _tiedProperties.Tie( "to_tank", this, index, &FGControls::get_to_tank, &FGControls::set_to_tank)
318 ->setAttribute( SGPropertyNode::ARCHIVE, true );
320 for (i = 0; i < MAX_BOOSTPUMPS; i++) {
321 _tiedProperties.Tie( "boost-pump", i,
322 this, index * 2 + i, &FGControls::get_boost_pump, &FGControls::set_boost_pump)
323 ->setAttribute( SGPropertyNode::ARCHIVE, true );
328 _SetRoot( _tiedProperties, "/controls/gear" );
330 _tiedProperties.Tie( "brake-left", this, &FGControls::get_brake_left, &FGControls::set_brake_left)
331 ->setAttribute( SGPropertyNode::ARCHIVE, true );
333 _tiedProperties.Tie( "brake-right", this, &FGControls::get_brake_right, &FGControls::set_brake_right)
334 ->setAttribute( SGPropertyNode::ARCHIVE, true );
336 _tiedProperties.Tie( "copilot-brake-left", this, &FGControls::get_copilot_brake_left, &FGControls::set_copilot_brake_left)
337 ->setAttribute( SGPropertyNode::ARCHIVE, true );
339 _tiedProperties.Tie( "copilot-brake-right", this, &FGControls::get_copilot_brake_right, &FGControls::set_copilot_brake_right)
340 ->setAttribute( SGPropertyNode::ARCHIVE, true );
342 _tiedProperties.Tie( "brake-parking", this, &FGControls::get_brake_parking, &FGControls::set_brake_parking)
343 ->setAttribute( SGPropertyNode::ARCHIVE, true );
345 _tiedProperties.Tie( "steering", this, &FGControls::get_steering, &FGControls::set_steering)
346 ->setAttribute( SGPropertyNode::ARCHIVE, true );
348 _tiedProperties.Tie( "nose-wheel-steering", this, &FGControls::get_nose_wheel_steering, &FGControls::set_nose_wheel_steering)
349 ->setAttribute( SGPropertyNode::ARCHIVE, true );
351 _tiedProperties.Tie( "gear-down", this, &FGControls::get_gear_down, &FGControls::set_gear_down)
352 ->setAttribute( SGPropertyNode::ARCHIVE, true );
354 _tiedProperties.Tie( "antiskid", this, &FGControls::get_antiskid, &FGControls::set_antiskid)
355 ->setAttribute( SGPropertyNode::ARCHIVE, true );
357 _tiedProperties.Tie( "tailhook", this, &FGControls::get_tailhook, &FGControls::set_tailhook)
358 ->setAttribute( SGPropertyNode::ARCHIVE, true );
360 _tiedProperties.Tie( "launchbar", this, &FGControls::get_launchbar, &FGControls::set_launchbar)
361 ->setAttribute( SGPropertyNode::ARCHIVE, true );
363 _tiedProperties.Tie( "catapult-launch-cmd", this, &FGControls::get_catapult_launch_cmd, &FGControls::set_catapult_launch_cmd)
364 ->setAttribute( SGPropertyNode::ARCHIVE, true );
366 _tiedProperties.Tie( "tailwheel-lock", this, &FGControls::get_tailwheel_lock, &FGControls::set_tailwheel_lock)
367 ->setAttribute( SGPropertyNode::ARCHIVE, true );
369 for (index = 0; index < MAX_WHEELS; index++) {
370 _SetRoot( _tiedProperties, "/controls/gear/wheel", index );
371 _tiedProperties.Tie( "alternate-extension", this, index, &FGControls::get_alternate_extension, &FGControls::set_alternate_extension)
372 ->setAttribute( SGPropertyNode::ARCHIVE, true );
376 _SetRoot( _tiedProperties, "/controls/anti-ice" );
378 _tiedProperties.Tie( "wing-heat", this, &FGControls::get_wing_heat, &FGControls::set_wing_heat)
379 ->setAttribute( SGPropertyNode::ARCHIVE, true );
381 _tiedProperties.Tie( "pitot-heat", this, &FGControls::get_pitot_heat, &FGControls::set_pitot_heat)
382 ->setAttribute( SGPropertyNode::ARCHIVE, true );
384 _tiedProperties.Tie( "wiper", this, &FGControls::get_wiper, &FGControls::set_wiper)
385 ->setAttribute( SGPropertyNode::ARCHIVE, true );
387 _tiedProperties.Tie( "window-heat", this, &FGControls::get_window_heat, &FGControls::set_window_heat)
388 ->setAttribute( SGPropertyNode::ARCHIVE, true );
390 for (index = 0; index < MAX_ENGINES; index++) {
391 _SetRoot( _tiedProperties, "/controls/anti-ice/engine", index );
393 _tiedProperties.Tie( "carb-heat", this, index, &FGControls::get_carb_heat, &FGControls::set_carb_heat)
394 ->setAttribute( SGPropertyNode::ARCHIVE, true );
396 _tiedProperties.Tie( "inlet-heat", this, index, &FGControls::get_inlet_heat, &FGControls::set_inlet_heat)
397 ->setAttribute( SGPropertyNode::ARCHIVE, true );
401 for (index = 0; index < MAX_HYD_SYSTEMS; index++) {
402 _SetRoot( _tiedProperties, "/controls/hydraulic/system", index );
404 _tiedProperties.Tie( "engine-pump", this, index, &FGControls::get_engine_pump, &FGControls::set_engine_pump)
405 ->setAttribute( SGPropertyNode::ARCHIVE, true );
407 _tiedProperties.Tie( "electric-pump", this, index, &FGControls::get_electric_pump, &FGControls::set_electric_pump)
408 ->setAttribute( SGPropertyNode::ARCHIVE, true );
412 _SetRoot( _tiedProperties, "/controls/electric" );
414 _tiedProperties.Tie( "battery-switch", this, &FGControls::get_battery_switch, &FGControls::set_battery_switch)
415 ->setAttribute( SGPropertyNode::ARCHIVE, true );
417 _tiedProperties.Tie( "external-power", this, &FGControls::get_external_power, &FGControls::set_external_power)
418 ->setAttribute( SGPropertyNode::ARCHIVE, true );
420 _tiedProperties.Tie( "APU-generator", this, &FGControls::get_APU_generator, &FGControls::set_APU_generator)
421 ->setAttribute( SGPropertyNode::ARCHIVE, true );
423 for (index = 0; index < MAX_ENGINES; index++) {
424 _SetRoot( _tiedProperties, "/controls/electric/engine", index );
426 _tiedProperties.Tie( "generator", this, index, &FGControls::get_generator_breaker, &FGControls::set_generator_breaker)
427 ->setAttribute( SGPropertyNode::ARCHIVE, true );
429 _tiedProperties.Tie( "bus-tie", this, index, &FGControls::get_bus_tie, &FGControls::set_bus_tie)
430 ->setAttribute( SGPropertyNode::ARCHIVE, true );
434 _SetRoot( _tiedProperties, "/controls/pneumatic" );
436 _tiedProperties.Tie( "APU-bleed", this, &FGControls::get_APU_bleed, &FGControls::set_APU_bleed)
437 ->setAttribute( SGPropertyNode::ARCHIVE, true );
439 for (index = 0; index < MAX_ENGINES; index++) {
440 _SetRoot( _tiedProperties, "/controls/pneumatic/engine", index );
442 _tiedProperties.Tie( "bleed", this, index, &FGControls::get_engine_bleed, &FGControls::set_engine_bleed)
443 ->setAttribute( SGPropertyNode::ARCHIVE, true );
447 _SetRoot( _tiedProperties, "/controls/pressurization" );
449 _tiedProperties.Tie( "mode", this, &FGControls::get_mode, &FGControls::set_mode)
450 ->setAttribute( SGPropertyNode::ARCHIVE, true );
452 _tiedProperties.Tie( "dump", this, &FGControls::get_dump, &FGControls::set_dump)
453 ->setAttribute( SGPropertyNode::ARCHIVE, true );
455 _tiedProperties.Tie( "outflow-valve", this, &FGControls::get_outflow_valve, &FGControls::set_outflow_valve)
456 ->setAttribute( SGPropertyNode::ARCHIVE, true );
458 for (index = 0; index < MAX_PACKS; index++) {
459 _SetRoot( _tiedProperties, "/controls/pressurization/pack", index );
461 _tiedProperties.Tie( "pack-on", this, index, &FGControls::get_pack_on, &FGControls::set_pack_on)
462 ->setAttribute( SGPropertyNode::ARCHIVE, true );
466 _SetRoot( _tiedProperties, "/controls/lighting" );
468 _tiedProperties.Tie( "landing-lights", this, &FGControls::get_landing_lights, &FGControls::set_landing_lights)
469 ->setAttribute( SGPropertyNode::ARCHIVE, true );
471 _tiedProperties.Tie( "turn-off-lights", this, &FGControls::get_turn_off_lights, &FGControls::set_turn_off_lights)
472 ->setAttribute( SGPropertyNode::ARCHIVE, true );
474 _tiedProperties.Tie( "taxi-light", this, &FGControls::get_taxi_light, &FGControls::set_taxi_light)
475 ->setAttribute( SGPropertyNode::ARCHIVE, true );
477 _tiedProperties.Tie( "logo-lights", this, &FGControls::get_logo_lights, &FGControls::set_logo_lights)
478 ->setAttribute( SGPropertyNode::ARCHIVE, true );
480 _tiedProperties.Tie( "nav-lights", this, &FGControls::get_nav_lights, &FGControls::set_nav_lights)
481 ->setAttribute( SGPropertyNode::ARCHIVE, true );
483 _tiedProperties.Tie( "beacon", this, &FGControls::get_beacon, &FGControls::set_beacon)
484 ->setAttribute( SGPropertyNode::ARCHIVE, true );
486 _tiedProperties.Tie( "strobe", this, &FGControls::get_strobe, &FGControls::set_strobe)
487 ->setAttribute( SGPropertyNode::ARCHIVE, true );
489 _tiedProperties.Tie( "panel-norm", this, &FGControls::get_panel_norm, &FGControls::set_panel_norm)
490 ->setAttribute( SGPropertyNode::ARCHIVE, true );
492 _tiedProperties.Tie( "instruments-norm", this, &FGControls::get_instruments_norm, &FGControls::set_instruments_norm)
493 ->setAttribute( SGPropertyNode::ARCHIVE, true );
495 _tiedProperties.Tie( "dome-norm", this, &FGControls::get_dome_norm, &FGControls::set_dome_norm)
496 ->setAttribute( SGPropertyNode::ARCHIVE, true );
499 _SetRoot( _tiedProperties, "/controls/armament" );
501 _tiedProperties.Tie( "master-arm", this, &FGControls::get_master_arm, &FGControls::set_master_arm)
502 ->setAttribute( SGPropertyNode::ARCHIVE, true );
504 _tiedProperties.Tie( "station-select", this, &FGControls::get_station_select, &FGControls::set_station_select)
505 ->setAttribute( SGPropertyNode::ARCHIVE, true );
507 _tiedProperties.Tie( "release-all", this, &FGControls::get_release_ALL, &FGControls::set_release_ALL)
508 ->setAttribute( SGPropertyNode::ARCHIVE, true );
510 for (index = 0; index < MAX_STATIONS; index++) {
511 _SetRoot( _tiedProperties, "/controls/armament/station", index );
513 _tiedProperties.Tie( "stick-size", this, index, &FGControls::get_stick_size, &FGControls::set_stick_size)
514 ->setAttribute( SGPropertyNode::ARCHIVE, true );
516 _tiedProperties.Tie( "release-stick", this, index, &FGControls::get_release_stick, &FGControls::set_release_stick)
517 ->setAttribute( SGPropertyNode::ARCHIVE, true );
519 _tiedProperties.Tie( "release-all", this, index, &FGControls::get_release_all, &FGControls::set_release_all)
520 ->setAttribute( SGPropertyNode::ARCHIVE, true );
522 _tiedProperties.Tie( "jettison-all", this, index, &FGControls::get_jettison_all, &FGControls::set_jettison_all)
523 ->setAttribute( SGPropertyNode::ARCHIVE, true );
527 _SetRoot( _tiedProperties, "/controls/seat" );
529 _tiedProperties.Tie( "vertical-adjust", this, &FGControls::get_vertical_adjust, &FGControls::set_vertical_adjust)
530 ->setAttribute( SGPropertyNode::ARCHIVE, true );
532 _tiedProperties.Tie( "fore-aft-adjust", this, &FGControls::get_fore_aft_adjust, &FGControls::set_fore_aft_adjust)
533 ->setAttribute( SGPropertyNode::ARCHIVE, true );
535 _tiedProperties.Tie( "cmd_selector_valve", this, &FGControls::get_cmd_selector_valve, &FGControls::set_cmd_selector_valve)
536 ->setAttribute( SGPropertyNode::ARCHIVE, true );
538 for (index = 0; index < MAX_EJECTION_SEATS; index++) {
539 _SetRoot( _tiedProperties, "/controls/seat/eject", index );
541 _tiedProperties.Tie( "initiate", this, index, &FGControls::get_ejection_seat, &FGControls::set_ejection_seat)
542 ->setAttribute( SGPropertyNode::ARCHIVE, true );
544 _tiedProperties.Tie( "status", this, index, &FGControls::get_eseat_status, &FGControls::set_eseat_status)
545 ->setAttribute( SGPropertyNode::ARCHIVE, true );
549 _SetRoot( _tiedProperties, "/controls/APU" );
551 _tiedProperties.Tie( "off-start-run", this, &FGControls::get_off_start_run, &FGControls::set_off_start_run)
552 ->setAttribute( SGPropertyNode::ARCHIVE, true );
554 _tiedProperties.Tie( "fire-switch", this, &FGControls::get_APU_fire_switch, &FGControls::set_APU_fire_switch)
555 ->setAttribute( SGPropertyNode::ARCHIVE, true );
558 for (index = 0; index < MAX_AUTOPILOTS; index++) {
560 _SetRoot( _tiedProperties, "/controls/autoflight/autopilot", index );
562 _tiedProperties.Tie( "engage", this, index, &FGControls::get_autopilot_engage, &FGControls::set_autopilot_engage)
563 ->setAttribute( SGPropertyNode::ARCHIVE, true );
566 _SetRoot( _tiedProperties, "/controls/autoflight/" );
568 _tiedProperties.Tie( "autothrottle-arm", this, &FGControls::get_autothrottle_arm, &FGControls::set_autothrottle_arm)
569 ->setAttribute( SGPropertyNode::ARCHIVE, true );
571 _tiedProperties.Tie( "autothrottle-engage", this, &FGControls::get_autothrottle_engage, &FGControls::set_autothrottle_engage)
572 ->setAttribute( SGPropertyNode::ARCHIVE, true );
574 _tiedProperties.Tie( "heading-select", this, &FGControls::get_heading_select, &FGControls::set_heading_select)
575 ->setAttribute( SGPropertyNode::ARCHIVE, true );
577 _tiedProperties.Tie( "altitude-select", this, &FGControls::get_altitude_select, &FGControls::set_altitude_select)
578 ->setAttribute( SGPropertyNode::ARCHIVE, true );
580 _tiedProperties.Tie( "bank-angle-select", this, &FGControls::get_bank_angle_select, &FGControls::set_bank_angle_select)
581 ->setAttribute( SGPropertyNode::ARCHIVE, true );
583 _tiedProperties.Tie( "vertical-speed-select", this, &FGControls::get_vertical_speed_select, &FGControls::set_vertical_speed_select)
584 ->setAttribute( SGPropertyNode::ARCHIVE, true );
586 _tiedProperties.Tie( "speed-select", this, &FGControls::get_speed_select, &FGControls::set_speed_select)
587 ->setAttribute( SGPropertyNode::ARCHIVE, true );
589 _tiedProperties.Tie( "mach-select", this, &FGControls::get_mach_select, &FGControls::set_mach_select)
590 ->setAttribute( SGPropertyNode::ARCHIVE, true );
592 _tiedProperties.Tie( "vertical-mode", this, &FGControls::get_vertical_mode, &FGControls::set_vertical_mode)
593 ->setAttribute( SGPropertyNode::ARCHIVE, true );
595 _tiedProperties.Tie( "lateral-mode", this, &FGControls::get_lateral_mode, &FGControls::set_lateral_mode)
596 ->setAttribute( SGPropertyNode::ARCHIVE, true );
599 void FGControls::unbind ()
601 _tiedProperties.Untie();
606 FGControls::update (double dt)
610 // nothing here, don't call again
614 ////////////////////////////////////////////////////////////////////////
615 // Setters and adjusters.
616 ////////////////////////////////////////////////////////////////////////
619 FGControls::set_aileron (double pos)
622 SG_CLAMP_RANGE<double>( aileron, -1.0, 1.0 );
623 do_autocoordination();
627 FGControls::move_aileron (double amt)
630 SG_CLAMP_RANGE<double>( aileron, -1.0, 1.0 );
631 do_autocoordination();
635 FGControls::set_aileron_trim( double pos )
638 SG_CLAMP_RANGE<double>( aileron_trim, -1.0, 1.0 );
642 FGControls::move_aileron_trim( double amt )
645 SG_CLAMP_RANGE<double>( aileron_trim, -1.0, 1.0 );
649 FGControls::set_elevator( double pos )
652 SG_CLAMP_RANGE<double>( elevator, -1.0, 1.0 );
656 FGControls::move_elevator( double amt )
659 SG_CLAMP_RANGE<double>( elevator, -1.0, 1.0 );
663 FGControls::set_elevator_trim( double pos )
666 SG_CLAMP_RANGE<double>( elevator_trim, -1.0, 1.0 );
670 FGControls::move_elevator_trim( double amt )
672 elevator_trim += amt;
673 SG_CLAMP_RANGE<double>( elevator_trim, -1.0, 1.0 );
677 FGControls::set_rudder( double pos )
680 SG_CLAMP_RANGE<double>( rudder, -1.0, 1.0 );
684 FGControls::move_rudder( double amt )
687 SG_CLAMP_RANGE<double>( rudder, -1.0, 1.0 );
691 FGControls::set_rudder_trim( double pos )
694 SG_CLAMP_RANGE<double>( rudder_trim, -1.0, 1.0 );
698 FGControls::move_rudder_trim( double amt )
701 SG_CLAMP_RANGE<double>( rudder_trim, -1.0, 1.0 );
705 FGControls::set_flaps( double pos )
708 SG_CLAMP_RANGE<double>( flaps, 0.0, 1.0 );
712 FGControls::move_flaps( double amt )
715 SG_CLAMP_RANGE<double>( flaps, 0.0, 1.0 );
719 FGControls::set_slats( double pos )
722 SG_CLAMP_RANGE<double>( slats, 0.0, 1.0 );
726 FGControls::move_slats( double amt )
729 SG_CLAMP_RANGE<double>( slats, 0.0, 1.0 );
733 FGControls::set_BLC( bool val )
739 FGControls::set_spoilers( double pos )
742 SG_CLAMP_RANGE<double>( spoilers, 0.0, 1.0 );
746 FGControls::move_spoilers( double amt )
749 SG_CLAMP_RANGE<double>( spoilers, 0.0, 1.0 );
753 FGControls::set_speedbrake( double pos )
756 SG_CLAMP_RANGE<double>( speedbrake, 0.0, 1.0 );
760 FGControls::move_speedbrake( double amt )
763 SG_CLAMP_RANGE<double>( speedbrake, 0.0, 1.0 );
767 FGControls::set_wing_sweep( double pos )
770 SG_CLAMP_RANGE<double>( wing_sweep, 0.0, 1.0 );
774 FGControls::move_wing_sweep( double amt )
777 SG_CLAMP_RANGE<double>( wing_sweep, 0.0, 1.0 );
781 FGControls::set_wing_fold( bool val )
787 FGControls::set_drag_chute( bool val )
793 FGControls::set_throttle_idle( bool val )
799 FGControls::set_throttle( int engine, double pos )
801 if ( engine == ALL_ENGINES ) {
802 for ( int i = 0; i < MAX_ENGINES; i++ ) {
804 SG_CLAMP_RANGE<double>( throttle[i], 0.0, 1.0 );
807 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
808 throttle[engine] = pos;
809 SG_CLAMP_RANGE<double>( throttle[engine], 0.0, 1.0 );
815 FGControls::move_throttle( int engine, double amt )
817 if ( engine == ALL_ENGINES ) {
818 for ( int i = 0; i < MAX_ENGINES; i++ ) {
820 SG_CLAMP_RANGE<double>( throttle[i], 0.0, 1.0 );
823 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
824 throttle[engine] += amt;
825 SG_CLAMP_RANGE<double>( throttle[engine], 0.0, 1.0 );
831 FGControls::set_starter( int engine, bool flag )
833 if ( engine == ALL_ENGINES ) {
834 for ( int i = 0; i < MAX_ENGINES; i++ ) {
838 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
839 starter[engine] = flag;
845 FGControls::set_fuel_pump( int engine, bool val )
847 if ( engine == ALL_ENGINES ) {
848 for ( int i = 0; i < MAX_ENGINES; i++ ) {
852 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
853 fuel_pump[engine] = val;
859 FGControls::set_fire_switch( int engine, bool val )
861 if ( engine == ALL_ENGINES ) {
862 for ( int i = 0; i < MAX_ENGINES; i++ ) {
863 fire_switch[i] = val;
866 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
867 fire_switch[engine] = val;
873 FGControls::set_fire_bottle_discharge( int engine, bool val )
875 if ( engine == ALL_ENGINES ) {
876 for ( int i = 0; i < MAX_ENGINES; i++ ) {
877 fire_bottle_discharge[i] = val;
880 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
881 fire_bottle_discharge[engine] = val;
887 FGControls::set_cutoff( int engine, bool val )
889 if ( engine == ALL_ENGINES ) {
890 for ( int i = 0; i < MAX_ENGINES; i++ ) {
894 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
895 cutoff[engine] = val;
901 FGControls::set_feed_tank( int engine, int tank )
903 if ( engine == ALL_ENGINES ) {
904 for ( int i = 0; i < MAX_ENGINES; i++ ) {
906 SG_CLAMP_RANGE<int>( feed_tank[i], -1, 4 );
909 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
910 feed_tank[engine] = tank;
911 SG_CLAMP_RANGE<int>( feed_tank[engine], -1, 4 );
914 // feed_tank[engine] = engine;
919 FGControls::set_mixture( int engine, double pos )
921 if ( engine == ALL_ENGINES ) {
922 for ( int i = 0; i < MAX_ENGINES; i++ ) {
924 SG_CLAMP_RANGE<double>( mixture[i], 0.0, 1.0 );
927 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
928 mixture[engine] = pos;
929 SG_CLAMP_RANGE<double>( mixture[engine], 0.0, 1.0 );
935 FGControls::move_mixture( int engine, double amt )
937 if ( engine == ALL_ENGINES ) {
938 for ( int i = 0; i < MAX_ENGINES; i++ ) {
940 SG_CLAMP_RANGE<double>( mixture[i], 0.0, 1.0 );
943 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
944 mixture[engine] += amt;
945 SG_CLAMP_RANGE<double>( mixture[engine], 0.0, 1.0 );
951 FGControls::set_prop_advance( int engine, double pos )
953 if ( engine == ALL_ENGINES ) {
954 for ( int i = 0; i < MAX_ENGINES; i++ ) {
955 prop_advance[i] = pos;
956 SG_CLAMP_RANGE<double>( prop_advance[i], 0.0, 1.0 );
959 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
960 prop_advance[engine] = pos;
961 SG_CLAMP_RANGE<double>( prop_advance[engine], 0.0, 1.0 );
967 FGControls::move_prop_advance( int engine, double amt )
969 if ( engine == ALL_ENGINES ) {
970 for ( int i = 0; i < MAX_ENGINES; i++ ) {
971 prop_advance[i] += amt;
972 SG_CLAMP_RANGE<double>( prop_advance[i], 0.0, 1.0 );
975 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
976 prop_advance[engine] += amt;
977 SG_CLAMP_RANGE<double>( prop_advance[engine], 0.0, 1.0 );
983 FGControls::set_magnetos( int engine, int pos )
985 if ( engine == ALL_ENGINES ) {
986 for ( int i = 0; i < MAX_ENGINES; i++ ) {
988 SG_CLAMP_RANGE<int>( magnetos[i], 0, 3 );
991 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
992 magnetos[engine] = pos;
993 SG_CLAMP_RANGE<int>( magnetos[engine], 0, 3 );
999 FGControls::move_magnetos( int engine, int amt )
1001 if ( engine == ALL_ENGINES ) {
1002 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1004 SG_CLAMP_RANGE<int>( magnetos[i], 0, 3 );
1007 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1008 magnetos[engine] += amt;
1009 SG_CLAMP_RANGE<int>( magnetos[engine], 0, 3 );
1015 FGControls::set_nitrous_injection( int engine, bool val )
1017 if ( engine == ALL_ENGINES ) {
1018 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1019 nitrous_injection[i] = val;
1022 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1023 nitrous_injection[engine] = val;
1030 FGControls::set_cowl_flaps_norm( int engine, double pos )
1032 if ( engine == ALL_ENGINES ) {
1033 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1034 cowl_flaps_norm[i] = pos;
1035 SG_CLAMP_RANGE<double>( cowl_flaps_norm[i], 0.0, 1.0 );
1038 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1039 cowl_flaps_norm[engine] = pos;
1040 SG_CLAMP_RANGE<double>( cowl_flaps_norm[engine], 0.0, 1.0 );
1046 FGControls::move_cowl_flaps_norm( int engine, double amt )
1048 if ( engine == ALL_ENGINES ) {
1049 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1050 cowl_flaps_norm[i] += amt;
1051 SG_CLAMP_RANGE<double>( cowl_flaps_norm[i], 0.0, 1.0 );
1054 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1055 cowl_flaps_norm[engine] += amt;
1056 SG_CLAMP_RANGE<double>( cowl_flaps_norm[engine], 0.0, 1.0 );
1062 FGControls::set_feather( int engine, bool val )
1064 if ( engine == ALL_ENGINES ) {
1065 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1069 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1070 feather[engine] = val;
1076 FGControls::set_ignition( int engine, int pos )
1078 if ( engine == ALL_ENGINES ) {
1079 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1081 SG_CLAMP_RANGE<int>( ignition[i], 0, 3 );
1084 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1085 ignition[engine] = pos;
1086 SG_CLAMP_RANGE<int>( ignition[engine], 0, 3 );
1092 FGControls::set_augmentation( int engine, bool val )
1094 if ( engine == ALL_ENGINES ) {
1095 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1096 augmentation[i] = val;
1099 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1100 augmentation[engine] = val;
1106 FGControls::set_reverser( int engine, bool val )
1108 if ( engine == ALL_ENGINES ) {
1109 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1113 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1114 reverser[engine] = val;
1120 FGControls::set_water_injection( int engine, bool val )
1122 if ( engine == ALL_ENGINES ) {
1123 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1124 water_injection[i] = val;
1127 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1128 water_injection[engine] = val;
1134 FGControls::set_condition( int engine, double val )
1136 if ( engine == ALL_ENGINES ) {
1137 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1139 SG_CLAMP_RANGE<double>( condition[i], 0.0, 1.0 );
1142 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1143 condition[engine] = val;
1144 SG_CLAMP_RANGE<double>( condition[engine], 0.0, 1.0 );
1150 FGControls::set_dump_valve( bool val )
1157 FGControls::set_fuel_selector( int tank, bool pos )
1159 if ( tank == ALL_TANKS ) {
1160 for ( int i = 0; i < MAX_TANKS; i++ ) {
1161 fuel_selector[i] = pos;
1164 if ( (tank >= 0) && (tank < MAX_TANKS) ) {
1165 fuel_selector[tank] = pos;
1171 FGControls::set_to_engine( int tank, int engine )
1173 if ( tank == ALL_TANKS ) {
1174 for ( int i = 0; i < MAX_TANKS; i++ ) {
1175 to_engine[i] = engine;
1178 if ( (tank >= 0) && (tank < MAX_TANKS) ) {
1179 to_engine[tank] = engine;
1185 FGControls::set_to_tank( int tank, int dest_tank )
1187 if ( tank == ALL_TANKS ) {
1188 for ( int i = 0; i < MAX_TANKS; i++ ) {
1189 to_tank[i] = dest_tank;
1192 if ( (tank >= 0) && (tank < MAX_TANKS) ) {
1193 to_tank[tank] = dest_tank;
1199 FGControls::set_boost_pump( int index, bool val )
1201 if ( index == -1 ) {
1202 for ( int i = 0; i < (MAX_TANKS * MAX_BOOSTPUMPS); i++ ) {
1203 boost_pump[i] = val;
1206 if ( (index >= 0) && (index < (MAX_TANKS * MAX_BOOSTPUMPS)) ) {
1207 boost_pump[index] = val;
1214 FGControls::set_brake_left( double pos )
1217 SG_CLAMP_RANGE<double>(brake_left, 0.0, 1.0);
1221 FGControls::move_brake_left( double amt )
1224 SG_CLAMP_RANGE<double>( brake_left, 0.0, 1.0 );
1228 FGControls::set_brake_right( double pos )
1231 SG_CLAMP_RANGE<double>(brake_right, 0.0, 1.0);
1235 FGControls::move_brake_right( double amt )
1238 SG_CLAMP_RANGE<double>( brake_right, 0.0, 1.0 );
1242 FGControls::set_copilot_brake_left( double pos )
1244 copilot_brake_left = pos;
1245 SG_CLAMP_RANGE<double>(brake_left, 0.0, 1.0);
1249 FGControls::set_copilot_brake_right( double pos )
1251 copilot_brake_right = pos;
1252 SG_CLAMP_RANGE<double>(brake_right, 0.0, 1.0);
1256 FGControls::set_brake_parking( double pos )
1258 brake_parking = pos;
1259 SG_CLAMP_RANGE<double>(brake_parking, 0.0, 1.0);
1263 FGControls::set_steering( double angle )
1266 SG_CLAMP_RANGE<double>(steering, -80.0, 80.0);
1270 FGControls::set_nose_wheel_steering( bool nws )
1272 nose_wheel_steering = nws;
1276 FGControls::move_steering( double angle )
1279 SG_CLAMP_RANGE<double>(steering, -80.0, 80.0);
1283 FGControls::set_gear_down( bool gear )
1289 FGControls::set_antiskid( bool state )
1295 FGControls::set_tailhook( bool state )
1301 FGControls::set_launchbar( bool state )
1307 FGControls::set_catapult_launch_cmd( bool state )
1309 catapult_launch_cmd = state;
1313 FGControls::set_tailwheel_lock( bool state )
1315 tailwheel_lock = state;
1320 FGControls::set_alternate_extension( int wheel, bool val )
1322 if ( wheel == ALL_WHEELS ) {
1323 for ( int i = 0; i < MAX_WHEELS; i++ ) {
1324 alternate_extension[i] = val;
1327 if ( (wheel >= 0) && (wheel < MAX_WHEELS) ) {
1328 alternate_extension[wheel] = val;
1334 FGControls::set_wing_heat( bool state )
1340 FGControls::set_pitot_heat( bool state )
1346 FGControls::set_wiper( int state )
1352 FGControls::set_window_heat( bool state )
1354 window_heat = state;
1358 FGControls::set_carb_heat( int engine, bool val )
1360 if ( engine == ALL_ENGINES ) {
1361 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1365 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1366 carb_heat[engine] = val;
1372 FGControls::set_inlet_heat( int engine, bool val )
1374 if ( engine == ALL_ENGINES ) {
1375 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1376 inlet_heat[i] = val;
1379 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1380 inlet_heat[engine] = val;
1386 FGControls::set_engine_pump( int system, bool val )
1388 if ( system == ALL_HYD_SYSTEMS ) {
1389 for ( int i = 0; i < MAX_HYD_SYSTEMS; i++ ) {
1390 engine_pump[i] = val;
1393 if ( (system >= 0) && (system < MAX_HYD_SYSTEMS) ) {
1394 engine_pump[system] = val;
1400 FGControls::set_electric_pump( int system, bool val )
1402 if ( system == ALL_HYD_SYSTEMS ) {
1403 for ( int i = 0; i < MAX_HYD_SYSTEMS; i++ ) {
1404 electric_pump[i] = val;
1407 if ( (system >= 0) && (system < MAX_HYD_SYSTEMS) ) {
1408 electric_pump[system] = val;
1414 FGControls::set_battery_switch( bool state )
1416 battery_switch = state;
1420 FGControls::set_external_power( bool state )
1422 external_power = state;
1426 FGControls::set_APU_generator( bool state )
1428 APU_generator = state;
1432 FGControls::set_generator_breaker( int engine, bool val )
1434 if ( engine == ALL_ENGINES ) {
1435 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1436 generator_breaker[i] = val;
1439 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1440 generator_breaker[engine] = val;
1446 FGControls::set_bus_tie( int engine, bool val )
1448 if ( engine == ALL_ENGINES ) {
1449 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1453 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1454 bus_tie[engine] = val;
1460 FGControls::set_APU_bleed( bool state )
1466 FGControls::set_engine_bleed( int engine, bool val )
1468 if ( engine == ALL_ENGINES ) {
1469 for ( int i = 0; i < MAX_ENGINES; i++ ) {
1470 engine_bleed[i] = val;
1473 if ( (engine >= 0) && (engine < MAX_ENGINES) ) {
1474 engine_bleed[engine] = val;
1480 FGControls::set_mode( int new_mode )
1486 FGControls::set_outflow_valve( double pos )
1488 outflow_valve = pos;
1489 SG_CLAMP_RANGE<double>( outflow_valve, 0.0, 1.0 );
1493 FGControls::move_outflow_valve( double amt )
1495 outflow_valve += amt;
1496 SG_CLAMP_RANGE<double>( outflow_valve, 0.0, 1.0 );
1500 FGControls::set_dump( bool state )
1506 FGControls::set_pack_on( int pack, bool val )
1508 if ( pack == ALL_PACKS ) {
1509 for ( int i = 0; i < MAX_PACKS; i++ ) {
1513 if ( (pack >= 0) && (pack < MAX_PACKS) ) {
1514 pack_on[pack] = val;
1520 FGControls::set_landing_lights( bool state )
1522 landing_lights = state;
1526 FGControls::set_turn_off_lights( bool state )
1528 turn_off_lights = state;
1532 FGControls::set_taxi_light( bool state )
1538 FGControls::set_logo_lights( bool state )
1540 logo_lights = state;
1544 FGControls::set_nav_lights( bool state )
1550 FGControls::set_beacon( bool state )
1556 FGControls::set_strobe( bool state )
1562 FGControls::set_panel_norm( double intensity )
1564 panel_norm = intensity;
1565 SG_CLAMP_RANGE<double>( panel_norm, 0.0, 1.0 );
1569 FGControls::move_panel_norm( double amt )
1572 SG_CLAMP_RANGE<double>( panel_norm, 0.0, 1.0 );
1576 FGControls::set_instruments_norm( double intensity )
1578 instruments_norm = intensity;
1579 SG_CLAMP_RANGE<double>( instruments_norm, 0.0, 1.0 );
1583 FGControls::move_instruments_norm( double amt )
1585 instruments_norm += amt;
1586 SG_CLAMP_RANGE<double>( instruments_norm, 0.0, 1.0 );
1590 FGControls::set_dome_norm( double intensity )
1592 dome_norm = intensity;
1593 SG_CLAMP_RANGE<double>( dome_norm, 0.0, 1.0 );
1597 FGControls::move_dome_norm( double amt )
1600 SG_CLAMP_RANGE<double>( dome_norm, 0.0, 1.0 );
1604 FGControls::set_master_arm( bool val )
1610 FGControls::set_station_select( int station )
1612 station_select = station;
1613 SG_CLAMP_RANGE<int>( station_select, 0, MAX_STATIONS );
1617 FGControls::set_release_ALL( bool val )
1623 FGControls::set_stick_size( int station, int size )
1625 if ( station == ALL_STATIONS ) {
1626 for ( int i = 0; i < MAX_STATIONS; i++ ) {
1627 stick_size[i] = size;
1628 SG_CLAMP_RANGE<int>( stick_size[i], 1, 20 );
1631 if ( (station >= 0) && (station < MAX_STATIONS) ) {
1632 stick_size[station] = size;
1633 SG_CLAMP_RANGE<int>( stick_size[station], 1, 20 );
1639 FGControls::set_release_stick( int station, bool val )
1641 if ( station == ALL_STATIONS ) {
1642 for ( int i = 0; i < MAX_STATIONS; i++ ) {
1643 release_stick[i] = val;
1646 if ( (station >= 0) && (station < MAX_STATIONS) ) {
1647 release_stick[station] = val;
1653 FGControls::set_release_all( int station, bool val )
1655 if ( station == ALL_STATIONS ) {
1656 for ( int i = 0; i < MAX_STATIONS; i++ ) {
1657 release_all[i] = val;
1660 if ( (station >= 0) && (station < MAX_STATIONS) ) {
1661 release_all[station] = val;
1667 FGControls::set_jettison_all( int station, bool val )
1669 if ( station == ALL_STATIONS ) {
1670 for ( int i = 0; i < MAX_STATIONS; i++ ) {
1671 jettison_all[i] = val;
1674 if ( (station >= 0) && (station < MAX_STATIONS) ) {
1675 jettison_all[station] = val;
1681 FGControls::set_vertical_adjust( double pos )
1683 vertical_adjust = pos;
1684 SG_CLAMP_RANGE<double>( vertical_adjust, -1.0, 1.0 );
1688 FGControls::move_vertical_adjust( double amt )
1690 vertical_adjust += amt;
1691 SG_CLAMP_RANGE<double>( vertical_adjust, -1.0, 1.0 );
1695 FGControls::set_fore_aft_adjust( double pos )
1697 fore_aft_adjust = pos;
1698 SG_CLAMP_RANGE<double>( fore_aft_adjust, -1.0, 1.0 );
1702 FGControls::move_fore_aft_adjust( double amt )
1704 fore_aft_adjust += amt;
1705 SG_CLAMP_RANGE<double>( fore_aft_adjust, -1.0, 1.0 );
1709 FGControls::set_ejection_seat( int which_seat, bool val )
1711 if ( which_seat == ALL_EJECTION_SEATS ) {
1712 for ( int i = 0; i < MAX_EJECTION_SEATS; i++ ) {
1716 if ( (which_seat >= 0) && (which_seat <= MAX_EJECTION_SEATS) ) {
1717 if ( eseat_status[which_seat] == SEAT_SAFED ||
1718 eseat_status[which_seat] == SEAT_FAIL )
1720 // we can never eject if SEAT_SAFED or SEAT_FAIL
1724 eject[which_seat] = val;
1730 FGControls::set_eseat_status( int which_seat, int val )
1732 if ( which_seat == ALL_EJECTION_SEATS ) {
1733 for ( int i = 0; i < MAX_EJECTION_SEATS; i++ ) {
1734 eseat_status[i] = val;
1737 if ( (which_seat >=0) && (which_seat <= MAX_EJECTION_SEATS) ) {
1738 eseat_status[which_seat] = val;
1744 FGControls::set_cmd_selector_valve( int val )
1746 cmd_selector_valve = val;
1751 FGControls::set_off_start_run( int pos )
1753 off_start_run = pos;
1754 SG_CLAMP_RANGE<int>( off_start_run, 0, 3 );
1758 FGControls::set_APU_fire_switch( bool val )
1760 APU_fire_switch = val;
1764 FGControls::set_autothrottle_arm( bool val )
1766 autothrottle_arm = val;
1770 FGControls::set_autothrottle_engage( bool val )
1772 autothrottle_engage = val;
1776 FGControls::set_heading_select( double heading )
1778 heading_select = heading;
1779 SG_CLAMP_RANGE<double>( heading_select, 0.0, 360.0 );
1783 FGControls::move_heading_select( double amt )
1785 heading_select += amt;
1786 SG_CLAMP_RANGE<double>( heading_select, 0.0, 360.0 );
1790 FGControls::set_altitude_select( double altitude )
1792 altitude_select = altitude;
1793 SG_CLAMP_RANGE<double>( altitude_select, -1000.0, 100000.0 );
1797 FGControls::move_altitude_select( double amt )
1799 altitude_select += amt;
1800 SG_CLAMP_RANGE<double>( altitude_select, -1000.0, 100000.0 );
1804 FGControls::set_bank_angle_select( double angle )
1806 bank_angle_select = angle;
1807 SG_CLAMP_RANGE<double>( bank_angle_select, 10.0, 30.0 );
1811 FGControls::move_bank_angle_select( double amt )
1813 bank_angle_select += amt;
1814 SG_CLAMP_RANGE<double>( bank_angle_select, 10.0, 30.0 );
1818 FGControls::set_vertical_speed_select( double speed )
1820 vertical_speed_select = speed;
1821 SG_CLAMP_RANGE<double>( vertical_speed_select, -3000.0, 4000.0 );
1825 FGControls::move_vertical_speed_select( double amt )
1827 vertical_speed_select += amt;
1828 SG_CLAMP_RANGE<double>( vertical_speed_select, -3000.0, 4000.0 );
1832 FGControls::set_speed_select( double speed )
1834 speed_select = speed;
1835 SG_CLAMP_RANGE<double>( speed_select, 60.0, 400.0 );
1839 FGControls::move_speed_select( double amt )
1841 speed_select += amt;
1842 SG_CLAMP_RANGE<double>( speed_select, 60.0, 400.0 );
1846 FGControls::set_mach_select( double mach )
1849 SG_CLAMP_RANGE<double>( mach_select, 0.4, 4.0 );
1853 FGControls::move_mach_select( double amt )
1856 SG_CLAMP_RANGE<double>( mach_select, 0.4, 4.0 );
1860 FGControls::set_vertical_mode( int mode )
1862 vertical_mode = mode;
1863 SG_CLAMP_RANGE<int>( vertical_mode, 0, 4 );
1867 FGControls::set_lateral_mode( int mode )
1869 lateral_mode = mode;
1870 SG_CLAMP_RANGE<int>( lateral_mode, 0, 4 );
1874 FGControls::set_autopilot_engage( int ap, bool val )
1876 if ( ap == ALL_AUTOPILOTS ) {
1877 for ( int i = 0; i < MAX_AUTOPILOTS; i++ ) {
1878 autopilot_engage[i] = val;
1881 if ( (ap >= 0) && (ap < MAX_AUTOPILOTS) ) {
1882 autopilot_engage[ap] = val;