Sign in to follow this  
Herbie63

Newbie in XML Gauges

Recommended Posts

Hi to all: I am a newbie in programming XML of gauges and I have made some easy works where alone it was necessary to modify small things. Now my project is a little but complex and its somebody of you would need he can help me. I am modifing the RMI of the Beech Baron for one that is single RMI of VOR (VOR1 and 2). I have added him 2 flags of OFF every time that not this present a sign been worth of VOR. All this works well. Now the question comes I need that the needles move to the position of 3 o

Share this post


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

Hi Jose,If I understood you right, you need to add an if / else condition tothe value - element that defines the needle's rotation.It could be something like this:Value>(A:NAV1 signal,bool)if{ (A:Plane heading degrees gyro,radians) /-/ } els{ 1.57 }1.57 is 0.5 pi, so 90 degrees right. But maybe for your gauge an other value like 0 fits better.You might also try to substitute the NAV1 signal bool by a minimumsignal strenght of the NAV1 like this:Value>(A:NAV1 signal, number) abs 10 > if { (A:Plane heading degrees gyro,radians) /-/ } els{ 1.57 }I hope this helps.Herbert

Share this post


Link to post
Share on other sites

I will check your help. I need two condition IF. One , when the signal is OFF. The gauge display the "OFF" flag and the needle go to 90 deg. The second condition is when a ILS frec is selected. The flag is out of view, but the needle go 90 deg too.I try with your help. Thank You Very much.Jose Olliver

Share this post


Link to post
Share on other sites

So try this one:Value>(A:HSI GSI needle valid, bool)(A:NAV1 signal, number) abs 10 < || if { 1.57 } els{ (A:Plane heading degrees gyro,radians) /-/ }This causes a rotation value of 1.57 either when a glidescope signal is available or the NAV1 signal strenght < 10.Hope this helps,Herbert

Share this post


Link to post
Share on other sites

Hello Herbert: after several days working in my cockpit, I could prove your help but I have not been able to make it work. I am very inexpert in programming XML and I am surely making bad something. Sorry for the caused nuisances. Here, I copy part of the original code of the RMI in the part "Element" needle 2 (A:NAV2 Radial,radians) (A:Plane heading degrees gyro,radians) - pi 2 / + And this it is the code that I have modified according to your help. Can You check that I am writing bad (A:NAV2 Radial,radians) (A:Plane heading degrees gyro,radians) - pi 2 / + If (A:NAV2 SIGNAL, bool) 1 {(A:Plane heading degrees gyro,radians) /-/ } els{ 1.57 } Lastly to the second code I should add it this condition too (A:NAV1 has localizer, bool)Thank You very muchJose

Share this post


Link to post
Share on other sites

Hi Jose,XML is not really difficult, you just need to get used to it...The general syntax for if - then conditions in elements is:(condition) if { (what to do when condition is true) } els{ (what to do else) }If there are two conditions, that both need to be true:(condition1) (condition2) && if { (what to do when conditions are true) } els{ (what to do else) }The && means that both conditions have to be true. Use || ifone OR the other condition needs to be true.Pay attention to add spaces or no spaces befor and after the { } brackets like in the description above.So your code should be:(A:NAV2 signal,bool) 1 > if{ (A:NAV2 Radial,radians) (A:Plane heading degrees gyro,radians) - pi 2 / + } els{ 1.57 }And with the addition of the localizer condition:(A:NAV2 signal,bool) 1 > (A:NAV1 has localizer, bool) && if{ (A:NAV2 Radial,radians) (A:Plane heading degrees gyro,radians) - pi 2 / + } els{ 1.57 }I'd higly recommend to use a XML editor instead of notepad or other text editors. I prefer a freeware from Peter Reynolds (www.iol.ie/~pxe) I use his version 1.1.1 which has some minor problems but I like it better than his newer versions or even MS's XML editor.I hope this helps!Herbert

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