flybywiresim / aircraft

The A32NX & A380X Project are community driven open source projects to create free Airbus aircraft in Microsoft Flight Simulator that are as close to reality as possible.
https://flybywiresim.com
GNU General Public License v3.0
4.97k stars 1.03k forks source link

Make EngineMaster switches accessible via SimConnect/WASM #5894

Open JensKn opened 2 years ago

JensKn commented 2 years ago

Aircraft Version

Development

Description

For home cockpit builders like me, it's a pity that the engine master switches cannot be remote controlled. Please give us an writable(!) LVAR or custom event to set/reset the engine master switches.

Same goes for any other knob on pedestal and overhead panel.

Thank you so much for your constant efforts in this great product!

References (optional)

No response

Additional info (optional)

No response

Discord Username (optional)

No response

joeherwig commented 2 years ago

I have it running using the standard controls.

So probably this LUA snippet helps you to get those running Engine Master + Mode Switches

function A32nx_ENGINE_MODE_set(engMode)
    ipc.control(67017, engMode)
    ipc.control(67018, engMode)
end

function A32nx_ENGINE_MODE_crank()
    A32nx_ENGINE_MODE_set(0)
end

function A32nx_ENGINE_MODE_norm()
    A32nx_ENGINE_MODE_set(1)
end

function A32nx_ENGINE_MODE_start()
    A32nx_ENGINE_MODE_set(2)
end

function A32nx_ENGINE_1_on()
    ipc.control(67198, 1)
    ipc.control(66300, 0)
end

function A32nx_ENGINE_1_off()
    ipc.control(67197, 1)
    ipc.control(66300, 0)
end

function A32nx_ENGINE_2_on()
    ipc.control(67198, 2)
    ipc.control(66301, 0)
end

function A32nx_ENGINE_2_off()
    ipc.control(67197, 2)
    ipc.control(66302, 0)
end