July 25, 20223 yr I've done a bunch of reading of the documentation, and searched the forum, but haven't yet been able to find an answer. Is it possible to create a local variable (local to AAO) and then display that value on a Stream Deck? The particular thing I'm trying to do right now is to convert the GPS ETE simvar (which is in seconds) to a formatted hour/minute/second string. I created this script, but I haven't yet been able to see the ETE local variable in the watcher, so I don't know if I'm doing this right, or if it's even possible. %((A:GPS·ETE,seconds)·3600·/·int·)%!02d!·:·%((A:GPS·ETE,seconds)·3600·%·60·/·int·flr·60·%)%!02d!·:·%((A:GPS·ETE,seconds)·60·%·int·flr·60·%)%!02d!% (>L:ETE, String)
July 25, 20223 yr Commercial Member 3 hours ago, dlmorgan999 said: Is it possible to create a local variable (local to AAO) and then display that value on a Stream Deck? Sure, but only when you are using the AAO SD plugin. Other SD solutions can't see those variables. That being said, in this special case there are a couple of problems. First off, the script is syntactically incorrect. It won't concatenate the strings just like that - you need to use "scat". Otherwise you will only have the last string assigned to the LVar. Second, string literals must be enclosed in single quotes Finally, the extra modulo operators pose a problem for AAO. I'm afraid that the script won't work with those (I think that it would work with one extra modulo %, but not with two) - you would have to do the calculations separately. In any case, I will add a "mod" operator in the next version so the parser doesn't get confused anymore. %(A:GPS·ETE,·Seconds)·3600·/·int%!02d!·':'·scat·%(A:GPS·ETE,·Seconds)·3600·mod·60·/·int·flr·60·mod%!02d!·scat·':'·scat·%(A:GPS·ETE,·Seconds)·60·mod·int·flr·60·mod%!02d!·scat·(>L:ETE,·String) (this only works in 2.32 and beyond - if you want to test it, send an email with your proof of purchase to the support address on the last page of the AAO manual) I know that I have done the exact same thing before, but a little different, without the modulo, using registers and a different Unit: %(E:LOCAL·TIME,·Hours)·s0·int%!02d!·':'·scat·%l0·l0·int·-·60·*·s1·int%!02d!·scat·':'·scat·%l1·l1·int·-·60·*·int%!02d!·scat·(>L:LTIME,·String) Should work for the ETE too, I hope. Be mindful that "l0" is "ell zero", not "ten" - loading the register value at this point. %(A:GPS·ETE,·Hours)·s0·int%!02d!·':'·scat·%l0·l0·int·-·60·*·s1·int%!02d!·scat·':'·scat·%l1·l1·int·-·60·*·int%!02d!·scat·(>L:ETE,·String) Edited July 25, 20223 yr by Lorby_SI LORBY-SI
July 25, 20223 yr Author Thanks for the detailed response! I am using the AAO SD plugin (it's one of the main reasons I bought AAO - it's a very useful plugin 🙂). I'll modify my script per your suggestions.
July 25, 20223 yr Commercial Member The actual variable will probably be different for different aircraft too. Guenseli made a bunch of SD profiles available on the filghtsim to site, and many of those have an ETE gauge I think. LORBY-SI
July 25, 20223 yr Author I've downloaded a few of those but haven't installed them yet. I'll have a look.
July 25, 20223 yr Author I'll also mention that while I'm not a developer by profession, I do work in IT and can program reasonably well. But I'm brand new to RPN scripting and am very much in learning mode right now. So any examples I get are very helpful.
July 25, 20223 yr Author 4 hours ago, Lorby_SI said: Should work for the ETE too, I hope. Be mindful that "l0" is "ell zero", not "ten" - loading the register value at this point. %(A:GPS·ETE,·Hours)·s0·int%!02d!·':'·scat·%l0·l0·int·-·60·*·s1·int%!02d!·scat·':'·scat·%l1·l1·int·-·60·*·int%!02d!·scat·(>L:ETE,·String) This works great. Now to dissect it and see if I can completely understand everything it's doing. 😉
Archived
This topic is now archived and is closed to further replies.