Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError self.event = self.sm.map_to_sim_event(self.deff) #132

Open
laurentQuarkfr opened this issue Dec 14, 2023 · 0 comments
Open

Comments

@laurentQuarkfr
Copy link

laurentQuarkfr commented Dec 14, 2023

python 3.12

from SimConnect import *
from SimConnect.EventList import *
from SimConnect.RequestList import *


def trigger_event(event_name, value_to_use = None):
    EVENT_TO_TRIGGER = ae.find(event_name)
    if EVENT_TO_TRIGGER is not None:
        if value_to_use is None:
            EVENT_TO_TRIGGER()
        else:
            EVENT_TO_TRIGGER(int(value_to_use))
        print("success")
        return True
    else:
        print("Error: %s is not an Event" % (event_name))
        return False
        
sm = SimConnect()
ae = AircraftEvents(sm)
trigger_event('COM_STBY_RADIO_SET', dec_to_bcd(125.850))

trigger_event('COM_STBY_RADIO_SET', dec_to_bcd(125.850))
File "D:\SharedFolder\PythonProjects\MFS-WINWING\send.py", line 122, in trigger_event
EVENT_TO_TRIGGER(int(value_to_use))
File "C:\Users\VHDX-DEFAULT\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\SimConnect\EventList.py", line 8, in call
self.event = self.sm.map_to_sim_event(self.deff)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\VHDX-DEFAULT\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\SimConnect\sc.py", line 60, in getattr
raise AttributeError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant