28#include <simgear/sg_inlines.h>
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 );
86 _inner_set_aileron( 0.0 );
87 _inner_set_aileron_trim( 0.0 );
88 _inner_set_elevator( 0.0 );
89 _inner_set_elevator_trim( 0.0 );
90 _inner_set_rudder( 0.0 );
91 set_rudder_trim( 0.0 );
94 set_speedbrake( 0.0 );
95 set_wing_sweep( 0.0 );
113 throttle_idle =
true;
117 nose_wheel_steering =
true;
121 catapult_launch_cmd =
false;
122 tailwheel_lock =
true;
131 landing_lights =
false;
132 turn_off_lights =
false;
137 APU_fire_switch =
false;
138 autothrottle_arm =
false;
139 autothrottle_engage =
false;
142 brake_left = brake_right
143 = copilot_brake_left = copilot_brake_right
144 = brake_parking = 0.0;
178 _tiedProperties.fireValueChanged();
181static inline void _SetRoot( simgear::TiedPropertyList & tiedProperties,
const char * root,
int index = 0 )
183 tiedProperties.setRoot(
fgGetNode( root, index,
true ) );
193 _SetRoot( _tiedProperties,
"/controls/flight" );
195 _aileronNode = _tiedProperties.Tie(
"aileron",
this, &
FGControls::get_aileron, &FGControls::_inner_set_aileron );
197 _elevatorNode = _tiedProperties.Tie(
"elevator",
this, &
FGControls::get_elevator, &FGControls::_inner_set_elevator );
199 _rudderNode = _tiedProperties.Tie(
"rudder",
this, &
FGControls::get_rudder, &FGControls::_inner_set_rudder );
213 _tiedProperties.setRoot(
fgGetNode(
"/controls/engines",
true ) );
219 _SetRoot(_tiedProperties,
"/controls/engines/engine", index );
221 _engineThrottleNodes.push_back(_tiedProperties.Tie(
"throttle",
this, index, &
FGControls::get_throttle, &FGControls::_inner_set_throttle ));
222 _engineStarterNodes.push_back(_tiedProperties.Tie(
"starter",
this, index, &
FGControls::get_starter, &FGControls::_inner_set_starter ));
226 _engineCutoffNodes.push_back(_tiedProperties.Tie(
"cutoff",
this, index, &
FGControls::get_cutoff, &FGControls::_inner_set_cutoff ));
227 _engineMixtureNodes.push_back( _tiedProperties.Tie(
"mixture",
this, index, &
FGControls::get_mixture, &FGControls::_inner_set_mixture ));
229 _engineMagnetoNodes.push_back(_tiedProperties.Tie(
"magnetos",
this, index, &
FGControls::get_magnetos, &FGControls::_inner_set_magnetos ));
237 _engineAugmentationNodes.push_back(_tiedProperties.Tie(
"augmentation",
this, index, &
FGControls::get_augmentation, &FGControls::_inner_set_augmentation ));
238 _engineReverserNodes.push_back(_tiedProperties.Tie(
"reverser",
this, index, &
FGControls::get_reverser, &FGControls::_inner_set_reverser ));
239 _engineWaterInjectionNodes.push_back(_tiedProperties.Tie(
"water-injection",
this, index, &
FGControls::get_water_injection, &FGControls::_inner_set_water_injection ));
245 _SetRoot( _tiedProperties,
"/controls/fuel" );
250 for (index = 0; index <
MAX_TANKS; index++) {
251 _SetRoot( _tiedProperties,
"/controls/fuel/tank", index );
259 _tiedProperties.Tie(
"boost-pump",
i,
266 _SetRoot( _tiedProperties,
"/controls/gear" );
283 for (index = 0; index <
MAX_WHEELS; index++) {
284 _SetRoot( _tiedProperties,
"/controls/gear/wheel", index );
289 _SetRoot( _tiedProperties,
"/controls/anti-ice" );
297 _SetRoot( _tiedProperties,
"/controls/anti-ice/engine", index );
306 _SetRoot( _tiedProperties,
"/controls/hydraulic/system", index );
313 _SetRoot( _tiedProperties,
"/controls/electric" );
320 _SetRoot( _tiedProperties,
"/controls/electric/engine", index );
327 _SetRoot( _tiedProperties,
"/controls/pneumatic" );
332 _SetRoot( _tiedProperties,
"/controls/pneumatic/engine", index );
337 _SetRoot( _tiedProperties,
"/controls/pressurization" );
343 for (index = 0; index <
MAX_PACKS; index++) {
344 _SetRoot( _tiedProperties,
"/controls/pressurization/pack", index );
350 _SetRoot( _tiedProperties,
"/controls/lighting" );
364 _SetRoot( _tiedProperties,
"/controls/armament" );
372 _SetRoot( _tiedProperties,
"/controls/armament/station", index );
381 _SetRoot( _tiedProperties,
"/controls/seat" );
389 _SetRoot( _tiedProperties,
"/controls/seat/eject", index );
397 _SetRoot( _tiedProperties,
"/controls/APU" );
406 _SetRoot( _tiedProperties,
"/controls/autoflight/autopilot", index );
410 _SetRoot( _tiedProperties,
"/controls/autoflight/" );
423 _tiedProperties.setAttribute(SGPropertyNode::ARCHIVE,
true);
427 _tiedProperties.setAttribute(SGPropertyNode::LISTENER_SAFE,
true);
432 _tiedProperties.Untie();
434 _aileronNode.clear();
435 _elevatorNode.clear();
436 _aileronTrimNode.clear();
437 _elevatorTrimNode.clear();
439 _engineThrottleNodes.clear();
440 _engineReverserNodes.clear();
441 _engineMixtureNodes.clear();
442 _engineCutoffNodes.clear();
443 _engineStarterNodes.clear();
444 _engineWaterInjectionNodes.clear();
445 _engineAugmentationNodes.clear();
446 _engineMagnetoNodes.clear();
465 _inner_set_aileron(pos);
466 _aileronNode->fireValueChanged();
470FGControls::_inner_set_aileron (
double pos)
473 SG_CLAMP_RANGE<double>( aileron, -1.0, 1.0 );
474 do_autocoordination();
478FGControls::move_aileron (
double amt)
481 SG_CLAMP_RANGE<double>( aileron, -1.0, 1.0 );
482 do_autocoordination();
487 _inner_set_aileron_trim(pos);
488 _aileronTrimNode->fireValueChanged();
492FGControls::_inner_set_aileron_trim(
double pos )
495 SG_CLAMP_RANGE<double>( aileron_trim, -1.0, 1.0 );
499FGControls::move_aileron_trim(
double amt )
502 SG_CLAMP_RANGE<double>( aileron_trim, -1.0, 1.0 );
507 _inner_set_elevator(pos);
508 _elevatorNode->fireValueChanged();
512FGControls::_inner_set_elevator(
double pos )
515 SG_CLAMP_RANGE<double>( elevator, -1.0, 1.0 );
519FGControls::move_elevator(
double amt )
522 SG_CLAMP_RANGE<double>( elevator, -1.0, 1.0 );
527 _inner_set_elevator_trim(pos);
528 _elevatorTrimNode->fireValueChanged();
532FGControls::_inner_set_elevator_trim(
double pos )
535 SG_CLAMP_RANGE<double>( elevator_trim, -1.0, 1.0 );
539FGControls::move_elevator_trim(
double amt )
541 elevator_trim += amt;
542 SG_CLAMP_RANGE<double>( elevator_trim, -1.0, 1.0 );
547 _inner_set_rudder(pos);
549 _rudderNode->fireValueChanged();
554FGControls::_inner_set_rudder(
double pos )
557 SG_CLAMP_RANGE<double>( rudder, -1.0, 1.0 );
561FGControls::move_rudder(
double amt )
564 SG_CLAMP_RANGE<double>( rudder, -1.0, 1.0 );
568FGControls::set_rudder_trim(
double pos )
571 SG_CLAMP_RANGE<double>( rudder_trim, -1.0, 1.0 );
575FGControls::move_rudder_trim(
double amt )
578 SG_CLAMP_RANGE<double>( rudder_trim, -1.0, 1.0 );
582FGControls::set_flaps(
double pos )
585 SG_CLAMP_RANGE<double>( flaps, 0.0, 1.0 );
589FGControls::move_flaps(
double amt )
592 SG_CLAMP_RANGE<double>( flaps, 0.0, 1.0 );
596FGControls::set_slats(
double pos )
599 SG_CLAMP_RANGE<double>( slats, 0.0, 1.0 );
603FGControls::move_slats(
double amt )
606 SG_CLAMP_RANGE<double>( slats, 0.0, 1.0 );
610FGControls::set_BLC(
bool val )
616FGControls::set_spoilers(
double pos )
619 SG_CLAMP_RANGE<double>( spoilers, 0.0, 1.0 );
623FGControls::move_spoilers(
double amt )
626 SG_CLAMP_RANGE<double>( spoilers, 0.0, 1.0 );
630FGControls::set_speedbrake(
double pos )
633 SG_CLAMP_RANGE<double>( speedbrake, 0.0, 1.0 );
637FGControls::move_speedbrake(
double amt )
640 SG_CLAMP_RANGE<double>( speedbrake, 0.0, 1.0 );
644FGControls::set_wing_sweep(
double pos )
647 SG_CLAMP_RANGE<double>( wing_sweep, 0.0, 1.0 );
651FGControls::move_wing_sweep(
double amt )
654 SG_CLAMP_RANGE<double>( wing_sweep, 0.0, 1.0 );
658FGControls::set_wing_fold(
bool val )
664FGControls::set_drag_chute(
bool val )
670FGControls::set_throttle_idle(
bool val )
678 _inner_set_throttle(engine, pos);
679 fireEngineValueChanged(engine, _engineThrottleNodes);
683FGControls::_inner_set_throttle(
int engine,
double pos )
688 SG_CLAMP_RANGE<double>(
throttle[
i], 0.0, 1.0 );
692 throttle[engine] = pos;
693 SG_CLAMP_RANGE<double>( throttle[engine], 0.0, 1.0 );
699FGControls::move_throttle(
int engine,
double amt )
704 SG_CLAMP_RANGE<double>( throttle[
i], 0.0, 1.0 );
708 throttle[engine] += amt;
709 SG_CLAMP_RANGE<double>( throttle[engine], 0.0, 1.0 );
716 _inner_set_starter(engine, flag);
717 fireEngineValueChanged(engine, _engineStarterNodes);
721FGControls::_inner_set_starter(
int engine,
bool flag )
729 starter[engine] = flag;
735FGControls::set_fuel_pump(
int engine,
bool val )
743 fuel_pump[engine] = val;
749FGControls::set_fire_switch(
int engine,
bool val )
753 fire_switch[
i] = val;
757 fire_switch[engine] = val;
763FGControls::set_fire_bottle_discharge(
int engine,
bool val )
767 fire_bottle_discharge[
i] = val;
771 fire_bottle_discharge[engine] = val;
779 _inner_set_cutoff(engine, val);
780 fireEngineValueChanged(engine, _engineCutoffNodes);
784FGControls::_inner_set_cutoff(
int engine,
bool val )
792 cutoff[engine] = val;
798FGControls::set_feed_tank(
int engine,
int tank )
803 SG_CLAMP_RANGE<int>( feed_tank[
i], -1, 4 );
807 feed_tank[engine] = tank;
808 SG_CLAMP_RANGE<int>( feed_tank[engine], -1, 4 );
817 _inner_set_mixture(engine, pos);
818 fireEngineValueChanged(engine, _engineMixtureNodes);
822FGControls::_inner_set_mixture(
int engine,
double pos )
827 SG_CLAMP_RANGE<double>( mixture[
i], 0.0, 1.0 );
831 mixture[engine] = pos;
832 SG_CLAMP_RANGE<double>( mixture[engine], 0.0, 1.0 );
838FGControls::move_mixture(
int engine,
double amt )
843 SG_CLAMP_RANGE<double>( mixture[
i], 0.0, 1.0 );
847 mixture[engine] += amt;
848 SG_CLAMP_RANGE<double>( mixture[engine], 0.0, 1.0 );
854FGControls::set_prop_advance(
int engine,
double pos )
858 prop_advance[
i] = pos;
859 SG_CLAMP_RANGE<double>( prop_advance[
i], 0.0, 1.0 );
863 prop_advance[engine] = pos;
864 SG_CLAMP_RANGE<double>( prop_advance[engine], 0.0, 1.0 );
870FGControls::move_prop_advance(
int engine,
double amt )
874 prop_advance[
i] += amt;
875 SG_CLAMP_RANGE<double>( prop_advance[
i], 0.0, 1.0 );
879 prop_advance[engine] += amt;
880 SG_CLAMP_RANGE<double>( prop_advance[engine], 0.0, 1.0 );
888 _inner_set_magnetos(engine, pos);
889 fireEngineValueChanged(engine, _engineMagnetoNodes);
894FGControls::_inner_set_magnetos(
int engine,
int pos )
899 SG_CLAMP_RANGE<int>( magnetos[
i], 0, 3 );
903 magnetos[engine] = pos;
904 SG_CLAMP_RANGE<int>( magnetos[engine], 0, 3 );
910FGControls::move_magnetos(
int engine,
int amt )
915 SG_CLAMP_RANGE<int>( magnetos[
i], 0, 3 );
919 magnetos[engine] += amt;
920 SG_CLAMP_RANGE<int>( magnetos[engine], 0, 3 );
926FGControls::set_nitrous_injection(
int engine,
bool val )
930 nitrous_injection[
i] = val;
934 nitrous_injection[engine] = val;
941FGControls::set_cowl_flaps_norm(
int engine,
double pos )
945 cowl_flaps_norm[
i] = pos;
946 SG_CLAMP_RANGE<double>( cowl_flaps_norm[
i], 0.0, 1.0 );
950 cowl_flaps_norm[engine] = pos;
951 SG_CLAMP_RANGE<double>( cowl_flaps_norm[engine], 0.0, 1.0 );
957FGControls::move_cowl_flaps_norm(
int engine,
double amt )
961 cowl_flaps_norm[
i] += amt;
962 SG_CLAMP_RANGE<double>( cowl_flaps_norm[
i], 0.0, 1.0 );
966 cowl_flaps_norm[engine] += amt;
967 SG_CLAMP_RANGE<double>( cowl_flaps_norm[engine], 0.0, 1.0 );
973FGControls::set_feather(
int engine,
bool val )
981 feather[engine] = val;
987FGControls::set_ignition(
int engine,
int pos )
992 SG_CLAMP_RANGE<int>( ignition[
i], 0, 3 );
996 ignition[engine] = pos;
997 SG_CLAMP_RANGE<int>( ignition[engine], 0, 3 );
1005 _inner_set_augmentation(engine, val);
1006 fireEngineValueChanged(engine, _engineAugmentationNodes);
1010FGControls::_inner_set_augmentation(
int engine,
bool val )
1014 augmentation[
i] = val;
1018 augmentation[engine] = val;
1026 _inner_set_reverser(engine, val);
1027 fireEngineValueChanged(engine, _engineReverserNodes);
1031FGControls::_inner_set_reverser(
int engine,
bool val )
1039 reverser[engine] = val;
1047 _inner_set_water_injection(engine, val);
1048 fireEngineValueChanged(engine, _engineWaterInjectionNodes);
1052FGControls::_inner_set_water_injection(
int engine,
bool val )
1056 water_injection[
i] = val;
1060 water_injection[engine] = val;
1066FGControls::set_condition(
int engine,
double val )
1071 SG_CLAMP_RANGE<double>( condition[
i], 0.0, 1.0 );
1075 condition[engine] = val;
1076 SG_CLAMP_RANGE<double>( condition[engine], 0.0, 1.0 );
1082FGControls::set_dump_valve(
bool val )
1089FGControls::set_fuel_selector(
int tank,
bool pos )
1093 fuel_selector[
i] = pos;
1096 if ( (tank >= 0) && (tank <
MAX_TANKS) ) {
1097 fuel_selector[tank] = pos;
1103FGControls::set_to_engine(
int tank,
int engine )
1107 to_engine[
i] = engine;
1110 if ( (tank >= 0) && (tank <
MAX_TANKS) ) {
1111 to_engine[tank] = engine;
1117FGControls::set_to_tank(
int tank,
int dest_tank )
1121 to_tank[
i] = dest_tank;
1124 if ( (tank >= 0) && (tank <
MAX_TANKS) ) {
1125 to_tank[tank] = dest_tank;
1131FGControls::set_boost_pump(
int index,
bool val )
1133 if ( index == -1 ) {
1135 boost_pump[
i] = val;
1139 boost_pump[index] = val;
1146FGControls::set_brake_left(
double pos )
1149 SG_CLAMP_RANGE<double>(brake_left, 0.0, 1.0);
1153FGControls::move_brake_left(
double amt )
1156 SG_CLAMP_RANGE<double>( brake_left, 0.0, 1.0 );
1160FGControls::set_brake_right(
double pos )
1163 SG_CLAMP_RANGE<double>(brake_right, 0.0, 1.0);
1167FGControls::move_brake_right(
double amt )
1170 SG_CLAMP_RANGE<double>( brake_right, 0.0, 1.0 );
1174FGControls::set_copilot_brake_left(
double pos )
1176 copilot_brake_left = pos;
1177 SG_CLAMP_RANGE<double>(brake_left, 0.0, 1.0);
1181FGControls::set_copilot_brake_right(
double pos )
1183 copilot_brake_right = pos;
1184 SG_CLAMP_RANGE<double>(brake_right, 0.0, 1.0);
1188FGControls::set_brake_parking(
double pos )
1190 brake_parking = pos;
1191 SG_CLAMP_RANGE<double>(brake_parking, 0.0, 1.0);
1195FGControls::set_steering(
double angle )
1198 SG_CLAMP_RANGE<double>(steering, -80.0, 80.0);
1202FGControls::set_nose_wheel_steering(
bool nws )
1204 nose_wheel_steering = nws;
1208FGControls::move_steering(
double angle )
1211 SG_CLAMP_RANGE<double>(steering, -80.0, 80.0);
1215FGControls::set_gear_down(
bool gear )
1221FGControls::set_antiskid(
bool state )
1227FGControls::set_tailhook(
bool state )
1233FGControls::set_launchbar(
bool state )
1239FGControls::set_catapult_launch_cmd(
bool state )
1241 catapult_launch_cmd = state;
1245FGControls::set_tailwheel_lock(
bool state )
1247 tailwheel_lock = state;
1252FGControls::set_alternate_extension(
int wheel,
bool val )
1256 alternate_extension[
i] = val;
1259 if ( (wheel >= 0) && (wheel <
MAX_WHEELS) ) {
1260 alternate_extension[wheel] = val;
1266FGControls::set_wing_heat(
bool state )
1272FGControls::set_pitot_heat(
bool state )
1278FGControls::set_wiper(
int state )
1284FGControls::set_window_heat(
bool state )
1286 window_heat = state;
1290FGControls::set_carb_heat(
int engine,
bool val )
1298 carb_heat[engine] = val;
1304FGControls::set_inlet_heat(
int engine,
bool val )
1308 inlet_heat[
i] = val;
1312 inlet_heat[engine] = val;
1318FGControls::set_engine_pump(
int system,
bool val )
1322 engine_pump[
i] = val;
1326 engine_pump[system] = val;
1332FGControls::set_electric_pump(
int system,
bool val )
1336 electric_pump[
i] = val;
1340 electric_pump[system] = val;
1346FGControls::set_battery_switch(
bool state )
1348 battery_switch = state;
1352FGControls::set_external_power(
bool state )
1354 external_power = state;
1358FGControls::set_APU_generator(
bool state )
1360 APU_generator = state;
1364FGControls::set_generator_breaker(
int engine,
bool val )
1368 generator_breaker[
i] = val;
1372 generator_breaker[engine] = val;
1378FGControls::set_bus_tie(
int engine,
bool val )
1386 bus_tie[engine] = val;
1392FGControls::set_APU_bleed(
bool state )
1398FGControls::set_engine_bleed(
int engine,
bool val )
1402 engine_bleed[
i] = val;
1406 engine_bleed[engine] = val;
1412FGControls::set_mode(
int new_mode )
1418FGControls::set_outflow_valve(
double pos )
1420 outflow_valve = pos;
1421 SG_CLAMP_RANGE<double>( outflow_valve, 0.0, 1.0 );
1425FGControls::move_outflow_valve(
double amt )
1427 outflow_valve += amt;
1428 SG_CLAMP_RANGE<double>( outflow_valve, 0.0, 1.0 );
1432FGControls::set_dump(
bool state )
1438FGControls::set_pack_on(
int pack,
bool val )
1445 if ( (pack >= 0) && (pack <
MAX_PACKS) ) {
1446 pack_on[pack] = val;
1452FGControls::set_landing_lights(
bool state )
1454 landing_lights = state;
1458FGControls::set_turn_off_lights(
bool state )
1460 turn_off_lights = state;
1464FGControls::set_taxi_light(
bool state )
1470FGControls::set_logo_lights(
bool state )
1472 logo_lights = state;
1476FGControls::set_nav_lights(
bool state )
1482FGControls::set_beacon(
bool state )
1488FGControls::set_strobe(
bool state )
1494FGControls::set_panel_norm(
double intensity )
1496 panel_norm = intensity;
1497 SG_CLAMP_RANGE<double>( panel_norm, 0.0, 1.0 );
1501FGControls::move_panel_norm(
double amt )
1504 SG_CLAMP_RANGE<double>( panel_norm, 0.0, 1.0 );
1508FGControls::set_instruments_norm(
double intensity )
1510 instruments_norm = intensity;
1511 SG_CLAMP_RANGE<double>( instruments_norm, 0.0, 1.0 );
1515FGControls::move_instruments_norm(
double amt )
1517 instruments_norm += amt;
1518 SG_CLAMP_RANGE<double>( instruments_norm, 0.0, 1.0 );
1522FGControls::set_dome_norm(
double intensity )
1524 dome_norm = intensity;
1525 SG_CLAMP_RANGE<double>( dome_norm, 0.0, 1.0 );
1529FGControls::move_dome_norm(
double amt )
1532 SG_CLAMP_RANGE<double>( dome_norm, 0.0, 1.0 );
1536FGControls::set_master_arm(
bool val )
1542FGControls::set_station_select(
int station )
1544 station_select = station;
1545 SG_CLAMP_RANGE<int>( station_select, 0,
MAX_STATIONS );
1549FGControls::set_release_ALL(
bool val )
1555FGControls::set_stick_size(
int station,
int size )
1559 stick_size[
i] = size;
1560 SG_CLAMP_RANGE<int>( stick_size[
i], 1, 20 );
1564 stick_size[station] = size;
1565 SG_CLAMP_RANGE<int>( stick_size[station], 1, 20 );
1571FGControls::set_release_stick(
int station,
bool val )
1575 release_stick[
i] = val;
1579 release_stick[station] = val;
1585FGControls::set_release_all(
int station,
bool val )
1589 release_all[
i] = val;
1593 release_all[station] = val;
1599FGControls::set_jettison_all(
int station,
bool val )
1603 jettison_all[
i] = val;
1607 jettison_all[station] = val;
1613FGControls::set_vertical_adjust(
double pos )
1615 vertical_adjust = pos;
1616 SG_CLAMP_RANGE<double>( vertical_adjust, -1.0, 1.0 );
1620FGControls::move_vertical_adjust(
double amt )
1622 vertical_adjust += amt;
1623 SG_CLAMP_RANGE<double>( vertical_adjust, -1.0, 1.0 );
1627FGControls::set_fore_aft_adjust(
double pos )
1629 fore_aft_adjust = pos;
1630 SG_CLAMP_RANGE<double>( fore_aft_adjust, -1.0, 1.0 );
1634FGControls::move_fore_aft_adjust(
double amt )
1636 fore_aft_adjust += amt;
1637 SG_CLAMP_RANGE<double>( fore_aft_adjust, -1.0, 1.0 );
1641FGControls::set_ejection_seat(
int which_seat,
bool val )
1649 if ( eseat_status[which_seat] ==
SEAT_SAFED ||
1656 eject[which_seat] = val;
1662FGControls::set_eseat_status(
int which_seat,
int val )
1666 eseat_status[
i] = val;
1670 eseat_status[which_seat] = val;
1676FGControls::set_cmd_selector_valve(
int val )
1678 cmd_selector_valve = val;
1683FGControls::set_off_start_run(
int pos )
1685 off_start_run = pos;
1686 SG_CLAMP_RANGE<int>( off_start_run, 0, 3 );
1690FGControls::set_APU_fire_switch(
bool val )
1692 APU_fire_switch = val;
1696FGControls::set_autothrottle_arm(
bool val )
1698 autothrottle_arm = val;
1702FGControls::set_autothrottle_engage(
bool val )
1704 autothrottle_engage = val;
1708FGControls::set_heading_select(
double heading )
1710 heading_select = heading;
1711 SG_CLAMP_RANGE<double>( heading_select, 0.0, 360.0 );
1715FGControls::move_heading_select(
double amt )
1717 heading_select += amt;
1718 SG_CLAMP_RANGE<double>( heading_select, 0.0, 360.0 );
1722FGControls::set_altitude_select(
double altitude )
1725 SG_CLAMP_RANGE<double>( altitude_select, -1000.0, 100000.0 );
1729FGControls::move_altitude_select(
double amt )
1731 altitude_select += amt;
1732 SG_CLAMP_RANGE<double>( altitude_select, -1000.0, 100000.0 );
1736FGControls::set_bank_angle_select(
double angle )
1738 bank_angle_select = angle;
1739 SG_CLAMP_RANGE<double>( bank_angle_select, 10.0, 30.0 );
1743FGControls::move_bank_angle_select(
double amt )
1745 bank_angle_select += amt;
1746 SG_CLAMP_RANGE<double>( bank_angle_select, 10.0, 30.0 );
1750FGControls::set_vertical_speed_select(
double speed )
1752 vertical_speed_select = speed;
1753 SG_CLAMP_RANGE<double>( vertical_speed_select, -3000.0, 4000.0 );
1757FGControls::move_vertical_speed_select(
double amt )
1759 vertical_speed_select += amt;
1760 SG_CLAMP_RANGE<double>( vertical_speed_select, -3000.0, 4000.0 );
1764FGControls::set_speed_select(
double speed )
1766 speed_select = speed;
1767 SG_CLAMP_RANGE<double>( speed_select, 60.0, 400.0 );
1771FGControls::move_speed_select(
double amt )
1773 speed_select += amt;
1774 SG_CLAMP_RANGE<double>( speed_select, 60.0, 400.0 );
1778FGControls::set_mach_select(
double mach )
1781 SG_CLAMP_RANGE<double>( mach_select, 0.4, 4.0 );
1785FGControls::move_mach_select(
double amt )
1788 SG_CLAMP_RANGE<double>( mach_select, 0.4, 4.0 );
1792FGControls::set_vertical_mode(
int mode )
1794 vertical_mode = mode;
1795 SG_CLAMP_RANGE<int>( vertical_mode, 0, 4 );
1799FGControls::set_lateral_mode(
int mode )
1801 lateral_mode = mode;
1802 SG_CLAMP_RANGE<int>( lateral_mode, 0, 4 );
1806FGControls::set_autopilot_engage(
int ap,
bool val )
1810 autopilot_engage[
i] = val;
1814 autopilot_engage[ap] = val;
1819void FGControls::do_autocoordination()
1822 if ( auto_coordination->getBoolValue() ) {
1823 double factor = auto_coordination_factor->getDoubleValue();
1824 if( factor > 0.0 )
set_rudder( aileron * factor );
1828void FGControls::fireEngineValueChanged(
int index, simgear::PropertyList& props)
1831 std::for_each(props.begin(), props.end(), [](
const SGPropertyNode_ptr &
p) {
1832 p->fireValueChanged();
1834 }
else if ((index >= 0) && (index <
MAX_ENGINES)) {
1835 props.at(index)->fireValueChanged();
bool get_bus_tie(int engine) const
bool get_dump_valve() const
bool get_generator_breaker(int engine) const
bool get_release_ALL() const
bool get_reverser(int engine) const
double get_elevator_trim() const
bool get_turn_off_lights() const
int get_to_tank(int tank) const
void update(double dt) override
int get_feed_tank(int engine) const
double get_rudder() const
double get_panel_norm() const
bool get_release_stick(int station) const
bool get_wing_heat() const
double get_speedbrake() const
double get_mixture(int engine) const
void set_reverser(int engine, bool val)
bool get_external_power() const
bool get_feather(int engine) const
int get_off_start_run() const
int get_magnetos(int engine) const
int get_eseat_status(int which_seat) const
double get_prop_advance(int engine) const
double get_outflow_valve() const
double get_brake_parking() const
bool get_autopilot_engage(int ap) const
double get_aileron_trim() const
int get_lateral_mode() const
int get_station_select() const
double get_heading_select() const
bool get_drag_chute() const
bool get_wing_fold() const
bool get_APU_generator() const
void set_magnetos(int engine, int pos)
void set_cutoff(int engine, bool val)
bool get_fire_switch(int engine) const
double get_vertical_adjust() const
bool get_autothrottle_engage() const
void set_rudder(double pos)
bool get_tailhook() const
bool get_alternate_extension(int wheel) const
double get_brake_right() const
double get_wing_sweep() const
double get_dome_norm() const
double get_elevator() const
double get_altitude_select() const
bool get_starter(int engine) const
bool get_fuel_selector(int tank) const
bool get_catapult_launch_cmd() const
bool get_ejection_seat(int which_seat) const
bool get_fire_bottle_discharge(int engine) const
double get_speed_select() const
double get_brake_left() const
bool get_master_arm() const
bool get_nav_lights() const
bool get_logo_lights() const
double get_steering() const
bool get_fuel_pump(int engine) const
void set_elevator(double pos)
bool get_taxi_light() const
bool get_throttle_idle() const
bool get_boost_pump(int index) const
int get_vertical_mode() const
bool get_nitrous_injection(int engine) const
bool get_gear_down() const
void set_water_injection(int engine, bool val)
double get_fore_aft_adjust() const
double get_spoilers() const
int get_ignition(int engine) const
double get_copilot_brake_left() const
bool get_landing_lights() const
bool get_pitot_heat() const
double get_vertical_speed_select() const
double get_bank_angle_select() const
double get_mach_select() const
int get_to_engine(int tank) const
void set_starter(int engine, bool flag)
bool get_release_all(int station) const
bool get_cutoff(int engine) const
bool get_nose_wheel_steering() const
bool get_antiskid() const
bool get_engine_bleed(int engine) const
void set_aileron(double pos)
int get_cmd_selector_valve() const
double get_cowl_flaps_norm(int engine) const
bool get_augmentation(int engine) const
double get_instruments_norm() const
double get_throttle(int engine) const
bool get_tailwheel_lock() const
void set_mixture(int engine, double pos)
bool get_pack_on(int pack) const
void set_augmentation(int engine, bool val)
bool get_APU_fire_switch() const
bool get_engine_pump(int system) const
double get_aileron() const
void set_throttle(int engine, double pos)
double get_copilot_brake_right() const
bool get_battery_switch() const
void set_aileron_trim(double pos)
bool get_launchbar() const
bool get_carb_heat(int engine) const
bool get_window_heat() const
double get_condition(int engine) const
bool get_water_injection(int engine) const
bool get_jettison_all(int station) const
bool get_electric_pump(int system) const
int get_stick_size(int station) const
void set_elevator_trim(double pos)
double get_rudder_trim() const
bool get_inlet_heat(int engine) const
bool get_APU_bleed() const
bool get_autothrottle_arm() const
static void _SetRoot(simgear::TiedPropertyList &tiedProperties, const char *root, int index=0)
SGSubsystemMgr::Registrant< FGControls > registrantFGControls
SGPropertyNode * fgGetNode(const char *path, bool create)
Get a property node.