Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Display an AAO local variable on a Stream Deck?

Featured Replies

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)

 

  • 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 by Lorby_SI

LORBY-SI

  • 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.

  • Author

I've downloaded a few of those but haven't installed them yet.  I'll have a look.

  • 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. :smile:

  • 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.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.