Jump to content
Sign in to follow this  
Guest Desert Jockey

Nearest Airport

Recommended Posts

Guest Gordius

I realise this might sound odd but I am hunting for a gauge that does nothing other than list the nearest airports. Similar to as in GPS put only a list of Airports and not ditance and heading.Andrew

Share this post


Link to post
Share on other sites

Hi,May be this one gives you what you want.Edit text etc. yourself.Add all the GPS macro stuff etc. and start scrapping to see what you don't need.@BlinkerCode(@g:listScroll)%((@c:NearestAirportItemsNumber) s2 0 !=)%{if}%(0 sp1)%{loop}%(l1 (>@c:NearestAirportCurrentLine))%((@g:listCurrent) l1 == (@g:listItems) 1 == and)%{if}{blnk}%{end}%((@c:NearestAirportCurrentIdent))%!s!{nr}n{lsp=14}%(l1 ++ s1 l2 < d)%{if}n%{end}%{next}%{end}Hope it helps,Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites

Probably you need only this one, a list of the 10 closest airports, distance 200 Nm:C:fs9gpsC:fs9gps(A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 10 (>@c:NearestAirportMaximumItems) 200 (>@c:NearestAirportMaximumDistance, NMiles) %((@c:NearestAirportItemsNumber) s2 0 !=)%{if}%(0 sp1)%{loop}%(l1 (>@c:NearestAirportCurrentLine))%((@c:NearestAirportCurrentIdent))%!s!%(l1 ++ s1 l2 < d)%{if}n%{end}%{next}%{end}Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites

Hi Jan,This has puzzled me for quite some time now, but I never dared to ask :-)What the ... does "Beatus Ille Procul Negotiis" mean ??Cheers, Rob

Share this post


Link to post
Share on other sites

Rob,Dat zijn de begin regels van het bekende gedicht van Horatius over zijn lof op het "leven op het platte land"Letterlijk vertaald:"Gelukkig is hij, die zich ver bevindt van de staatszaken..."En zo voel ik me in de "Fryske Walden"!Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest Gordius

That was quick. I have been looking into it for a while and obviously got nowhere! I will try the code you posted and let you know what happens.Andrew

Share this post


Link to post
Share on other sites
Guest Gordius

Thanks Jan I now have the beginnings of the gauge. Even better I almost understand the code. One thing I did not know about is the use of macros which fascinates me so now of course I am busy having a good read of the gps xml code. As a newbie to gauge creation you have been a great help. It would be nice to know some more about the macros and the info that can be extracted from them so I have a feeling I could be reading for some time ;-)Andrew

Share this post


Link to post
Share on other sites
Guest Desert Jockey

Hi AndrewAny progress on your gauge? I've been trying to do the same for awhilewith no luck. I made the following : (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 10 (>@c:NearestAirportMaximumItems) 100 (>@c:NearestAirportMaximumDistance, NMiles) %((@c:NearestAirportItemsNumber) s2 0 !=) %{if} %(0 sp1) %{loop} %(l1 (>@c:NearestAirportCurrentLine)) %((@c:NearestAirportCurrentIdent))%!s!{nr}t %(l1 ++ s1 l2 < d) %{if}n%{end} %{next} %{end} Desert Jockey

Share this post


Link to post
Share on other sites

You need to include the macros from the Update section of the gps code.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest Desert Jockey

Hi Bill,Thanks for suggestion, I've done the following:C:fs9gpsC:fs9gps (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 10 (>@c:NearestAirportMaximumItems) 100 (>@c:NearestAirportMaximumDistance, NMiles) %((@c:NearestAirportItemsNumber) s2 0 !=) %{if} %(0 sp1) %{loop} %%(l1 (>@c:NearestAirportCurrentLine)) %((@c:NearestAirportCurrentIdent))%!s!{nr}n{lsp=14} %(l1 ++ s1 l2 < d) %{if}n%{end} %{next} %{end} However, for some reason I get an output of only 0/1, am I still missing a code??Desert Jockey

