Sign in to follow this  
Guest jprintz

ENUM based switches

Recommended Posts

Is there a simple way (as in one command, within the switch XML file itself) to make an ENUM based switch default to something other than 0 at aircraft load??? I need to use the same parent gauge (with the same switch logic) with 2 different panels, but I'd like the switch at enum 0 when starting up in panel one, enum 2 in the other. The more roundabout ways of doing this have not escaped me, but I really, really do NOT want to have to go back and change all the logic in the parent gauge's statments, have 2 versions, etc.... ;-) This is one of those things where I feel like there MUST be a simple, obvious answer, but it's just not coming to me right now. More likely probably is that I just haven't seen the syntax.... Anyone? Thanks!

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi,Something like this (not tested):(L:STARTUP,enum) 0 == if{ (L:Your Panel Var,bool) ! if{ 0 (>L:Your Var1,enum) 0 (>L:Your Var2,enum) etc. etc. } els{ 2 (>L:Your Var1,enum) 2 (>L:Your Var2,enum) etc. etc. } 1 (>L:STARTUP,enum) } (L:Your Other Switch Code,enum)??Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hi,If what you want is to use two panel folders, both including the gauge referenced, which in turn needs to return 0 somewhere in one of the panels and 2 in the other, you could use any of the aircraft's string values that are taken from aircraft.cfgFor example, you can use ATC FLIGHT NUMBER:in aircraft.cfgfor panel 1:atc_flight_number=134for panel 2:atc_flight_number=any otherin your gauge2 0 (A:ATC FLIGHT NUMBER,string) '134' scmp 0 == ?(>L:Your Var,enum)When it is '134' will return 2 (panel 1) and 0 otherwiseJust another approach... Tom

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