-
Notifications
You must be signed in to change notification settings - Fork 277
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
How do we send array datarefs in Python 3? For example, "sim/flightmodel/engine/ENGN_thro" #277
Comments
The wiki has documentation and examples. It would be helpful to know what client language you are using. |
I.. Already edited the title and added the language within seconds of
posting.. But OK, I'm using Python 3, sorry for the confusion.
…On Sun, Mar 27, 2022, 10:30 PM Jason Watkins ***@***.***> wrote:
The wiki <https://github.com/nasa/XPlaneConnect/wiki/sendDREFs> has
documentation and examples. It would be helpful to know what client
language you are using.
—
Reply to this email directly, view it on GitHub
<#277 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC5CXWQVXRHVT3NQMAO2SSLVCB5IVANCNFSM5RYTMHXQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@jason-watkins in the examples it only shows how to send multiple DREFs with an array, it doesn't show us how to send a DREF with an array input, hence why I'm asking. |
Hi all, |
For any value of an array pass the DREF with an additional "[i]" for index i at the end. For example This is what is used for plugins so I assume it would be the same for XPlane Connect. |
Forgot to mention that to modify some DREFs you first have to write the override DREF. For |
Ah, so you have to actually iterate each value? |
Thanks all, this is working now using your help and the fix in #242. |
Yes, you will have to send each value separately. |
@jason-watkins you might want to close this issue. |
I have this exact problem, but this solution is not working. Using python3 and BETA eVTOL. After doing: client.sendDREF('sim/flightmodel/engine/ENGN_thro_use',1.) client.sendDREF('sim/flightmodel/engine/ENGN_thro_use[0]',1.) I've also tried the 'sim/flightmodel/engine/ENGN_thro' DREF, but this has the exact same behavior (when override_throttles is False). |
I was actually able to make this work by adding the change in #242. (line 313 in python3's xpc.py should be *value instead of value for the final argument of struct.pack). It says this change is merged, but it doesn't seem to be in the master branch. I still couldn't get the 'sim/flightmodel/engine/ENGN_thro_use[0]' to work, but I can at least now use sendDREF to send arrays. One disadvantage of this approach is I cannot write to engine 3 without also writing to engines 0, 1, and 2, etc., but I can just read off of the DREF for the current engine throttle and pass those values in. |
@IanOMHiggins I am having same issue here. For my project, I only need to send different signals for each engine so I can compromise with that disadvantage. I also write |
I have tried :
None of this work. Is this not implemented yet?
The text was updated successfully, but these errors were encountered: