Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

xor

Featured Replies

Hi,I wonder if there is a XOR Operator ^ in xml gauges ?BrgdsEugen

>Hi,>>I wonder if there is a XOR Operator ^ in xml gauges ?Not that I'm aware of. The only two "or" operators are:|| (logical OR)| (bitwise OR)BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://mtco.com/~rsam/fartslogo.jpg

Please have a look in the MS Panel SDK. That's what it's for.Logical operators are: AND && OR || NOT !Bitwise Operators are: AND & OR | XOR ^ NOT ~ shift right >> shift left <

>Please have a look in the MS Panel SDK. That's what it's>for.You are absolutely right, Arne! The XOR '^' is listed on page 81 of the SDK. I'm so used to going to your treatise on the subject that I frequently forget that there is more information (even though very obtuse) in the SDK.You seem to have omitted the XOR from that source, so I (incorrectly) assumed that it didn't exist... :)BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://mtco.com/~rsam/fartslogo.jpg

Thanks !You are rightBrgdsEugen

Hey Arne.What is the difference between Bitwise and Logical? Apologies for my ignorance :D

It isn't in xmlgau01.zip because I wrote it before the SDK came out. None of the default gauges used it so I didn't recognize it. If I'd had much use of it I might have found it also since it is so "C"-like, but I didn't.Arne Bartels

Oh, must I?Logical means that you work with values 1 (true) and 0 (false), I think you know the meaning of AND and OR there. As a speciality of C and XML-Gauges any number not 0 is treated as true, and zeros as false.Bitwise operations make all operations for every bit in a number. E.g. "4 1 |" means:"4" is in bit representation 0100, "1" is 0001, "|" is that for each bit in both numbers an OR is done. => 1000|0001=1001 => 5. I wrote only four bits out of lazyness, but you can have more of course. The maximum usable bits are dependent on the used type for C gauges (don't know the limit in XML). E.g. a UINT32 has 32 bits setable.You can "stuff" much more information in a bitwise treated variable then in a "normal" boolean, with the drawback that the result is also more complex to interpret. Arne Bartels

Hi again,The last q&a sound as a good one for the the FAQ.Btw I saw that the FAQ had more than 1000 views and a 5 star rating.Great job Arne and all others contributing !Eugen

A "cute" way of getting bitwise booleans to work is when you are stuck with switch graphics that influence oneanother. I.e. three switches packed so closely together that when switching #1, it will cast a shadow onto switch #2 and #3. So instead of setting the state of each switch independatly, you read a 3-bit value where each bit indicates the state of one switch. Three bits gives 1+2+4 possible values, so to represent each possible state you'll need as much as 7 graphic files.Here is a gauge example that uses this:(L:DumpSwitch,enum)Pull To Dump From Left Engine Knob(L:DumpSwitch,enum) 4 ^ (>L:DumpSwitch,enum)Pull To Dump From Right Engine Knob(L:DumpSwitch,enum) 1 ^ (>L:DumpSwitch,enum)Emergency Oxygen System Knob(L:DumpSwitch,enum) 2 ^ (>L:DumpSwitch,enum) (L:DumpSwitch,enum) 2 & if{ 1 (>L:Oxygen Knob,bool) (P:Absolute Time,seconds) 1 + (>L:Oxygen Timer,seconds) (*initiate timer*) } els{ 0 (>L:Oxygen Knob,bool) }Edit: Hmm, the endtag shows up differently when viewing the message than when I wrote/edit this message.Anyway, another possible example is to "save" a few L:Variables,bool to an A:Variable,enum that is not used by the actual aircraft. I know I need to delay an initialization gauge for about one second before all the variables are correct in the sim (i.e. ambient temperature is wrong immediately after aircraft load). Just be sure to put the info in a variable that is saved with the aircraft :)

Karl,Just tested your above code.It works of course, but what is the meaning?The movements, i use a switch with 7 different positions, are a little bit unpredictable.Do you have an example or, better, a picture?JanNot so "Procul Negotiis"

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Hey Jan.If I understand your question correctl, the meaning is to basically see if when changing the image of a switch you clicked on, if the image of the adjacent switches needs to be updated. In this case, Karl's example was three close switches that may cast a shadow onto each other. SO if you move switch one, not only the image of this switch will need to be changed, but also of the switch next to it, with a new image (albeit in the samw switch position) with a different shadow cast over it.

Thanks Karl, great example.

Hey Arne.Thanks for the explanation, I understand it much better now.

Fabio,Thanks.So it is more a matter of graphics than function.Sure i can use this one.PS.2 years ago i did a Night-VFR T&G at KDAB.Jan"Procul Negotiis"

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.