Sign in to follow this  
Guest bartels

XML question?

Recommended Posts

Can anyone tell me why this is not working. (A:ELEVATOR TRIM INDICATOR,degrees) 5 == I know the syntax for the bitmaps and position and stuff are right. For some reason the "==" operator does not seem to be working. HEEEEELLLLLLLLPPPPP!!!!!!!!!!!!!Mitch

Share this post


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

I assume that you get exactly five degrees very rarely. Even 4.99999999 is truncated to 4. Use "near" for proper rouding before checking equality, or use a range around 5 degrees.(A:ELEVATOR TRIM INDICATOR,degrees) near 5 ==or(A:ELEVATOR TRIM INDICATOR,degrees) d 5.2 < r 4.8 > &&Arne Bartels

Share this post


Link to post
Share on other sites

That was dead on, thanks Arne. Where did you learn XML? I have your Tutorial, but as you know that is very limited. Is there another source that I can get a hold off?Thanks again.Mitch

Share this post


Link to post
Share on other sites

I didn't learn XML at all, I just had a look at the default XML-gauges in FS002 an worked on. A lot of trial and error.I admittedly did know the general structure (visual part, mouse areas, variables, etc.) of gauges from programming C gauges for about six years or so.Actually the general XML structure is really straightforward and you can't "learn" it in my opinion. Have one look one it and you'll know the system. It helped me to know HTML structure beforehand. XML for gauges is another thing, all I wanted to achieve with my document (which isn't a tutorial!), was to help a bit over the first obstacles the avarage reader could experience. I didn't focus too much on the general structure of XML. I wrote down the things not easily understandable, e.g. the strange RPN usage (and what I was able to understand of course). So not a step by step turorial.To the special case of floats and equality: this is a problem you'll encounter on an almost daily basis in at any floating point operation in C/C++ and also XML for gauges (and possibly more languages). I could go in details, but just remeber NEVER check floats on equality, round first or use tolerance margins.Arne Bartels

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