Gear Flaps - alesskerbinek/FlightSimPanel GitHub Wiki

The purpose of this unit is to simulate the aircraft landing gear and flaps selector:

Requirements:

No Type Item Function
1x input Toggle switch with lever lock Gear position selector
4x output LEDs Nose, left, right, warning
1x input Toggle switch with 3 positions and spring return Flaps selector
1x output 10 LED stripe indicator Flaps position
1x input Pull/push button Carburetor heat

Commands:

  • sim/flight_controls/flaps_up | Flaps up a notch.
  • sim/flight_controls/flaps_down | Flaps down a notch.
  • sim/flight_controls/landing_gear_down | Landing gear down.
  • sim/flight_controls/landing_gear_up | Landing gear up.
  • sim/flight_controls/landing_gear_emer_on | Landing gear emergency override down.
  • sim/flight_controls/landing_gear_emer_off | Landing gear emergency override off.
  • sim/engines/carb_heat_off | Carb heat off.
  • sim/engines/carb_heat_on | Carb heat on.

WE NEED SOMEHOW TO KNOW WHAT IS THE STATUS OF GEAR AND FLAPS FOR INDICATORS.

DataRefs:

  • sim/flightmodel2/gear/deploy_ratio float[10] n ratio This is how far down the landing gear is. 0=up, 1= down

  • sim/aircraft/parts/acf_gear_deploy float[10] y ??? landing gear deployment, 0.0->1.0

  • sim/cockpit2/annunciators/gear_unsafe=0/1

  • sim/cockpit2/annunciators/gear_warning=0/1

  • sim/flightmodel2/controls/flap_handle_deploy_ratio float y ratio This is the ACTUAL FLAP deployment for overall flap system, in ratio, where 0.0 is flaps fully retracted, and 1.0 is flaps fully extended. You should probably use the deployment for flap set 1 or flap set 2 to deflect the surfaces though. This takes into account that flaps deploy slowly, not instantaneously as the handle is dragged.

  • sim/flightmodel2/controls/flap1_deploy_ratio float y ratio This is the ACTUAL FLAP deployment for flap-set #1, in ratio, where 0.0 is flaps fully retracted, and 1.0 is flaps fully extended.

  • sim/flightmodel2/controls/flap2_deploy_ratio float y ratio This is the ACTUAL FLAP deployment for flap-set #2, in ratio, where 0.0 is flaps fully retracted, and 1.0 is flaps fully extended. s

For Carb Heat we can send the command every couple of seconds to avoid mismatch between switch position and status in x-plane. Otherwise there is DataRef:

  • sim/cockpit2/engine/actuators/carb_heat_ratio float[8] y ratio Carb-heat handle position, 0.0 (none) to 1.0 (full).