Jump to content
Sign in to follow this  
ahuimanu

What Country is the Plane in?

Recommended Posts

I currently use a rather awkward system to determine roughly what part of the world the plane is located in.However, I'd like to adopt a cleaner and precise method to determine which country the aircraft is.So I'm looking at this GPS variable to get the job done: FacilityRegionTrouble is, it doesn't seem to return anything in my C gauge.Anyone ever get the same thing to work?This is it for the code:PCSTRINGZ country;execute_calculator_code("(C:fs9gps:FacilityRegion, string)", NULL, NULL, &country);Cheers,Bryan

Share this post


Link to post
Share on other sites

The same request made in XML returns NULL as well.First, you have to tell the fs9gps.dll what your current ICAO code is, then it will return the FacilityRegion information.However, the FacilityRegion won't be much help, since it's usually a single letter or two, not the name of the country... Even then, the return is fairly meaningless. For example, whilst sitting at the ramp in Sion, Switzerland, the GPS returns a "Region Code" of "LS..."However, the ISO Region Code* of "LS" is the country of Lesotho, a considerable few nautical miles from Switzerland! :)* http://www.cue-dih.co.uk/aerospace/aeropdf...untry_codes.pdf


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

Bryan,I spent a few delightful -albeit ultimately fruitless- hours this afternoon trying various approaches using a simple XML gauge (because it's a darn sight quicker than using a C gauge!)...Using the list of GPS Variables available (not all of which actually work, BTW) that Susan Ashlock provided a couple of years ago on her blog and to which I promptly "borrowed" for a Wiki entry:http://forums.flightsim.com/fswiki/index.p...9_GPS_VariablesI checked out trying to obtain a "Country" return... nada, zip, zilch. :(In any event, as I said previously you first have to tell the fs9gps.dll where you currently are before it will return any information. Here is the XML gauge script:C:fs9gpsC:fs9gps (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 1 (>@c:NearestAirportMaximumItems) 200 (>@c:NearestAirportMaximumDistance, NMiles) 0 (>@c:NearestAirportCurrentLine) (@c:NearestAirportCurrentIcao) (>@c:FacilityIcao) %( (@c:NearestAirportItemsNumber, Number) 1 >= )%{if}%((@c:FacilityName) uc)%!s!%{else}Loading%{end}


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

The little cracks and fissures in the SDK are always interesting as they are unearthed.


Jeff Bea

I am an avid globetrotter with my trusty Lufthansa B777F, Polar Air Cargo B744F, and Atlas Air B748F.

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...