Sign in to follow this  
n4gix

GPS Mode (TERM, ENR, APR)

Recommended Posts

Is there a variable (or a set of variables) that tells me whether the GPS is opearating in Enroute, Terminal or Approach modes? For Term and Enr, I supposed I could simply look at the distance from the waypoint and conclude the mode from that, however, "App" mode is supposedly within 2NM from the FAF (at least in the real world), but how does one determine this distance arbitrarily in MSFS for any waypoint? Or is there simply a flag variable that tells me the mode?

Share this post


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

>>Is there a variable (or a set of variables) that tells me>whether the GPS is opearating in Enroute, Terminal or Approach>modes? For Term and Enr, I supposed I could simply look at>the distance from the waypoint and conclude the mode from>that, however, "App" mode is supposedly within 2NM from the>FAF (at least in the real world), but how does one determine>this distance arbitrarily in MSFS for any waypoint? Or is>there simply a flag variable that tells me the mode?Directly? No. The default GPS calculates it this way: (A:GPS IS ACTIVE WAY POINT, bool) if{ (A:GPS IS APPROACH ACTIVE, bool) if{ 3 } els{ (A:GPS FLIGHT PLAN WP COUNT, number) (A:GPS FLIGHT PLAN WP INDEX, number) ++ == (A:GPS WP DISTANCE, nmiles) s0 30 ;)Although these variables are "XML" they are easily fetched in a C gauge using execute_calculator_code:FLOAT64 adf1_frequency = 0;execute_calculator_code("(A:ADF ACTIVE FREQUENCY:1, MHz)",&adf1_frequency,NULL,NULL);adf1_frequency = adf1_frequency*1000;This is the fs9gauges.h prototype:BOOL (FSAPI *execute_calculator_code) (PCSTRINGZ code, FLOAT64* fvalue, SINT32* ivalue, PCSTRINGZ* svalue);Note that only one of the three parameters is used, based on the data type of the XML variable: (float), (integer) or (string)... ;)All of the XML GPS variables are listed in the Parameters.doc of the SDK.

Share this post


Link to post
Share on other sites

>>Thanks! Geeez, it's so simple now that I see it. Feel like>I asked a stupid question lol.Well, thanks go to Arne Bartels, and several others who've been absent for a very long time, because none of this was documented at all!They found it through trial and error (heavy emphasis on the error!), and good guess work... ;)In fact, long before the SDKs were released, they had already sussed out all the XML variables and Arne had even written a tutorial on XML gauge coding!I must add that one of the neat features of using the XML variables vice the native C variables is that you can specify what units you want returned, rather than having to jump through fify-five hoops to convert the return to something usable... ;)

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