Jump to content

Archived

This topic is now archived and is closed to further replies.

Propwash

FS9GPS Documentation

Recommended Posts

After struggling for some time with many of the fs9gps variables and searching the forums for documentation of their use, often in vain, I attempted to fill the gap.What started out as notes on a spreadsheet grew into something more resembling a guidebook, “FS9GPS Module”. It’s a collection of ‘notes to myself’ on the use of the gps module, definitions and examples of its 320 variables, and explanations of the principals of some xml coding techniques such as ICAO Transfer and Cycle Skipping that are used when working with the FS9 gps.dll module.For those interested, it can be downloaded from the BlackBox website:BlackBox Website - GPS GuidebookHope you enjoy it!Regards, Bob

Share this post


Link to post
Share on other sites

Bob, WOW !! That is one heck of a tutorial! Thank - You for all the work.. One question.. What do you use for your XML editor? Looks like it has some good tools built in. ( IE.. Collapsing sections, IF/ELS tracking etc..)Thanks again -Roman

Share this post


Link to post
Share on other sites
One question.. What do you use for your XML editor? Looks like it has some good tools built in. ( IE.. Collapsing sections, IF/ELS tracking etc..)
Thanks for the comments, Roman... much appreciated. Couldn't have done it without all of the tips and insights you have provided.The xml editor is notepad++Notepad ++
Nice one Bob!!!-Dai
Many thanks, Dai !

Share this post


Link to post
Share on other sites

Thanks BobJust so happens I am working on a GPS gauge at the moment and trying to decipher the default GPS xml code to try to work out what is what so I'm sure your guide will be a big help.Plus, if anyone doesn't have Notepad++ yet get it. It's great for writing XML.

Share this post


Link to post
Share on other sites

Bless You, Bob! This is going to be a massive help to me!...Don

Share this post


Link to post
Share on other sites

Bob & Anthony, Thanks for the heads up about Notepad++ ! Has all the cool features of MS Visual Studio plus more,, without all the headroom.Roman

Share this post


Link to post
Share on other sites

I haven't looked into Notepad++ for quite awhile now. One of the things I like most about Visual Studio is that I can have multiple .xml file open as tabbed screens, which makes copy/pasting a trival task......which is especially handy for generating a custom modeldef.xml file or makemdl.parts.xml file. :(

Share this post


Link to post
Share on other sites

Wow this is amazing. I can't wait to read it.Bob, thanks for all the effort that went into it.Danny

Share this post


Link to post
Share on other sites

Bill, from the documentation:"Notepad++ allows you to open multiple files at once, or multiple files multiple times, but only one will be active (have focus) at any time. All files are represented on the tab bar with their filename and an icon indicating if its normal, edited or readonly (see the section about the Tab Bar for more details). Simply click on a tab to activate the file. You can also use the Ctrl-TAB and Ctrl-Shift-TAB key combinations to switch through the active files, or depress the right mouse button and use the scroll wheel (see also Switching between Documents)."Hope this helps,

Share this post


Link to post
Share on other sites

Do you guys use the XML plugin for notepad++? (XML Tools)

Share this post


Link to post
Share on other sites
Do you guys use the XML plugin for notepad++? (XML Tools)
Nope, I just use the plain old notepad++ v5.8.7 which seems to work with xml just fine for me. Haven't really had a chance to look at all the tools and plugins yet either as I only downloaded it a couple of weeks ago.

Share this post


Link to post
Share on other sites
Wow this is amazing. I can't wait to read it.Bob, thanks for all the effort that went into it.Danny
@Danny, Don, Anthony - Thanks for the feedback. I quite enjoyed digging (somewhat) deeply into the gps module and writing the guidebook although I cannot tell you how glad I am there were not more variables to deal with. I should have stated it more clearly in the text, but I have a renewed respect for the Microsoft team that built MS Flight Simulator and the gps module. As a pilot of over 30 years, I will add that, in my humble opinion, the gps engine seems remarkably capable, if not robust (but I don't think my expectations are as precise as Dai's), and the gps database is pretty darn good - especially considering it's a "game" product that cost me less than 50 bucks. Anyway, my opinion and the guidebook are free, so take them for what they're worth.I hope it encourages more people to write code that utilizes the gps variables. The gps opens up another dimension of FS gauge building possibilities.Regards,Bob

Share this post


Link to post
Share on other sites
........ but I have a renewed respect for the Microsoft team that built MSFS and the gps module.
Hear hear :( ...... Well ....certainly as far as FS 9 is concerned. :(

Share this post


Link to post
Share on other sites

Hi,Very nice piece of work!!Now a question related to the Center frequencies and names:I know you have to include "Center" in the NearestAirspaceQuery, but i don't know how to convert the binary, 0011 etc., to hexadecimal like 0xCE4010.Is there some converter or table?Thanks,Edit, found:http://easycalculation.com/binary-converter.phpMay be useful for fr. Bill in his quest for Centerfreq's.Will report if it works.Jan

Share this post


Link to post
Share on other sites

Jan, If you're running Windows 7 ( maybe even Vista, not sure ) the built in calculator can do it for you. Start the calculator, in the view menu select programmer. Once there in the left hand upper pane tick "Bin" , enter your binary value then select "Hex" -- done... You may have to select another conversion size depending on how long the binary entry -- Lower Left pane. If you do not have that calculator maybe see here - http://www.microsoft.com/downloads/en/details.aspx?FamilyID=32b0d059-b53a-4dc9-8265-da47f157c091&displaylang=en Roman

Share this post


Link to post
Share on other sites

HiFound it and it works!From now i know where i am (Icaocode), which center and what frequency.0xFFFFFE in the query gives all airspaces, frequencies, names and regions.There also is somewhere an xml gauge that converts icao region code in regioname.Jan

Share this post


Link to post
Share on other sites
Now a question related to the Center frequencies and names:I know you have to include "Center" in the NearestAirspaceQuery, but i don't know how to convert the binary, 0011 etc., to hexadecimal like 0xCE4010.Is there some converter or table?
Thanks, Jan,The 24 bit hex can be trickier because it is bigger than some calculators can handle - although the Windows calcs that Roman points out have no difficulty. Another option for the conversion is posted on the BlackBox site:Nearest Airspace QueryIt is set up to just select the airspaces desired using check boxes and the hex and bin numbers appear at the bottom of the screen.As well, I have a simple custom excel function that I use to convert any number of any size from any number base to any other number base, if anybody is interested. Lot's of any's there!And, thanks again for all of your very helpful posts regarding fs9gps. I wouldn't have known where to start without help like that.Bob

Share this post


Link to post
Share on other sites

Bob,I will try to use a L:Var to select the different airspaces.Jan

Share this post


Link to post
Share on other sites
Bob,I will try to use a L:Var to select the different airspaces.Jan
Hmmm. Good idea. Offers flexibility. It will be interesting if it doesn't work, considering NearestAirspaceQuery can accept the decimal equivalent of the hex number.Bob

Share this post


Link to post
Share on other sites

Hi,This seems to work:<Update>(L:nearest airspacetype selection,number) 0 == if{ 0x0 } els{ (L:nearest airspacetype selection,number) 1 ==if{ 0x0FC000 } els{ (L:nearest airspacetype selection,number) 2 == if{ 0xEFC038 } els{ (L:nearest airspacetype selection,number) 3 ==if{ 0xFFFFFE } } } } (>@c:NearestAirspaceQuery) (any combination possible)</Update><Click>(L:fix,enum) 1 ==if{ (L:nearest airspacetype selection,number) 0 > if{ (L:nearest airspacetype selection,number) 1 - 0 max (>L:nearest airspacetype selection,number) quit } } (L:fix,enum) 1 ==if{ (L:nearest airspacetype selection,number) 4 < if{ (L:nearest airspacetype selection,number) 1 + 3 min (>L:nearest airspacetype selection,number) quit} } </Click>Jan

Share this post


Link to post
Share on other sites
els{ (L:nearest airspacetype selection,number) 2 == if{ 0xEFC038 }
ahh, okay, you're passing the hex number to NearestAirspaceQuery. I had presumed you were going to set it up using an L:Var containing the decimal equivalent of the hex number such as:(L:nearest airspacetype selection, enum) (>c:fs9gps:NearestAirspaceQuery), where some other code generated the NearestAirspaceQuery, in decimal form. Anyway, I can see that what you've got represents a way to choose between standard airspace filters while the sim is running. It could also let one open up the Center Airspace search when you want it, and close it out when you don't. A useful approach.Bob

Share this post


Link to post
Share on other sites

Hi all, I created a "front end" for testing with the GPS. I didnot check it with the GPS nor whether the GPS does take in Decimal in place of Hex for the input. Was just testing for something very similar and it ported over nicely for this part of the discussion.Roman

<Gauge Name="AIRSPACE INJECTOR" Version="1.0"><!-- THE OUTPUT TO GPS FOR AIRSPACE QUERY IS (L:SEND AIRSPACE, number) --><Macro Name="ADD">(L:SW_1, bool) if{ 0 (>L:SEND AIRSPACE, number) 0 (>L:SW_1, number) } 1 (>L:SW_@1, number) (L:SEND AIRSPACE, number) @2 + (>L:SEND AIRSPACE, number)</Macro><Macro Name="SUBT">0 (>L:SW_@1, number) (L:SEND AIRSPACE, number) @2 - (>L:SEND AIRSPACE, number)</Macro><Update>	(L:SEND AIRSPACE, number) 0 == if{ 1 (>L:SEND AIRSPACE, number) 1 (>L:SW_1, bool) }</Update><Element Name="DISPLAY">	<FormattedText Bright="Yes" X="130" Y="485" FontSize="16" Length="80" BackgroundColor="Gray" Font="Arial Bold" Color="Orange">		<Color Value="Green"/>		<Color Value="Red"/>		<String>			%((L:SW_1, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%NONE%\n%			%((L:SW_2, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%CENTER%\n%			%((L:SW_3, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%CLASS A%\n%			%((L:SW_4, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%CLASS B%\n%			%((L:SW_5, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%CLASS C%\n%			%((L:SW_6, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%CLASS D%\n%			%((L:SW_7, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%CLASS E%\n%			%((L:SW_8, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%CLASS F%\n%			%((L:SW_9, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%CLASS G%\n%			%((L:SW_10, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%TOWER%\n%			%((L:SW_11, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%CLEARANCE%\n%			%((L:SW_12, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%GROUND%\n%			%((L:SW_13, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%DEPARTURE%\n%			%((L:SW_14, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%APPROACH%\n%			%((L:SW_15, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%MOA%\n%			%((L:SW_16, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%RESTRICTED%\n%			%((L:SW_17, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%PROHIBITED%\n%			%((L:SW_18, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%WARNING%\n%			%((L:SW_19, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%ALERT%\n%			%((L:SW_20, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%DANGER%\n%			%((L:SW_21, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%NATIONAL PARK%\n%			%((L:SW_22, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%MODE C%\n%			%((L:SW_23, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%RADAR%\n%			%((L:SW_24, bool))%{if}%\{clr2}%{else}%\{clr1}%{end}%TRAINING%\n%			%\{clr3}%--- %((L:SEND AIRSPACE, number))%!d!% ---%</String>	</FormattedText></Element><Mouse><Area Name="NONE" Left="0" Top="3" Width="128" Height="10">     <Cursor Type="Hand"/>     <Click>(L:SEND AIRSPACE, number) 1 =! if{ 1 (>L:SEND AIRSPACE, number) 1 (>L:SW_1, bool) 0 (>L:SW_2, bool) 0 (>L:SW_3, bool) 0 (>L:SW_4, bool) 0 (>L:SW_5, bool) 0 (>L:SW_6, bool) 0 (>L:SW_7, bool) 0 (>L:SW_8, bool) 0 (>L:SW_9, bool) 0 (>L:SW_10, bool) 0 (>L:SW_11, bool) 0 (>L:SW_12, bool) 0 (>L:SW_13, bool) 0 (>L:SW_14, bool) 0 (>L:SW_15, bool) 0 (>L:SW_16, bool) 0 (>L:SW_17, bool) 0 (>L:SW_18, bool) 0 (>L:SW_19, bool) 0 (>L:SW_20, bool) 0 (>L:SW_21, bool) 0 (>L:SW_22, bool) 0 (>L:SW_23, bool) 0 (>L:SW_24, bool)</Click></Area><Area Name="CENTER" Left="0" Top="23" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_2, bool) if{ @SUBT(2,2) } els{ @ADD(2,2) }</Click></Area><Area Name="CLASS A" Left="0" Top="43" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_3, bool) if{ @SUBT(3,4) } els{ @ADD(3,4) }</Click></Area><Area Name="CLASS B" Left="0" Top="63" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_4, bool) if{ @SUBT(4,8) } els{ @ADD(4,8) }</Click></Area><Area Name="CLASS C" Left="0" Top="81" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_5, bool) if{ @SUBT(5,16) } els{ @ADD(5,16) }</Click></Area><Area Name="CLASS D" Left="0" Top="100" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_6, bool) if{ @SUBT(6,32) } els{ @ADD(6,32) }</Click></Area><Area Name="CLASS E" Left="0" Top="119" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_7, bool) if{ @SUBT(7,64) } els{ @ADD(7,64) }</Click></Area><Area Name="CLASS F" Left="0" Top="138" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_8, bool) if{ @SUBT(8,128) } els{ @ADD(8,128) }</Click></Area><Area Name="CLASS G" Left="0" Top="158" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_9, bool) if{ @SUBT(9,256) } els{ @ADD(9,256) }</Click></Area><Area Name="TOWER" Left="0" Top="177" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_10, bool) if{ @SUBT(10,512) } els{ @ADD(10,512) }</Click></Area><Area Name="CLEARANCE" Left="0" Top="196" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_11, bool) if{ @SUBT(11,1024) } els{ @ADD(11,1024) }</Click></Area><Area Name="GROUND" Left="0" Top="215" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_12, bool) if{ @SUBT(12,2048) } els{ @ADD(12,2048) }</Click></Area><Area Name="DEPARTURE" Left="0" Top="235" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_13, bool) if{ @SUBT(13,4096) } els{ @ADD(13,4096) }</Click></Area><Area Name="APPROACH" Left="0" Top="255" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_14, bool) if{ @SUBT(14,8192) } els{ @ADD(14,8192) }</Click></Area><Area Name="MOA" Left="0" Top="274" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_15, bool) if{ @SUBT(15,16384) } els{ @ADD(15,16384) }</Click></Area><Area Name="RESTRICTED" Left="0" Top="293" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_16, bool) if{ @SUBT(16,32768) } els{ @ADD(16,32768) }</Click></Area><Area Name="PROHIBITED" Left="0" Top="313" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_17, bool) if{ @SUBT(17,65536) } els{ @ADD(17,65536) }</Click></Area><Area Name="WARNING" Left="0" Top="332" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_18, bool) if{ @SUBT(18,131072) } els{ @ADD(18,131072) }</Click></Area><Area Name="ALERT" Left="0" Top="351" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_19, bool) if{ @SUBT(19,262144) } els{ @ADD(19,262144) }</Click></Area><Area Name="DANGER" Left="0" Top="370" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_20, bool) if{ @SUBT(20,524288) } els{ @ADD(20,524288) }</Click></Area><Area Name="NATIONAL PARK" Left="0" Top="388" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_21, bool) if{ @SUBT(21,1048576) } els{ @ADD(21,1048576) }</Click></Area><Area Name="MODE C" Left="0" Top="408" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_22, bool) if{ @SUBT(22,2097152) } els{ @ADD(22,2097152) }</Click></Area><Area Name="RADAR" Left="0" Top="429" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_23, bool) if{ @SUBT(23,4194304) } els{ @ADD(23,4194304) }</Click></Area><Area Name="TRAINING" Left="0" Top="446" Width="128" Height="10">	<Cursor Type="Hand"/>	<Click>(L:SW_24, bool) if{ @SUBT(24,8388608) } els{ @ADD(24,8388608) }</Click></Area></Mouse></Gauge>

Share this post


Link to post
Share on other sites

Just for general information, I direct everyone's attention to this Wiki entry on the subject of "Airspaces" or more specifically incomplete SDK information on the subject, which Roman seems to have covered well in his example XML script:http://www.fsdeveloper.com/wiki/index.php?title=GPS:_Missing_Airspace_Options :(

Share this post


Link to post
Share on other sites
Just for general information, I direct everyone's attention to this Wiki entry on the subject of "Airspaces" or more specifically incomplete SDK information on the subject, which Roman seems to have covered well in his example XML script:http://www.fsdevelop...irspace_Options :(
... but most of the input parameters listed in that Wiki are incorrect.

Share this post


Link to post
Share on other sites

×
×
  • Create New...