Sign in to follow this  
Guest

XML L variables question... please help

Recommended Posts

Hi everyone, I have had great success in using L: variables for controlling numerous things including gauge lighting and OMI dimming. The problem is this though: I can only make them using the bool method, i.e. there is only two positions like off and on, 0 and 1 respectively. What I have in my current project are some 3 position rocker switched. One of them for example is off, on and test. I am still very new to XML programming, and I was hoping that there would be someway that I could use the L: variable to have 3 settings, 0-2. For example, for a governer switch, there are other guages that will need to know whether it is on or off (0 or 1) and then a set of test lights that will light up when the value is 2. I know this is a little bit complicated, but this would really make things much more intuitve instead of having to use 2 different variables, and other less efficiant work arounds.Thanks in advance,Ian Grant

Share this post


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

Use L: vars with unit "number" or "enum" and you are free to use any number of stages you want.E.g.Set values

<Click>0 (>L:Myvar,enum)</Click><Click>1 (>L:Myvar,enum)</Click><Click>2 (>L:Myvar,enum)</Click>

Read 0 and 1 (smaller 2)

<Select>  <Value>(L:Myvar,enum) 2 < </Value>	  <Case Value="1">		<Image Name="stage_0_1.bmp" ImageSizes="11,11,15,15"/>	  </Case><Select>

Read 2 (greater 1)

<Select>  <Value>(L:Myvar,enum) 1 > </Value>	  <Case Value="1">		<Image Name="stage_2.bmp" ImageSizes="11,11,15,15"/>	  </Case><Select>

Arne Bartels

Share this post


Link to post
Share on other sites

Thanks Arne, I was hoping it was possible. Now, defined as above, lets assume that the switch in its down position is OFF. The middle position would be ON and up is TEST. Clicking this switch the first time would move it from OFF to ON. The second click i then gather would be from ON to TEST. Now, would a third click move it back to OFF since the process would repeat? Would there be away to control this L: enum value by increasing and decreasing the incriments, kind of like the magneto switches, in which you can move freely back and forth? I ask because I would like it to be possible to move between ON and TEST freely with out having to switch it OFF as well. If that is not possible, would it be possible to sequence the clicks as such?:0 (>L:Myvar,enum)1 (>L:Myvar,enum)2 (>L:Myvar,enum)1 (>L:Myvar,enum)This way presumably, the switch would cycle back through the ON position to returning to OFF. This way when engaging the system, it can be turned on, then tested, and then returned to on. If my logic serves me correctly, that would be a suitable alternative, although, if the system were not tested after being turned on, one would have to move through the test position before returning it to the OFF position. Any Ideas?Thanks for your help, it is very much appreciated!!!Very best regards,Ian Grant

Share this post


Link to post
Share on other sites

Ok, I tried the suggested method on one of my switches, and I know Im doing something wrong. When I click on it, it goes from the middle position to the down position, and will not move from there. It just sticks. The code I used is as follows:(L:Ign Ovrd, enum) 2 > , , %Ignition Overide%0 (>L:Ign Ovrd,enum)1 (>L:Ign Ovrd,enum)2 (>L:Ign Ovrd,enum)Any idea what I did wrong?

Share this post


Link to post
Share on other sites

Hi,I think you have to define different clickspots.When using 0 (>L:Myvar,enum))1 (>L:Myvar,enum)) etc.....So where Off, On and Test are situated something like:Off0 (>L:Myvar,enum))On1 (>L:Myvar,enum))etc.....It works OK for me.Jan

Share this post


Link to post
Share on other sites

Gave it a try, and it works, thank you guys so much! You just solved about half of my 'now how am I going to make that work?' problems.Best regards and many thanks,Ian Grant

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