odwdinc / Python-SimConnect

Python interface for MSFS2020 SimConnect.dll

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Include non standard SimConnect commands

smc8050 opened this issue · comments

Hi all,
First I want to thank you for this awesome project, I have used it to program my homecockpit for MSFS 2020 :) I have a question and hope this is the right place for it.
As MSFS does not (currently) support most of the Garmin G1000 SimConnect commands, DocMoebiuz of MobiFlight developped a WebAssembly module (Installation guiedline here) which allows to use these commands. Unfortunately I was not able to use them with your library. As I am fairly new to python I have no idea how your code works. But would it be possible (and feasible) to add them to your library so one could use it with your python library? I found out, that if i add those commands to the EventList.py they would work.
So for example adding:
(b'MobiFlight.AS1000_PFD_SOFTKEYS_1', "Toggles Softkey 1 of the PFD", "Shared Cockpit")
to the Avionics class in the EventList.py allows toggling this button in the Sim (adding them to the G_1000_PFD class does not work somehow).
I have already formatted all the lines for pasting into your code in this file:MobiFlight_custom_commands_formated.txt
If I should reformat it just tell me how you want it, I could imagine this is not the "nice and correct" format for a code.
See the Forum original post of the developer of this Module here

How I understood it is that with this module the MSFS opens new commands to the user and many were already able to use them with a SimConnect client such as Spad.Next, Mobiflight or AirManager.
Thank you very much for your work and your reply :)

Hey thanks for interest. Tested and seems to have no problems handling the events.

After installing per Installation guiedline.

Quick test with Garmin AS1000 all seem to be good.

Test code as we don't have mapping for the new commands.

from SimConnect import *
import logging
from SimConnect.Enum import *

logging.basicConfig(level=logging.DEBUG)
LOGGER = logging.getLogger(__name__)
LOGGER.info("START")

# creat simconnection and pass used user classes
sm = SimConnect()

Sk3 = Event(b'MobiFlight.AS1000_MFD_SOFTKEYS_3', sm)
Sk3()

sm.exit()
quit()

Hope this helps!

adding them to the G_1000_PFD class does not work somehow).
yah the

class __G1000_PFD(EventHelper):

class __G1000_MFD(EventHelper):

Where leftovers not able to get working so they where disable.

My dilemma is that adding this to the event list may cause confusion. As there are additional steps need to enable and I don't know the license in including this work.

for now I can add a bit to the ReadMe.

This is great, many thanks. Just working exactly as the example shows above works perfectly for me!

Thank you very much for writing this sample code. :D
Now I can finally finish my homecockpit thanks to you. And many others probably too ;)