Jump to content
Sign in to follow this  
MaDDogz

XML gauge - Test mode

Recommended Posts

I've made a cabin temp gauge useing xml. Im trying to make the gauge peak when i switch on the test mode for checking lamps ect.
i have this :


-<Image Name="tempneedleWindow.bmp" PointsTo="North">
<Axis Y="69" X="2"/>
</Image>
-<Rotate>
<Value Maximum="60" Minimum="-40">(L:CabinTemp,Celsius) </Value>
-<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="-40"/>
</Failures>
-<Nonlinearity>
<Item Y="79" X="31" Value="-40"/>
<Item Y="60" X="56" Value="0"/>
<Item Y="60" X="75" Value="14"/>
<Item Y="79" X="138" Value="60"/>
</Nonlinearity>
<Delay DegreesPerSecond="10"/>
</Rotate>
</Element>

The Lvar for the test switch is

<Value> (L:TestMasterSwitch) </Value>
Whitch returns values of 0,1 and 2. Im useing the value 0 to illuminate the lamps on my gauge, witch i've done.


Looking at other examples, i think i need to add the (L:TestMasterSwitch) Lvar somewhere in the above <Value>...''string''(?)


Something like ; if {(L:TestMasterSwitch) 0 then (L:CabinTemp,Celsius) 60 else (L:CabinTemp,Celsius)......
(if test switch is turned on,then set temp gauge to 60 (peak), otherwise return (L:CabinTemp,Celsius) value.

Just not sure how to write the above in XML language.

Can anyone please help?

Thanks


Luke Pype

Share this post


Link to post
Share on other sites

Just guessing, how about:

<Value ... >(L:TestMasterSwitch) 0 == if{ (L:CabinTemp,Celcius) } els{ 60 }</Value>

 

  • Upvote 1

Barry Friedman

Share this post


Link to post
Share on other sites

Hi Barry

Glad to report that did the trick! :biggrin:

I had to change to 0 to a 1 though as it was reversed.

the complete string:

<Value Minimum="-40" Maximum="60">(L:CabinTemp,Celsius) + (L:TestMasterSwitch) 1 == if{ (L:CabinTemp,Celcius) } els{ 60 }</Value>

Thank you, appreciate the help!

 

  • Like 1

Luke Pype

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

    AVSIM's 2020 Fundraising Goal

    Donate to our annual general fundraising goal. This donation keeps our doors open and providing you service 24 x 7 x 365. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. We reset this goal every new year for the following year's goal.


    53%
    $13,405.00 of $25,000.00 Donate Now
×
×
  • Create New...