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.98k stars 1.04k forks source link

[REQUEST] SimConnect support #597

Closed JensKn closed 4 years ago

JensKn commented 4 years ago

Is your feature request related to a problem? Please describe.

Currently, there are controls which cannot be controlled via SimConnect as e.g. pushing/pulling the FCU knobs for Speed, Heading, Altitude and V/S. The corresponding variables can be read but not be set, they are read only. Also, there is not event to control the actions mentioned before. Without this, there is no chance to integrate a (diy) FCU hardware.

Describe the feature you'd like to see implemented

Please make ALL controls and values/displays of FCU and EFIS controllable by SimConnect API. It should be possible to control all those things via SimConnect you can control manually in the cockpit.

References

Additional context

In FSX, I built a FCU hardware and programmed a gauge which is invisible but communicates with my FCU hardware so that I can control the Aerosoft Airbus A320/A321 FCU with my FCU hardware. Now I want to program the same thing for the A32NX but fail due to SimConnect support. Thank you so much!

Benjozork commented 4 years ago

Thanks for your feature request.

Could you specify what the API would look like ? Since we can really only use simvars.

lousybyte commented 4 years ago

If something is made read-only by the API then that's beyond what a mod can change, you'll have to wait for an API update that will hopefully improve support. You can technically work around that, but that's beyond the scope of a normal mod. Your request is more suited towards Asobo/Microsoft.

WzdOz commented 4 years ago

The variables are read only, but there are sim connect events that control the FCU knob states.

HEADING_SLOT_INDEX_SET SPEED_SLOT_INDEX_SET ALTITUDE_SLOT_INDEX_SET VS_SLOT_INDEX_SET

Sending those with value 2 gives authority to FCU. And sending them with value 1 enables selected mode. Heading, speed, and altitude knobs work perfectly with those.

Vertical Speed knob is more tricky, as it is dual function, and there is no sim event defined for secondary functions. As a workaround; you can ignore VS knob state and directly manipulating vertical speed variable. It won't be possible to set it up during ALT hold, and you won't be seeing it in FCU display. But as soon as you change the selected alt different from current alt, you'll be able to set VS speed, and FCU will try to match it both in managed or selected alt modes.

Hope this helps.

lrargerich commented 4 years ago

Thank you for this!

JensKn commented 4 years ago

Wow, thanks a lot for all these information!

@lousybyte I did not know about the limitations of a mod. Thanks for pointing me in the right direction.

@WzdOz Thanks a lot! I was already searching for events but I did not succeeded in finding them. After I read your post, I tried to find the events in the SDK documentation but they are not listed there. I refer to the documentaion which is installed together with the SDK (MSFS_SDK/Documentation/03-Content_Configuration/Variable_Lists/Event_IDs.html). Therefore, I would be very interested in a hint where I can find all the information about variables and events.

@Benjozork My feature request can be understood as a software development pattern, a kind of style guide for the developers. IMHO, every control and display whis is added by the A32NX project should be designed to get controlled by sim connect.

Greetings from Germany!

WzdOz commented 4 years ago

I don't think Asobo released a proper documentation yet. I am using Spad.Next as sim connect interface. Those were in the list of events and variables, that were data mined by Spad.Next developer. I guess you can install the trial version of Spad.Next and check the full list of MSFS specific sim connect variables and events.

Keep in mind though, there will still be a lot of missing functions all over the A320 virtual cockpit. Most important being EFIS. There are no sim connect variables and events defined for it yet.

I was hoping those missing variables are somewhat modable. If we are down to Asobo's enhancements, I think it is highly unlikely those will ever get done considering the development state of the simulator. In that case we might as well forget about interfacing default aircraft and wait for study level addons.

JensKn commented 4 years ago

@WzdOz Thanks for your explanation which explains why I wasn't able to find those events.

Benjozork commented 4 years ago

@JensKn, the problem with this is that you can't really transmit display information over simconnect outside of simple simvars. I was thinking of exposing display viewmodels using JSON, but that would have to be discussed with the team.