View Full Version : types of waypoints
Thomas Buck
13 Dec 2006, 04:11
Hello,
Is there a programming interface to access to the
types of waypoints of a loaded flightplan? (FS9/FSX)
(during run-time of FS)
Or I have to dissassamble the concerning bgl-file
via bgl-analyzer?
I would also detect data like traffic-positions/numbers
and cloud-positions for programming a radar-instrument.
What is the way?
Thank you
scruffyduck
13 Dec 2006, 06:42
OK this is probably my lack of understanding. Are you asking how to access the waypoints in a flight plan from outside FS? or are you asking how to find the waypoints in a bgl file? or both.
As far as I know the flightplan for FS is a text file (if I recall correctly) so should be easy to decode. For waypoints inside a bgl you would need to use a decompiler like NewBglAnalyze for FS9 or BglAnalyzeX for FSX.
Thomas Buck
13 Dec 2006, 07:35
Thank you. Do you know the name/path of textfile of flightplan?
Do anybody know somethink about interfaces for air-traffic
data (call sign/position) and clouds-locating data? I gas that this data are random generated and only accessably during run-time?
Thomas Buck
13 Dec 2006, 07:50
OK, I have already detect the flightplan-file.
But in wich bgl-Files I can find waypoints?
scruffyduck
13 Dec 2006, 12:24
Waypoints can be all over the place :) They certainly exist in the AP files which contain airport data. They also appear in AT files which contain waypoint and boundary data.
For FSX (not FS9), flightplans are saved as XML files (with a .PLN file extension). These XML files contain the type of each waypoint;
<ATCWaypoint id="JOXUS">
<ATCWaypointType>Intersection</ATCWaypointType>
<WorldPosition> ... </WordPosition>
....
And so on with VORs, NDB, user-defined waypoints etc.
I don't know if there is a canonical way to guess the current flight plan file. Maybe a simulation variable. What you could do is read the the current flight .FLT file, which is located in Application Data/Microsoft/FSX
Be aware that the name of this file is localised. In the French Deluxe edition it is "Vol précédent.FLT" :eek:
This file contains a section [GPS_Engine] with a Filename= entry giving the path of the current .PLN file.
DocMoriarty
24 Dec 2006, 04:16
You can subscribe to SimConnect events "FlightPlanActivated" and "FlightPlanDeactived". The first one gives you also the filename of the flightplan file. You can also read out the various gps variables via SimConnect. It goes so far that you can even set messages into the gps message window from what i read.
From what i can tell now (since i wanted to know that for my addon) there is no way to determine whether the player is actually flying IFR rules. You don't get FlightPlanDeactivated events until a new flightplan or a new flight is loaded. Actually when the player reaches the destination, cancels the flightplan or gets kicked from ATC should IMO produce a FlightPlanDeactivated event too. Also FlightPlanActivated should only get sent when the player asks ATC for initial clearance, not when the plan is loaded.
You can also read out the various gps variables via SimConnect. It goes so far that you can even set messages into the gps message window from what i read.
Most GPS variables are only accessible through the panel system, and thus only from inside FS modules. The subset of GPS variables readable from simconnect does not seem to include the name of the flightplan or message functions (or maybe the Simulation Variables document is incomplete, which is not impossible ;) )
A practical way to share all variables with remote simconnect clients is to make a bridge module that retrieve gps variables with execute_calculator_code (or better, using GetPropertyValue() from the GPS IGaugeCCallback) and exposes them through simconnect client data areas.
vBulletin® v3.8.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.