• 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 Navigation Radar

Messages
278
Country
ca-britishcolumbia
Ok the new thread. I know there are payware guages that do most of the items i would like to do with mine, as i have purchased a couple, but that would take the fun out of coding, I love that feeling when something actually works after hours of sheer frustration. Also I believe in freeware that actually looks good and functions properly. If I get this actually to work with most of features running through my head, I will post the final result for those who are interested in using or advancing it as they see fit. Thank you in advance for any and all help with this creation, and hope i can tap into the vast knowledge that FSDeveloper offers.

Now the guage.
This is a basic list of what i would like the guage to do, and where i am at.

Code:
 Removed see further in post

If anyone has suggestions on what will work "or not" and any ideas is always appreaciated.

The portions i am currently working on are the Squawk Ident reciever and the TCAS Function.

With the Squawk Function Mr Wave, states that his Squawk Ident guage works by setting the transponder to 0000 for 5 seconds and need to have my gauge detect that. This is what i have come up with but to no avail.

The update gauge:
Code:
 Removed see further in post

The macro portion:
Code:
 Removed see further in post

At loss and taking a break with this one.


The TCAS system I thought would be realtively simple, but as it turned out seems to be a lot of trial and error. I would like it two display two warning, one when close a "TCAS WARNING" and one one you need to take action now "TCAS ALERT". This is where i am at.

The update:
Code:
 Removed see further in post


The coding:
Code:
 Removed see further in post


Thanks again for any input, ideas, a general we are way to busy to deal with a newbie, or even you're crazy just use the payware package is always welcome.

Greg
 
Last edited:
Squawk Ident

Anyone have any ideas on this?
I am told you just have to code your guage to detect the xpdr to detect other aircraft squawking 0000.

I have tried the following:

Code:
<Macro id="TARGETIDENT" Name="TARGETIDENT">
<MacroValue>(C:ITrafficInfo:S:TRANSPONDER CODE, number) 0000 == if{ (&gt;C:fs9gps:1:SelectedVehicle) } 
</MacroValue>
</Macro>

Code:
<Macro id="TARGETIDENT" Name="TARGETIDENT">
<MacroValue>(C:ITrafficInfo:CurrentVehicle) (C:ITrafficInfo:SelectedVehicle)
(C:ITrafficInfo:S:TRANSPONDER CODE, number) 0000 == if{ (&gt;C:fs9gps:1:SelectedVehicle) } 
</MacroValue>
</Macro>

Code:
<Macro id="TARGETIDENT" Name="TARGETIDENT">
<MacroValue>(C:ITrafficInfo:S:TRANSPONDER CODE, BCO16) 0000 == if{ (&gt;C:fs9gps:1:SelectedVehicle) } 
</MacroValue>
</Macro>

as well as several other combinations. Any ideas and help would be greatly appreaciated.

Greg
 
This, maybe:

Code:
<Macro id="TARGETIDENT" Name="TARGETIDENT">
<MacroValue>
(C:ITrafficInfo:CurrentVehicle) (>C:ITrafficInfo:SelectedVehicle)
(C:ITrafficInfo:S:TRANSPONDER CODE, number) 0000 == 
if{ 
(C:ITrafficInfo:SelectedVehicle) (&gt;C:fs9gps:1:SelectedVehicle)
} 
</MacroValue>
</Macro>
 
I've been asking for years now to see if anyone had been able to get ITrafficInfo.dll to work in FSX. To date no one has done replied either yay or nay...
 
I've been asking for years now to see if anyone had been able to get ITrafficInfo.dll to work in FSX. To date no one has done replied either yay or nay...

Bill,

Are you referring specifically to XML? I've got it working right nicely in C.

Doug
 
Thanks for the support

Sorry but still no further ahead. I dont understand why Dave Wave has it to work in his Session Info modifications, and i can't get to even come close to awknowledging it. In my mind it seems pretty straight forward. If XPDR is 0000 turn traffic red. I don't know. Will continue to plug away at this.

