• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA XML Decode Flags - NAV CODES

But surely in this case Isvor and IsLoc are only going to be used as booleans - what other types of calculation would they be used in? Their purpose is to determine if a bit is set or not.

Any other types for sure. For example this (pseudocode):

Code:
<Select>
   <Value>(A:NAV CODES:1, flags) 128 &amp;</Value>
       <Case Value="0">
          <Image "IsVor.bmp"> 
          etc
       <Case Value="1">
          <Image "IsILS.bmp"> 
        etc
   etc
"IsILS.bmp" won't show ever


Quote:
What seems to work but is a false presumption, is (A:NAV CODES:1, flags) 128 and (remember &amp; is NOT the same as and)

I don't think it does work. It should return 1 (true) if any bits or combination of bits in A:NAV CODES are set, and 0 (false) only if no bits are set.

But it works -apparently-, as long as the VOR being checked is out of range (returns 0). That's the reason I stated "it seems to work".

Joao, et. al,

Apologies in advance if I am not correctly following the discussion, but why can't this be used to tell if a Nav radio is tuned to and receiving a localizer?:

Code:
(A:NAV1 CODES, flags) 128 >= if{ 1 (>L:NavReceivingLocalizer, bool) }

You can use it Bob, but this approach would be valid only for a VOR/LOC flag inspection; the idea is to find a method that can be applied to the whole set.

Tom
 
Huh...NO!, we must revert those wiki macros to their original content.

Thanks for the reversion, Tom. It has been several years since I first authored that entry and had quite forgotten that I used the bitwise & operator deliberately...

...it is also confusing as the dickens that the Wiki editor does strange things with special operators that we take for granted in XML.

For example, to display a single &amp; sequence, one must type &amp;amp; which -on a quick glance in the Wiki editor- appears to be &amp;&amp; which is of course completely wrong! So, it's quite easy to get confused... :eek:
 
Bill, I scratched my head trying to figure out how to write &amp; and the Wiki parser not translate it to &. Finally got the solution:

Instead of &amp; I had to write &# plus the ASCII code for each letter plus ; !:eek::eek::eek:

Tom
 
Bill, I scratched my head trying to figure out how to write &amp; and the Wiki parser not translate it to &. Finally got the solution:

Instead of &amp; I had to write &# plus the ASCII code for each letter plus ; !:eek::eek::eek:

Tom

I noticed that you did. However, if you look back through the revision history, you can see that Paul (BaySYS) edited the Wiki to remove my comments regarding the "&" symbol and advising readers to substitute &amp; instead...

...and simply typed in &amp;amp;...

This way, only the characters hilighted in red will be displayed by the Wiki software. That was a clever solution... :rotfl:
 
You can use it Bob, but this approach would be valid only for a VOR/LOC flag inspection; the idea is to find a method that can be applied to the whole set.

Tom

Hi Tom,

Joao stated "I want my EADI to show a distinct horizontal deviation indicator when the NAV1 tuned station is a LOCALIZER, as an approach aid (even if it hasn't a glidesope); and another symbol when its a VOR, for navigation or a non-precision approach - that's how this gauge works in RL."

"I'm just using the code as a condition for visibility of a symbol instead of another (VOR/LOC)."


Code:
(A:NAV1 CODES, flags) 128 >= if{ 1 (>L:NavReceivingLocalizer, bool) }

will tell you when you have a localizer, so I am missing why this cannot be used to differentiate between Nav approaches with localizer vs Nav approaches without... Please explain what I am missing....:o

ขอบคุณมากครับ,

Bob
 
Any other types for sure. For example this (pseudocode):

Code:
<Select>
   <Value>(A:NAV CODES:1, flags) 128 &amp;</Value>
       <Case Value="0">
          <Image "IsVor.bmp"> 
          etc
       <Case Value="1">
          <Image "IsILS.bmp"> 
        etc
   etc
"IsILS.bmp" won't show ever




But it works -apparently-, as long as the VOR being checked is out of range (returns 0). That's the reason I stated "it seems to work".



You can use it Bob, but this approach would be valid only for a VOR/LOC flag inspection; the idea is to find a method that can be applied to the whole set.

Tom

Here's my code, and it works ok. :D

Code:
<Macro id="Macro" Name="VOR">
	<MacroValue>[COLOR="Red"](A:NAV CODES:1, flags) 128 &amp; ![/COLOR]</MacroValue>
</Macro>
<Macro id="Macro" Name="LOC">
	<MacroValue>[COLOR="red"](A:NAV CODES:1, flags) 128 &amp;[/COLOR]</MacroValue>
</Macro>
		
<Element id="lateral deviation indicator">
	<FloatPosition>0.000,0.000</FloatPosition>
	<Visibility>[COLOR="Red"](A:NAV HAS NAV:1, bool)[/COLOR]/Visibility>
	<Element id="NAV VOR">
		<FloatPosition>0.000,0.000</FloatPosition>
		<Visibility>(A:GPS DRIVES NAV1, bool) ! [COLOR="red"]@VOR[/COLOR] &amp;&amp;</Visibility>
		<PolyLine id="Polyline">
			*drawing*
		</PolyLine>
		<Shift id="Shift">
			*calculations*
		</Shift>
	</Element>
	<Element id="NAV LOC">
		<FloatPosition>0.000,0.000</FloatPosition>
		<Visibility>(A:GPS DRIVES NAV1, bool) ! [COLOR="red"]@LOC[/COLOR] &amp;&amp;</Visibility>
		<PolyLine id="Polyline">
			*drawing*
		</PolyLine>
		<Shift id="Shift">
			*calculations*
		</Shift>
	</Element>
</Element>
 
...
Code:
(A:NAV1 CODES, flags) 128 >= if{ 1 (>L:NavReceivingLocalizer, bool) }

will tell you when you have a localizer, so I am missing why this cannot be used to differentiate between Nav approaches with localizer vs Nav approaches without... Please explain what I am missing....:o

ขอบคุณมากครับ,

Bob

Bob, you're missing nothing. Actually I started with "You can use it Bob...", :confused:
What I added is the convenience of using a single method for handling each one of the bit flags, that's all.

Tom

PS: What does it mean ขอบคุณมากครับ, ?
 
Here's my code, and it works ok. :D

Code:
...
<Visibility>(A:GPS DRIVES NAV1, bool) ! [COLOR="red"]@VOR[/COLOR] &amp;&amp;</Visibility>
...

Yes, this is correct because &amp;&amp; (and) is a conditional that compares the last two stack values as being implicit bool (<Value> works different though).

Tom
 
Good to know.

ขอบคุณมากครับ Bill!

ยินดีต้อนรับคุณ Bob!

Tom
 
Back
Top