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.

Multi position switch

Featured Replies

I am looking for help setting up a StreamDeck Mobile device. My issue is with controls that have  more than 2 positions. I can use the 2 position control without a problem.

Take the following scenario:

A switch has 3 positions – down, middle and up. I want the StreamDeck Mobile to show the switch in the 3 different positions.

So the logic goes something like this:

If local variable POSITION does not exist

  Create the local variable POSITION and set it to 0

  Display SWITCH_POSTION_MIDDLE.png in StreamDeck Mobile row 2 column 5

Endif

If short press

  If POSITION < 1

    Add 1 to POSITION

    If POSITION = 0

      Display SWITCH_POSTION_MIDDLE.png in StreamDeck Mobile row 2 column 5

    Else

      Display SWITCH_POSTION_TOP.png in StreamDeck Mobile row 2 column 5

    Endif

  Endif

Endif

If long press

  If POSITION > -1

    Subtract 1 from POSITION

    If POSITION = 0

      Display SWITCH_POSTION_MIDDLE.png in StreamDeck Mobile row 2 column 5

    Else

      Display SWITCH_POSTION_BOTTOM.png in StreamDeck Mobile row 2 column 5

    Endif

  Endif

Endif

I bought Axis and Ohs so I could use the StreamDeck Mobile. I also use SPAD.NEXT and the above logic can quickly and easily be done – however SPAD does not support the StreamDeck Mobile.

Any suggestions would be greatly appreciated. If there are suggestions, please use Vbscript

  • Commercial Member

You can use VBScript in AAO 4.0. Please refer to the manual.
(But the StreamDeck does not work like your pseudo code suggests - I'll just assume that you know this)

But RPN is shorter and faster. This is a simple script too, using the seq or iseq operator. Example - the fuel selector in the TBM (the _IDX LVar is an invented one, it is only used in this script)
0·1·2·1·(B:FUEL_Selector_1)·(L:KA_TANKSEL_IDX)·4·iseq·(>B:FUEL_Selector_1_Set)·(>L:KA_TANKSEL_IDX)

In the AAO StreamDeck plugin these multi state items are often implemented using SliderGauge Actions. The images of the different states of the switch are arranged in a strip, and the state variable of the switch is used to slide the strip to the correct position.

Make sure to take a look at flightsim dot to, where talented simmers provide ready made StreamDeck profiles and scripts.

 

Edited by Lorby_SI

LORBY-SI

  • Author

Thanks for your reply.

0·1·2·1·(B:FUEL_Selector_1)·(L:KA_TANKSEL_IDX)·4·iseq·(>B:FUEL_Selector_1_Set)·(>L:KA_TANKSEL_IDX)

This brings me to my first question – what is event B:? And while on the topic I see other possible events are H:, IE; CMD:. – what are they or where are they documented. I have already worked out L:, K: and S:.

 The “iseq” operator advances a variable through a range of values – this is no use for the aircraft I am setting up – an FSLABS plane on P3Dv5. FSLABS make a lot of use of ROTOR_BRAKE so I cannot look for or change the value in a variable – I have to count the number of times the particular command has been issued.

To move the Nav&Logo light switch up I issue the event 72489 (>K:ROTOR_BRAKE) while to move it down the event 72488 (>K:ROTOR_BRAKE).

I guess I will investigate VBScript unless there is another suggestion.

Another question on the SliderGauge. After I add a number of images and Submit, I cannot see the assigned images. Is there any way of seeing them to check if they are valid?

  • Commercial Member
4 hours ago, AllanK said:

what is event B:

The code is just an example. BVars, HVars and InputEvents are used in MSFS, and their specification is in the MSFS SDK documentation. CMD and DREF are XPlane assets, they don't officially exist yet. 

4 hours ago, AllanK said:

this is no use for the aircraft I am setting up – an FSLABS plane on P3Dv5

TMBK FSLabs don't have an SDK like PMDG et al. There could/should be an LVar that controls the animation of that knob, maybe check that first. If there is none, then you are out of luck in every way. When you can't query the actual state of the switch, there is no way of advancing it anywhere. You can only blindly use the INC and DEC events, but you cannot display anything on the gauge action when there is no value to examine. 

 

4 hours ago, AllanK said:

Another question on the SliderGauge. After I add a number of images and Submit, I cannot see the assigned images. Is there any way of seeing them to check if they are valid?

Sorry, but I don't understand. How can you "add a number of images" to the Slider action? You can add exactly one image, that's it. The Elgato software does not have the option to show you these assets, except in actual operation on the action button itself. You can look inside the action properties with the Lorby StreamDeck Editor app.

Edited by Lorby_SI

LORBY-SI

  • Author

As well as P3Dv5 & v6 I also use X-plane 11 & 12. So, your comment "MD and DREF are XPlane assets, they don't officially exist yet" implies they may at some time in the future. I won't hold my breath though.

Ah well - thanks for your responses. My search goes on...

  • Commercial Member
7 hours ago, AllanK said:

My search goes on...

Use "Scripting->Read LVars from Sim" to collect all currently existing LVars. Maybe operate the switch(es) that you are interested in first, sometimes the LVars are only visibile after they have been used.

Then you can use "Scripting->Watch simulator variables" to check their values. Open the "Select variable" dialog and use the filter box to search for likely candidates (=that have a name that suggests they might be used for the animation of the switch). Hold down left shift and doubleclick on the variable to add it to the observer window (left shift keeps the selection tree open, otherwise it will close after the double click). Then operate the switch in the cockpit and observe the LVar to see if it changes. If it does you can use it on the slider gauge to slide the image strip up/down (or left/right, whatever you chose to do)

Edited by Lorby_SI

LORBY-SI

  • Commercial Member
17 hours ago, AllanK said:

So, your comment "MD and DREF are XPlane assets, they don't officially exist yet" implies they may at some time in the future.

There is an XPlane prototype of AAO that you can get by sending your proof of purchase to the support address (last page of the AAO manual)

LORBY-SI

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.