Sign in to follow this  
Guest rkruijer

AIRPORT ID

Recommended Posts

I would like to know the airport ID from the airport I am on.Is that possible?Found this in the panel sdk. Would that suit me? GPS APPROACH AIRPORT ID I tried to make it visible in XML%ICAO %((A:GPS APPROACH AIRPORT ID,string))%!s!Does not work. Any sugestions would be welcome. Roelof

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

The parameter is listed in the SDK as:GPS APPROACH AIRPORT IDI've never used it, so have no clue why it won't work for you...I query the fs9gps.dll directly to obtain that information, using the methods shown in the default G500 GPS.

Share this post


Link to post
Share on other sites

Hi,Never used it, but you can try (@c:nearestairport) or something like that from the gps.Because the nearest airport is most probably the airport you are on.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

>>I query the fs9gps.dll directly to obtain that information,>using the methods shown in the default G500 GPS.> This gps_500.xml is a bit difficult to disect. :( (C:fs9gps:WaypointAirportIdent) slen 0 == if{ 0 (>@c:NearestAirportCurrentLine) (@c:NearestAirportCurrentICAO) (>@c:WaypointAirportICAO) } does @ mean it is a gps var?I suppose slen = length of string(C:fs9gps:WaypointAirportIdent) and the first part is that dllBtw Bill, did you ever make something visable from this fs9gps.dllIf you did can you show me a peace of code? That would be very welcome and possibly save me a lot of time.Roelof

Share this post


Link to post
Share on other sites

>>>>I query the fs9gps.dll directly to obtain that information,>>using the methods shown in the default G500 GPS.>> >>This gps_500.xml is a bit difficult to disect. :( >Btw Bill, did you ever make something visable from this>fs9gps.dll>>If you did can you show me a peace of code? That would be very>welcome and possibly save me a lot of time.Ya think? ;)The @ character means it is calling a macro; a section of code that is substituted for the @xxx macro call.Yes, but there's a perfect example already here, posted yesterday!http://forums.avsim.net/dcboard.php?az=sho..._id=27226&page=Just follow the example code there, and substitute your own inquiry...

Share this post


Link to post
Share on other sites

>Ya think? ;)>>The @ character means it is calling a macro; a section of code>that is substituted for the @xxx macro call.Yes I thought that but there are so many that I had the idea it ment something else. I should have known.>Just follow the example code there, and substitute your own>inquiry...That give's me a good lead. I'm as happy as pig in #### now! The only thing is......Where does this fs9gps.dll hang out?I searched C: and my FS2004 folder which is on F:I do have a fs9gps.cab but that's all :-( Roelof

Share this post


Link to post
Share on other sites

Hi,Try:C:fs9gpsC:fs9gps(A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 1 (>@c:NearestAirportMaximumItems) 2 (>@c:NearestAirportMaximumDistance, NMiles)ICAO %((@c:NearestAirportCurrentIdent))%!s!Tested, works for me.Hope it helps,Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

This is really great Jan, How can I ever show my gratitude,Still searching for this fs9gps.dll though. Do you have any idea where it resides?Roelof

Share this post


Link to post
Share on other sites

Hi,It doesn't exist afaik.Ment is the gps.dll in the modules folder.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

>>>%ICAO %((@c:NearestAirportCurrentIdent))%!s!>>>Tested, works for me.>I tested it and after while it shows ICAO PXV2. Then there are also instances that it shows nothing.I am on a runway at EHAM so you expect ICAO EHAM.I will try to go for this (@c:NearestAirportCurrentICAO) (>@c:WaypointAirportICAO) tomorrow.Roelof

Share this post


Link to post
Share on other sites

Hi,You can change in the update section:2 (More miles!!!!!! ) (>@c:NearestAirportMaximumDistance, NMiles)Then you will see an airport from farther away.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

>>You can change in the update section:>>2 (More miles!!!!!! ) (>@c:NearestAirportMaximumDistance,>NMiles)>>Then you will see an airport from farther away.Thanks Jan but I am actually interested in the airport I am on. Hopefully that is considered the nearest. :-) Roelof

Share this post


Link to post
Share on other sites

>Then you will see an airport from farther away.>>Jan>>"Beatus ille qui procul negotiis..."I've got it working. It had to do with EHAM itself. When I looked in the GPS I saw EHAM and PXV2 printed one over the other. Pressing the NRST button shows two airports in the same place.I selected another airport and it worked nicely.Thanks for the code.

Share this post


Link to post
Share on other sites