Share this post


Link to post
Share on other sites

Hi,Tested your code and it needed a small correction:1. Watch the spaces(?)2. one % to much3. in %(l1 ++ s1 l2 < d) you need ampersad lt;otherwise it works good but you will need some scroll function %((@c:NearestAirportItemsNumber) s2 0 !=)%{if}%(0 sp1)%{loop}%(l1 (>@c:NearestAirportCurrentLine)) %((@c:NearestAirportCurrentIdent))%!s!{nr}n{lsp=14} %(l1 ++ s1 l2 < d)%{if}n%{end}%{next}%{end} Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest Desert Jockey

Thanks Jan, I'm trying it now seems good so far.

Share this post


Link to post
Share on other sites
Guest Desert Jockey

Hi everyone,,I've finally been able to make work. The file is available in the library ( Talal's Map12.zip ).The gauge will show very useful info during flights the most important is nearest airports and ILS frequencies. I hope simmers like it and facilitate their piloting experience.Desert Jockey

Share this post


Link to post
Share on other sites
Guest Gordius

Desert Jockey,First of all sorry for not answering the question "did I ever finish the gauge?" I am afraid to say I haven't visited this forum for a while. The answer is kind of. What I needed was a list of ten closest towns/cities and not the nearest airport name within 40nm. The best I could do was the ten closest ICAO codes which is better than nothing :-)I think that the reason I could not get all the way was not knowing the contents of the fs9gps macro, list of variables (the airport code is all I can manage).The reason for trying to build the gauge is that I organise flights which are to be flown under conditions of the 1920s and 1930s which for me/us is roughly speaking map (paper and not the FS map) and compass. FS9 seems to offer two choices. Offline ATC can give a list of the closest airports but of course the airport list it gives is airport names and not the names of the towns/cities which as you know is not always the same thing. Online only the GPS can give the nearest airports but it also gives hdg, direction etc to those airports and the range is not restricted to 40nm. I should also say that use of the GPS is not allowed (simply didn't exist in the 20s/30s).So, those of us that use the gauge now have the ten closest airport codes within 40nm and a spreadsheet to search for the code and there get closest town (yes it can be a pain :-) )I should say that I am a "panel guy" and not a "gauge guy" hence my ignorance. Other than this gauge the closest I have come is editing a couple to meet my personal needs (eg replacing the bmp with one that suits my panel or changing a default gauge which did show direction to nav1 and adf1 to point to adf1 and adf2). Only ever for my own use and not redistribution!Now would perhaps be a good time to thank all of you gauge gurus for the gauges you share. I can happily turn out a decent panel and edit a gauge but the prospect of having to write/compile the gauges from scratch would be a nightmare!If the description with regard to navigation using ten nearest towns or cities seems odd check my site and/or the Roaring Thirties Forum here at AVSIM. The gauge by the way is on the download page of my site but unless it is ever finished it won't be uploaded any where else.Andrew BrownROARING THIRTIEShttp://www.gordiusfs.pwp.blueyonder.co.uk/

Share this post


Link to post
Share on other sites
Guest Gordius

The last posting was from the office. Here is the simple code I have used .... C:fs9gpsC:fs9gps(A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 10 (>@c:NearestAirportMaximumItems) 200 (>@c:NearestAirportMaximumDistance, NMiles)%((@c:NearestAirportItemsNumber) s2 0 !=) %{if} %(0 sp1) %{loop} %(l1 (>@c:NearestAirportCurrentLine)) %((@c:NearestAirportCurrentIdent))%!s! %(l1 ++ s1 l2 d) %{if}n%{end} %{next} %{end}If anyone wants to chip in with whatever I should include for the name of the Town or City (ICAO + Airport + City would do) please do. Otherwise as you asked I thought I would post it.Andrew BrownROARING THIRTIEShttp://www.gordiusfs.pwp.blueyonder.co.uk/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...