Jump to content
Sign in to follow this  
EuroTexan

Slot Index Processing StreamDeck XL vs Plus?

Recommended Posts

Interesting phenomenon in the StreamDeck XL (MultiGauge) vs the StreamDeck + (Rotary Canvas). Code below is used in Horizon 789 Mod on the ground for indication of SPD. On the XL the code seems to always default to slot index :0 value of 166 kts, but the exact same code on the PLUS unit wants to default to slot 2 or 3 (200 kts). The work around was always to use :0 index, but any thoughts as to why the behaviors would be different? On the plus if you switch to another profile and then back then it trues up to SLOT :0, which is unusual. 

Code S:

(L:XMLVAR_SpeedIsManuallySet,Bool) if{(A:AUTOPILOT MANAGED SPEED IN MACH, bool) if{%(A:AUTOPILOT MACH HOLD VAR, number)%!0.3f!} els{%(A:AUTOPILOT AIRSPEED HOLD VAR, knots)%!3.0f!}} els{' '}

 

Screenshot_2024-05-07_193352.png?ex=663cc2c7&is=663b7147&hm=68fea59e8cdb156baae71ed130d22b686ddad4dc5242dad2229f61fcea07244d&=

Share this post


Link to post
Share on other sites
Posted (edited)

There is no default, you have to supply the correct slot index when using these variables. Same goes for the events, they are indexed too.

In MSFS each slot has a different purpose, see SDK doc.

Edited by Lorby_SI
  • Like 1

LORBY-SI

Share this post


Link to post
Share on other sites

Thanks! Was just suprised that A:AUTOPILOT AIRSPEED HOLD VAR, knots would return different values to the screens even though AAO confirmed the current dial was set to 166 kts. We are now using the INDEX for airspeed and mach.

Share this post


Link to post
Share on other sites

IIRC these indexes are for selected vs managed vs ?? AP modes. But that is probably aircraft dependant too. Index 0 is somehow special, but I don't remember what the deal was. I think that 0 is the equivalent to not supplying any index.


LORBY-SI

Share this post


Link to post
Share on other sites
Posted (edited)

Also, be extra careful to write the variables and events in the same syntax every time. A different space character, upper vs lower case and AAO will treat them as different variables ( and needlessly query the variable value multiple times in paralel)

Edited by Lorby_SI
  • Like 1

LORBY-SI

Share this post


Link to post
Share on other sites

Still trying to get to the bottom of why the processing results are different in the XL vs the PLUS, and what makes it more difficult is the test cases are not consistent. It always works on the XL without exception, but the PLUS it sometimes works, sometimes does not.

On the StreamDeck XL the "Speed Window" will close in the Text Gauge without fail, it always works. When I apply this exact same code to the Rotary Canvas text definition the results are hit and miss. Its almost like the Strip display gets "stuck". The fix is always to navigate to any other profile on the PLUS, and upon return to the offending PLUS profile it magically starts working again.

(L:XMLVAR_SpeedIsManuallySet,Bool) if{(A:AUTOPILOT MANAGED SPEED IN MACH, bool) if{'MACH'} els{'IAS'}} els{' '}

(L:XMLVAR_SpeedIsManuallySet,Bool) if{(A:AUTOPILOT MANAGED SPEED IN MACH, bool) if{%(A:AUTOPILOT MACH HOLD VAR, number)%!0.3f!} els{' '}} els{' '}

If I am able to find a solution I will return here and report it!

image.png?ex=663e1ec0&is=663ccd40&hm=258aa27f3858581ac84db4451aaf1e3b1cc5568c1d48b1f81b58815382857feb&=

Share this post


Link to post
Share on other sites

I probably need to abandon the use of the qualifying statements in the Text Variable and move those qualifying statements up to the Visibility Variable and make that consistent across the entire Rotary Canvas.

Share this post


Link to post
Share on other sites
Posted (edited)

