FSXA Toggle between GPS waypoint coordinates

#1
I want to create a gauge that displays and assigns the coordinates of the currently selected waypoint to GeoCalc.
Since my M/B died and I cannot test the code, I thought I should ask.

I have a knob that uses this when you right click it:
(C:fs9gps:FlightPlanWaypointIndex, number) ++ (>C:fs9gps:FlightPlanWaypointIndex, number)

From reading the SDK I suppose that this will read the next waypoint in my FP (from WP1 to WP2, etc). Then, I can use the following variables to write into GeoCalc. Is that right, or do I need to somehow "select" the waypoint other than change the index number?

VARIABLE EX GET SET

FlightPlanWaypointIndex Number X X X
FlightPlanWaypointLatitude Degrees X
FlightPlanWaypointLongitude Degrees X
 
#2
I have a knob that uses this when you right click it:
(C:fs9gps:FlightPlanWaypointIndex, number) ++ (>C:fs9gps:FlightPlanWaypointIndex, number)

From reading the SDK I suppose that this will read the next waypoint in my FP (from WP1 to WP2, etc). Then, I can use the following variables to write into GeoCalc. Is that right, or do I need to somehow "select" the waypoint other than change the index number?
That will work. Note also that depending upon what you want GeoCalc to calculate, there may be gps variables that provide the answer a little more directly.

Bob
 
#3
I use the following variables.

HTML:
(A:GPS WP NEXT LAT, degrees)
(A:GPS WP NEXT LON, degrees)
That gives the Lat/Long of the current active waypoint of your flight plan , and no index number is required.

However your method is much more flexible as you can interrogate any waypoint in the flight plan without
having to make it the active waypoint.
In other words you could be flying the leg leading to active waypoint #3 , at the same time with your switch/knob you could be
doing a GeoCalc way ahead at for example waypoint #17 , that would be much more flexible , and in some
circumstances much more desirable .

Cheers
Karol
 
Last edited:
#4
Thanks for the prompt replies!
What I had in mind was not following the active waypoint, but instead updating my FD and calculating the track to any waypoint the pilot selects.
 
Last edited:
#5
Thanks for the prompt replies!
What I had in mind was not following the active waypoint, but instead updating my FD and calculating the track to any waypoint the pilot selects.
We all agree! You have a workable approach to indexing and are correct in the use of GeoCalc to calculate bearing from aircraft to any waypoint in the flight plan.

Have fun with the gps.

Bob
 
Top