December 6, 200421 yr 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" Jan "Beatus ille qui procul negotiis..."
December 6, 200421 yr 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,
December 6, 200421 yr Author 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" Jan "Beatus ille qui procul negotiis..."
December 6, 200421 yr 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,
December 6, 200421 yr Author 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" Jan "Beatus ille qui procul negotiis..."
December 6, 200421 yr 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!
December 6, 200421 yr Author Paul,Thanks fot the effort,Jan"Beatus Ille Procul Negotiis" Jan "Beatus ille qui procul negotiis..."
Create an account or sign in to comment