Jump to content
Sign in to follow this  
phjvh

xml synthax question

Recommended Posts

Hi,Can someone explain the following:(L:parameter one,enum) ~ & s1 if{ l1 (>L:parameter two,enum) } and(l1 1 & ) if{ ....Thanks,Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest pscarratt

Jan,The l1 and s1 commands load and save the figure on top of the stack to register 1 - the ~ is a bitwise not so the ~ after the (L:parameter one, enum) will reverse the ones and zeros in the binary representation of the value. e.g.(L:parameter one, enum) = 55 = 110111 ~ 001000Then you have a bitwise and which will occur on the (L:parameter one, enum) and its ~ version 110111& 001000-------- 000000so in this case l1 would not be loaded into parameter 2.Hope that makes sense and anyone please correct me if i'm wrong!Cheers,

Share this post


Link to post
Share on other sites

Paul,Is there a way to write this in "normal" xml?I mean not using the bitwise commands.s1 and l1 are familiar to me, but ~ isn't.Is it a command like (L:var,bool) ! if{ ..etc.; and why using this one?Can you write it like:(L:parameter one,enum) 0 == if{ 0 (>L:parameter two,enum) } Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest pscarratt

jan,! is a logical not so the result would be different - In a logical not if the parameter is non-zero the result will be zero. If it is zero the result will be 1.Consider;Decimal 5 ! = 0Decimal 5 ~ = 2 because with the ~ it is literally swapping the ones in the binary of the number. In binary, the above ~ example would be;Decimal 5 = Binary 101 ~ = 010 = Decimal 2Does that make sense?Cheers,

Share this post


Link to post
Share on other sites

It does Paul, but still i would like a more easier way to note the xml.I can use the code, but don't understand it totally.It is from the master caution gauge of the default B747.The switch is standalone, the code is in the MFD.May be you could have a look.It uses (..,mask) instead of enum, but that doesn't make a difference.Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest pscarratt

Jan,I had a quick look - there is bitwise operators all through that string line - my guess is they are using a binary number to store all the warnings - each bit of the binary number refering to a different warning .I would probably look at another way of doing it in plain xml rather than translating theirs.Sorry I can't be more help!

Share this post


Link to post
Share on other sites

Paul,Thanks fot the effort,Jan"Beatus Ille Procul Negotiis"

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.
×
×
  • Create New...