Hello Jan,Having used the gauge for a few days I sometimes have the problem that it does not give me the ID while the situation is the same.I am not airborne or something but always on the same runway take off position.The gauge is ok because it really works but there seems to be something that it is bothered by very frequently.Is this gps_500.xml running all the time in the background or only when you use it?The Lat en Lon coordinates are always displayed. Is different from ?I suppose this code would be okC:fs9gpsC:fs9gps(A:GPS POSITION LAT, Radians)(>@c:NearestAirportCurrentLatitude, Radians) (A:GPS POSITION LON, Radians)(>@c:NearestAirportCurrentLongitude, Radians) 1 (>@c:NearestAirportMaximumItems)2 (>@c:NearestAirportMaximumDistance, NMiles) %Ident %((@c:NearestAirportCurrentIdent, string))%!4s! %ICAO %((@c:NearestAirportCurrentICAO, string))%!5s! %LAT %((A:GPS POSITION LAT, Radians) rddg dnor)%!3.5f!%LON %((A:GPS POSITION LON, Radians) rddg dnor)%!3.5f!

Share this post


Link to post
Share on other sites

Hi,Use just s for a string.With formattedtext you can do a lot more, but it remains text..For Lat/Lon i use:%((A:PLANE LATITUDE,degrees) d 0 >= )%{if}%N%{else}%S%{end} %( abs d flr )%!02d!

Share this post


Link to post
Share on other sites

These are looking good Jan, I'll try them.(@c:NearestAirportCurrentIdent, string)gives me the airport IDI tried to put that in an (>L:AirportID,string) but that does not work.I expect that there are 4 numbers on the stak, Ascii values. 69 72 65 77, or HEX values 45 48 41 4DThe program needs to be able to compare this with "EHAM"How do you go about that? Is there anything known on string manipulation and or comparrison in XML like left-, right-, substring(), chr() etc.?There's more to it than I thought. :-( Roelof

Share this post


Link to post
Share on other sites

Hi,I know this one from another thread (Rob Barendregt):(A:GPS WP NEXT ID,string) 'EGSS' scmp !if{ }Returns "0" when strings are equal, "1"when not equal.So, try:(@c:NearestAirportCurrentIdent,string) 'EHAM' scmp ! if{ }You cannot save the string in a L:Var.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Thanks Jan. I had completely forgotten about the A:varsLast time GPS APPROACH AIRPORT ID did not work but when I get that working I don't have to go through the motion of this gps.dll There is quite a list of gps a:vars >Hi,>>I know this one from another thread (Rob Barendregt):>>(A:GPS WP NEXT ID,string) 'EGSS' scmp !>if{ }>>Returns "0" when strings are equal, "1">when not equal.>>So, try:>>(@c:NearestAirportCurrentIdent,string) >'EHAM' scmp ! if{ }>>You cannot save the string in a L:Var.>>>Jan

Share this post


Link to post
Share on other sites

Apologies for digging up an old thread! I'm working on a similar gauge to the above one, and I also have the problem of the IDs only showing up when they feel like it. The long/lat always shows.Sometimes loading another aircraft and reloading the one with the gauge helps, sometimes the ID just won't display at all. But then occasionally it pops up just fine.Does anyone know why this is happening?

Share this post


Link to post
Share on other sites

Based on the name of the variable I'd hazard the guess that it only has a value when you have the ability to load an approach into the GPS.

Share this post


Link to post
Share on other sites

Just to clarify, I'm using this code to test:---------------------------------------------C:fs9gpsC:fs9gps(A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians)(A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians)1 (>@c:NearestAirportMaximumItems)2 (>@c:NearestAirportMaximumDistance, NMiles) %Ident %((@c:NearestAirportCurrentIdent,string))%!s! %ICAO %((@c:NearestAirportCurrentICAO,string))%!s! %LAT %((A:GPS POSITION LAT, Radians) rddgdnor)%!3.5f!%LON %((A:GPS POSITION LON, Radians) rddgdnor)%!3.5f!-----------------------------------------------The output I get is: Ident IcaoLAT 47.43149LON 237.69200Very occasionally I'll get: Ident KSEA Icao K SELAT 47.43149LON 237.69200or something similar. Is there something that needs to be started/initialized other than what is in the xml?EDIT: After loading about 10 other aircraft and then reloading the aircraft with the gauge, it suddenly shows: Ident KSEA Icao A KELAT 47.43149LON 237.69200

Share this post


Link to post
Share on other sites

Hi,The whole set of "Nearest" properties/variables (ie NearestAirports, NearestVor, etc) is processed asyncronically through gps.dll, just to avoid freezing the sim with long searchs. Therefore their results are shown only after the retrieve is completed. Until then no value is displayed.As an example, the property/variable "NearestAirportItemsNumber,number" can be tested for a value of greater than 0 to find the moment when this info is available.Tom

Share this post


Link to post
Share on other sites

Tom, thanks so much. This all makes much more sense now! I appreciate the help.

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