One question though. Bill you have referred to the ITrafficInfo.dll twice now. I dont seem to have this in fsx, but could be somewhere i have not looked, but rather have a dll labeled fs-traffic.dll. Are these one in the same or two completly different files?

Thanks again
Greg
 
Bill,

Are you referring specifically to XML? I've got it working right nicely in C.

Doug

Actually, my bad Doug... I mistook that for the XML Traffic Radar 2.0.1 that Arne Bartels wrote years ago, which itself uses TrafficInfo.dll internally as I recall, since he included it along with his TrafficRadarXML.dll module. He included the source code with it, but unfortunately it way beyond my skills to unravel and possibly fix.

It's the one I use in FS9 for TCAS display:

Code:
	<!-- =============FSX TCAS ============== -->
	<LayerVehicles>1</LayerVehicles>
	<DetailLayerVehicles>
		(L:G1000_TFC,enum) 0 == if{ 0 }
		els{ 1 }
	</DetailLayerVehicles>
	<TextDetailLayerVehicles>
		(L:G1000_TFC,enum) 0 == if{ 0 }
		els{ 1 }
	</TextDetailLayerVehicles>
	<ObjectDetailLayerVehicles>0x05</ObjectDetailLayerVehicles>
	<ColorLayerVehicles>(L:G1000 TOPO, enum) 2 == if{ 0x006666 } els{ 0x44ffff }</ColorLayerVehicles>
</CustomDraw>
	<!-- =============FS9 TCAS ============== -->
	<Element>
		<Visible>(L:G1000_TFC,bool) 1 ==</Visible>
		<CustomDraw Name="fs9traffic:tcas" X="615" Y="510" Bright="Yes" SymbolSize="3.5" Brightness="255" FixedResolution="1" OtherColour="0x7fffff">
			<CenterX>(@g:currentGroup) @kNAVPageGroup == if{ 322.5 } els{ 182.5 }</CenterX>
			<CenterY>(@g:currentPageNAV) @kNAVPageDflt == if{ 385 } els{ 285 }</CenterY>
			<Heading>(@g:currentPageNAV) @kNAVPageDflt == if{ (A:GPS GROUND TRUE HEADING, degrees) } els{ 0 }</Heading>
			<TrackUp>(@g:currentPageNAV) @kNAVPageDflt ==</TrackUp>
			<Range>(@g:map_ZoomFactor)</Range>
			<PadSymbols>(L:G1000 TOPO,enum) 2 ==</PadSymbols>
		</CustomDraw>
	</Element>

It will produce the symbology used by the Garmin 530 for example.

Among the many things Arne included are all of the functions that the OP has in mind, and it occured to me that if anyone could adapt Arne's source code to work with FSX, it would be a real blessing! :D
 
Ok Why is this so difficult.

Can anyone please tell me why this coding results in the gauge unable to start? I don't get it. Thanks for any help.

Greg

Code:
 Removed see further in post
 
Last edited:
Finally have the Squawk Ident Reciever working.

So it works, you it the ident button and pop the squawking traffic turn red. I ended up going getting rid of the "squawk update", taking the code out of the ATC Radar session info xml. and adding a line to my update.

Heres what it looks like:

added this line to the update

Code:
 1 (&gt;L:SessionInfoInit)

Then abandoned the macro route and went with the original element to end up looking like this:

Code:
<Element id="Squawk Recieve">
<FloatPosition>0.000,0.000</FloatPosition>
<GaugeText id="GaugeText">
<BackgroundColor>0x000000</BackgroundColor>
<Bold>True</Bold>
<Bright>True</Bright>
<FontColor>@FontColor</FontColor>
<FontFace>Arial</FontFace>
<FontFaceLocalize>True</FontFaceLocalize>
<FontHeight>18</FontHeight>
<FontHeightScript>13</FontHeightScript>
<GaugeString>%(c)
%(1 (&gt;G:Var3) )
%((L:Filter) (&gt;C:ITrafficInfo:Filter))
%( (C:ITrafficInfo:ListSize,number) s2 )
%{if}%((0) s1)
%{loop}%(l1 (&gt;C:ITrafficInfo:CurrentVehicle))
%( (C:ITrafficInfo:C:TRANSPONDER CODE, number) 0 == if{ 
(C:ITrafficInfo:SelectedVehicle) (&gt;G:Var1) 
(C:ITrafficInfo:CurrentVehicle) (&gt;C:ITrafficInfo:SelectedVehicle) 
(C:ITrafficInfo:SelectedVehicleID) 
(&gt;C:fs9gps:1:SelectedVehicle) (G:Var1) 
(&gt;C:ITrafficInfo:SelectedVehicle)   } )
%(1 (&gt;G:Var2) (C:ITrafficInfo:CurrentVehicle,number) 
(L:ListFirstVis,Number) &lt; if{ 0 (&gt;G:Var2) }  )
%( (G:Var3) 16 &gt;  if{ 0 (&gt;G:Var2) } )
%( (G:Var2) 1 == if{ (G:Var3) ++ (&gt;G:Var3) }  (G:Var2) ) 
%{if}%((C:ITrafficInfo:SelectedVehicle) l1 == )
%{if}\{rev}\{blc=@FontColor}%{end}
%( @CurrentCallsign )%!s!\t
%((C:ITrafficInfo:C:ATC MODEL, string))%!s!\t
%((C:ITrafficInfo:CurrentDistance, nmiles))%!d! nm
\{nr}%{end}
%(l1 ++ s1 l2 &lt; d  (G:Var2) &amp;&amp;)
%{if}\n\{lsp=16}%{end}
%{next}
%{end}</GaugeString>
<Length>100</Length>
<Size>150,25</Size>
<HeightScript>@TextHeight 18 * 5 +</HeightScript>
<WidthScript>206</WidthScript>
<Tabs>0,75,150</Tabs>
<Transparent>True</Transparent>
</GaugeText>
</Element>

Sorry if im kind of using this forum as a sounding board, it helps keep me on track and welcome the ideas and comments from those who know this stuff.

On to the TCAS Function.

Thanks
Greg
 
Oh, don't apologize! It's worth it because now folks have a resource for finding "working solutions" so they won't have to reinvent the wheel!

That's precisely why we have a "Working XML..." forum at Free Flight Design forums. It serves as a Library of working scripts.
 
Working on the Airport Info Display

Thanks for that Bill!

I have decided to tackle the airport info display. What I would like to have a list a info from the nearest airports info up to a range of 350nm. When i started looking at the code and came up with below all i get on the display is a zero.

Code:
<Element id="Nearest Airport">
<FloatPosition>500.000,200.000</FloatPosition>
<Visibility>(L:WSoffon,bool)</Visibility>

       
<Element id="Airport ID">
<FloatPosition>0.000,0.000</FloatPosition>
<GaugeText id="GaugeText">
<BackgroundColor>0x000000</BackgroundColor>
<Bold>True</Bold>
<Bright>True</Bright>
<FontColor>@FontColor</FontColor>
<FontFaceLocalize>True</FontFaceLocalize>
<FontHeightScript>@FontHeight</FontHeightScript>
<FontWeight>2</FontWeight>
<GaugeString>%((c:NearestAirportCurrentIdent))%!s!</GaugeString>
<HeightScript>@TextHeight</HeightScript>
<WidthScript>@DataWidth</WidthScript>
<Transparent>True</Transparent>
</GaugeText>
</Element>
</Element>

Any ideas always appreaciated.

Greg
 
I have decided to tackle the airport info display. What I would like to have a list a info from the nearest airports info up to a range of 350nm. When i started looking at the code and came up with below all i get on the display is a zero.

Hi Greg,

You can get such a list of nearest airport information from a search of the gps database in the fs9gps module. Note, you must specify an index value in order to display a particular airport's information.

Nearest Airport searches are discussed here http://www.robbiemcelrath.com/blackbox/?gps. Look at pages 59 through 61 for the Nearest Airport Group and pages 13 through 18 for general info on gps database search.

Hope this helps,

Bob
 
Last edited:
Nearest Airport Scroll Switch

Thanks Bob, that was an awesome resource, now have a Nearest Airport Page in my guage, although needs some refinement, it is displaying correctly.

Now fighting with the scroll buttons, thinking it has to involve the (NEARESTAIRPORTITEMSNUMBER) and the (NEARESTAIRPORTSCURRENTLINE) but cant for the life of me put it together.

Any help? Anyone? thanks

Greg
 
Now fighting with the scroll buttons, thinking it has to involve the (NEARESTAIRPORTITEMSNUMBER) and the (NEARESTAIRPORTSCURRENTLINE) but cant for the life of me put it together.

Greg,

Not sure how your scroll is going to function and what the particular difficulty is without seeing some code or a more complete description, so I'll guess you want to be able to select a particular airport in the Nearest list and then display or otherwise utilize additional information about that airport?

If so, then you need to specify the Index position of the desired airport. The Index, NearestAirportCurrentLine, is its position in the Nearest list, starting with Index = 0 for the first airport in the list. It is Settable and your scroll code will need to set the value of this variable.

How much airport information you can mine from the NearestAirport group depends on whether you are using FS9 or FSX - there are 23 additional airport variables available in FSX NearestAirport group compared to the same group in FS9. Either way, FS9 or FSX, you can always access all 45 Airport variables if you ICAO Transfer into the WaypointAirport group. If you want your code to work for both FS9 and FSX, then set it up to work in FS9.

It sounds a little complicated to some at first, but it's all covered in the guidebook. Pages 13 through 41 address the basic techniques used when working with Flight Sim's gps module. There's a lot built into that little dll module and database and for those that become familiar with it, many gauge creation opportunities and capabilities are opened up, IMHO.

Bob
 
Thanks Again

Thanks for that will be working on that again shortly. Working on my nearest airport page and hit some difficulty transfering from Nearest to Waypoint data.

This is how I would like my page to look when displayed:

Code:
Nearest Airport Search
CYCW - Chilliwack 
069*m  0.2nm  Apr:  Elev: 32ft Rwy: 3990ft
________________________________________
CYXX - Abbotsford
227*m 17.6nm Apr:ILS Elev: 45ft Rwy:7988ft
________________________________________
ETC, ETC....


I have not added the Elvation portion to the code, figuring it would be easy once the name is figured out. Here is my code as it stands now:

Code:
<GaugeString>Nearest Airport Search \n
%((@c:NearestAirportItemsNumber) s2 0 !=)
%{if}
%(0 sp1) 
%{loop}
%(l1 (>@c:NearestAirportCurrentLine))
%{if}\{blnk}%{end}%((@c:NearestAirportCurrentIdent))%!s!\{nr}\t

[COLOR="Blue"]%0 (>c:NearestAirportCurrentLine) (>@c:NearestAirportCurrentICAO) (>@c:WaypointAirportName)%!s![/COLOR]

\{img@AirportIcon(@c:NearestAirportCurrentAirportKind, @c:NearestAirportCurrentLongestAirportDirection)}\t
%((@c:NearestAirportCurrentTrueBearing, degrees) (A:GPS MAGVAR, degrees) - d360)%!03d!\{dplo=M}\t
%((@c:NearestAirportCurrentDistance, nmiles))%!.1f!\{dpl=nm}\t
%((@c:NearestAirportCurrentBestApproach))%!s!\n
\{tabs=50R,60,145,244R}
rwy\t
%((@c:NearestAirportCurrentLongestRunwayLength, feet))%!d!\{dpl=ft}
%(l1 ++ s1 l2 &lt; d)
%{if}\n\{lsp=4}\{ladj=C}\{tabs=}\{line=240}\n%{end}
%{next}
%{end}
</GaugeString>

Anyone see where I am going wrong? Thanks again for the support and the ideas with this, find it supporting and keeping me motivated. Going to work on that scroll switch now.

Greg
 
Why is one step forward and 25 back?

Ok, i have made a bit of progress on this. Have the low Altitude Warning working. YAY

The code i used was:
Code:
<Element id="Altimeter Warning">
<FloatPosition>0.000,0.000</FloatPosition>
<Visibility>(L:WSoffon,bool)</Visibility>

<Element id="Altitude Warning">
<FloatPosition>0.000,0.000</FloatPosition>
<Visibility>(A:Radio height, feet) d 400 &lt; r 0 &gt; &amp;&amp;</Visibility>

<Element id="Altitude Warning">
<FloatPosition>0.000,0.000</FloatPosition>
<Visibility>(A:Flaps Handle Percent, percent) 1 &lt;</Visibility>

<Element id="Alt Warning">
<FloatPosition>0.000,0.000</FloatPosition>
<Visibility>(A:GEAR HANDLE POSITION, bool) 1 &lt;</Visibility>
   
<Element id="ALTWARN">
<FloatPosition>255.000,280.000</FloatPosition>
<GaugeText id="GaugeText">
<BackgroundColor>0x000000</BackgroundColor>
<Bold>True</Bold>
<Bright>True</Bright>
<FontColor>Red</FontColor>
<FontFaceLocalize>True</FontFaceLocalize>
<FontHeightScript>42</FontHeightScript>
<FontWeight>2</FontWeight>
<GaugeString>ALTIMETER WARNING \n TOO LOW</GaugeString> 
<HorizontalAlign>Center</HorizontalAlign>
<HeightScript>100</HeightScript>
<WidthScript>300</WidthScript>
<Transparent>True</Transparent>
<VerticalAlign>Center</VerticalAlign>
</GaugeText>
</Element>
</Element>
</Element>
</Element>
</Element>

Still frustrated with the Airport Name display in the Nearest Airport Page -- See Above.

Now i started working on the terrain display map, i find when I'm getting frustrated and lost it's better to move on to something else, and can't get the map to display the difference in elevation colors.

What I have which is obviously wrong or at least missing something important:

The macros
Code:
<Macro id="MainMap" Name="MainMap">
<MacroValue>(L:MainMap,bool) and if{ 1 &gt; (G:Var1) } els { 0 }
</MacroValue>
</Macro>

<Macro id="TerrMap" Name="TerrMap">
<MacroValue>(L:TerrMap,bool) and if{ 1 &gt; (G:Var2) } els { 0 }
</MacroValue>
</Macro>

Segments of the Custom Draw Parameter:
Code:
<CustomDrawParam id="Elevation0Color" Name="Elevation0Color">
<Value>if{ (G:Var1) 0x5c9862 } els{
(G:Var2) 2 &lt; (A:SIM ON GROUND,bool) or if{ 0x259C7E } 
els{ (A:PLANE ALTITUDE,feet) d s0  1900 &gt; if{ 0x259c7e } 
els{ l0   900 &gt; if{ 0x00ffff } els{ 0x0000ff } } } }</Value>
</CustomDrawParam>

<CustomDrawParam id="Elevation1000Color" Name="Elevation1000Color">
<Value>if{ (G:Var1) 0x4e8443 } els{
(G:Var2) 2 &lt; (A:SIM ON GROUND,bool) or if{ 0x71A65C } 
els{ (A:PLANE ALTITUDE,feet) d s0   500 &gt; if{ 0x259c7e } 
els{ l0     0 &gt; if{ 0x00ffff } els{ 0x0000ff } } } }</Value>
</CustomDrawParam>

The interm switches:
Code:
<MouseArea id="Map">
<Visibility>(L:WSoffon,bool)</Visibility>
<FloatPosition>555.000,677.000</FloatPosition>
<Size>65,61</Size>
<CursorType>Hand</CursorType>
<HelpId></HelpId>
<MouseClick id="MouseClick">
<Script>(L:MainMap,bool) if { 1 (L:LayerTerrain) ++ 2 % (&gt;L:LayerTerrain) }</Script>
</MouseClick>
</MouseArea>

<MouseArea id="Terr">
<Visibility>(L:WSoffon,bool)</Visibility>
<FloatPosition>630.000,677.000</FloatPosition>
<Size>72,68</Size>
<CursorType>Hand</CursorType>
<HelpId></HelpId>
<MouseClick id="MouseClick">
<Script>(L:TerrMap,bool) if { 1 (L:LayerTerrain) ++ 2 % (&gt;L:LayerTerrain) }</Script>
</MouseClick>
</MouseArea>

Eventually I would like to have the switch on one to cycle through the map displays, but of course at a loss on how to achieve that.

Any help or a point in the right direction would be great.

Thanks
Greg
 
This looks better

I don't know what i was thinking, Frustrated and staring at this stuff to long I guess. Does this look better?

Code:
<CustomDrawParam id="Elevation0Color" Name="Elevation0Color">
<Value>(L:LayerTerrain) if{ 0x5c9862 } els{
(G:Var2) 2 &lt; (A:SIM ON GROUND,bool) or if{ 0x259C7E } 
els{ (A:PLANE ALTITUDE,feet) d s0  1900 &gt; if{ 0x259c7e } 
els{ l0   900 &gt; if{ 0x00ffff } els{ 0x0000ff } } } }</Value>
</CustomDrawParam>

<CustomDrawParam id="Elevation1000Color" Name="Elevation1000Color">
<Value>(L:LayerTerrain) if{ 0x4e8443 } els{
(G:Var2) 2 &lt; (A:SIM ON GROUND,bool) or if{ 0x71A65C } 
els{ (A:PLANE ALTITUDE,feet) d s0   500 &gt; if{ 0x259c7e } 
els{ l0     0 &gt; if{ 0x00ffff } els{ 0x0000ff } } } }</Value>
</CustomDrawParam>

Still haven't figured out how to create the switch, but if someone can tell if this will work, I would appreaciate it.

Greg
 
In "Way" over my head

Well the bad news is I am no further ahead. 16 hours, at least now and nothing. I have read the fsgps Module by Bob McElrath, thanks for that by the way. In the module Bob explains that transfering from Nearest conditions to waypoint conditions is simple... Well I'm an idiot then.

In the examples he demonstrates having an update like this one (which I am using):
Code:
<Update  Hidden="No">
25 (>@c:NearestAirportMaximumItems) 
352 (>@c:NearestAirportMaximumDistance, NMiles)
(A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
(A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
0 (>@c:NearestAirportCurrentLine) (@c:NearestAirportCurrentICAO) (>c:WaypointAirportICAO)
</Update>

Then the format in the element like this:

Code:
%(@c:NearestAirportCurrentICAO) 
(>@c:WaypointAirportICAO) 
(@c:WaypointAirportName)%\n

I find it very confusing :confused::confused:

Anyone with a pointer or a suggestion? Even a WOW I'm glad i am not that guy or man this guy is an idiot would be acceptable right now.

Thanks
Greg
 
It's kind of tough trying to explain XML syntax and usage, but a few general explanations might make it easier to parse out what's happening...

I've reformatted the script into discrete steps to make it easier to see what's going on:

Code:
%
(@c:NearestAirportCurrentICAO) (>@c:WaypointAirportICAO) 
(@c:WaypointAirportName)
%
\n

  1. The % token symbol means "evaluate what follows"
  2. The > token symbol means "set the value of the preceeding token parameter into the following token parameter"
  3. The /n token symbol means "new line" (same as Enter key)

What the above does is to take the already determined ICAO of the "current nearest airport" and use it to set the ICAO value for the "waypoint airport."
The last bit will now return the value for the "waypoint airport name."
 
Last edited:
Thats exactly what i thought

Thanks Bill,
I thought that was what it was supposed to do, and its good to hear that it is supposed to return the "Airport Name", mainly I'm not going crazy. I just dont understand why it is not doing what it is supposed to. depending on what I try I either get a blank line or (>@c:WaypointAirportICAO) (@c:WaypointAirportName) when i turn on the airport page.

Thanks and any further suggestion always welcomed.

Greg
 
Back
Top