Closed Matthewli623 closed 4 years ago
Hi @Matthewli623. The version you downloaded from PyPI was an alpha release, which had a different interface from what is currently shown in the README on GitHub.
Good news, however! I just published version 1.0.0, which should enable you to run the example code. Please upgrade your installation by running the command:
pip install -U fsuipc
Regarding your question about the performance, I'm seeing individual read calls take about 4 or 5 ms to complete when I run the following code against Flight Simulator X:
import timeit
from fsuipc import FSUIPC
NUM_READS = 1000
with FSUIPC() as fsuipc:
prepared = fsuipc.prepare_data([
(0x560, "l"),
(0x568, "l"),
(0x570, "l")
], True)
duration = timeit.timeit(prepared.read, number=NUM_READS)
print(f"Duration: {duration} seconds ({duration / NUM_READS} seconds per read)")
Can you share the code you are running to get the 200 ms measurement? Also, I'm wondering if other simulator versions may give very different results.
Hi @Matthewli623. One week has passed without any activity, so I am assuming that upgrading fsuipc
has fixed your issue and that you no longer need assistance. Thanks.
C:\Users\user\Documents\GitHub\PythonPlayground>C:/Users/user/AppData/Local/Programs/Python/Python37-32/python.exe c:/Users/user/Documents/GitHub/PythonPlayground/testbat.py Traceback (most recent call last): File "c:/Users/user/Documents/GitHub/PythonPlayground/testbat.py", line 27, in
latitude, longitude, altitude = prepared.read()
AttributeError: 'PyCapsule' object has no attribute 'read'
Thank you!