IMHO what you need to do is to supply the correct slot index. When using the AVar without an index, you are at the mercy of whatever the sim or the aircraft decides to return. I'm not aware of any spec that actually describes the use of the AP slot variables without the index in sufficient detail (at least not in the MSFS SDK documentation). It doesn't even say that clearly which variables are indexed and which aren't, I'm always looking for the "...SLOT INDEX" variable.

Aircraft Autopilot/Assistant Variables (flightsimulator.com)

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites
Posted (edited)
On 5/8/2024 at 5:13 PM, EuroTexan said:

Interesting phenomenon in the StreamDeck XL (MultiGauge) vs the StreamDeck + (Rotary Canvas). Code below is used in Horizon 789 Mod on the ground for indication of SPD. On the XL the code seems to always default to slot index :0 value of 166 kts, but the exact same code on the PLUS unit wants to default to slot 2 or 3 (200 kts). The work around was always to use :0 index, but any thoughts as to why the behaviors would be different? On the plus if you switch to another profile and then back then it trues up to SLOT :0, which is unusual. 

Both StreamDecks use the exact same code. If the variable is written in exactly the same way (upper/lower case, space characters) then it must return the same value on both units. There is no separate logic for each type of StreamDeck, they all use the same class in the same Javascript code. And both access the same WebAPI in AAO where the variable is actually read from the sim (also only once in one place)

But as written above, there is no telling what will happen when you don't supply an index. 

Edited by Lorby_SI
  • Like 1

LORBY-SI

Share this post


Link to post
Share on other sites
Posted (edited)
20 minutes ago, EuroTexan said:

I probably need to abandon the use of the qualifying statements in the Text Variable and move those qualifying statements up to the Visibility Variable and make that consistent across the entire Rotary Canvas.

That sounds like a good idea. 

To be honest, I don't make a lot of these myself. I only supply the hammer, I don't build the house. I have to rely on the feedback from the profile authors. But in this case, there hasn't been any mention of this effect. Very strange.

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

Apologies, was a bad cut and paste on my end. I am using slot index :0 for everything now. The hammer you built is the best in the business BTW!

I think tearing this down and always honoring the use of a visibility variable (on or off) will get the job done. WIll report back after I flush it out. Thanks.

Share this post


Link to post
Share on other sites
Posted (edited)
11 minutes ago, EuroTexan said:

Apologies, was a bad cut and paste on my end. I am using slot index :0 for everything now. The hammer you built is the best in the business BTW!

I think tearing this down and always honoring the use of a visibility variable (on or off) will get the job done. WIll report back after I flush it out. Thanks.

Btw. your scripts could use a few more space characters. If the text you posted above are the actual script code, then they are syntactically incorrect.

For examle:

  • "if{" must be enclosed in space characters on both sides, same as "els{" and the closing braces must also have a space left and right " } "
  • The Unit is always separated by "Comma-Space" from the variable name
  • Variables and events should be written the same way everywhere, using the same upper/lower case characters for both the names and the units. Otherwise AAO treats them as separate variables.
     
(L:XMLVAR_SpeedIsManuallySet, Bool) if{ (A:AUTOPILOT MANAGED SPEED IN MACH, Bool) if{ 'MACH' } els{ 'IAS' } } els{ ' ' }

Be mindful of performance, keep an eye on the CPU load caused by the StreamDeck software. The more complex these Actions become, the more power they need. If possible, use simpler assets (we don't have a lot of choice on the Plus, but with the other actions, a Toggle is more lightweight than a MultiGauge)

(Yes, I know, the RPN parser in AAO is quite dumb. It was made like that on purpose, to save on performance. Of course it would be possible to re-format and re-parse every piece of code that the user writes - but that would have to happen every time the code is sent to the processing module! I'd rather force the user to get it exactly right than to slow down the app.)

Edited by Lorby_SI
  • Like 1

LORBY-SI

Share this post


Link to post
Share on other sites

This was a huge help. With all of the proper syntax in place the profile is working beautifully. Thank you for the guidance.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...