1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

types of waypoints

Discussion in 'Tools programming' started by Thomas Buck, 13/12/06.

  1. Thomas Buck

    Thomas Buck

    Joined:
    13/12/06
    Messages:
    3
    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
  2. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    23,306
    Country:
    wales
    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.
  3. Thomas Buck

    Thomas Buck

    Joined:
    13/12/06
    Messages:
    3
    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?
  4. Thomas Buck

    Thomas Buck

    Joined:
    13/12/06
    Messages:
    3
    OK, I have already detect the flightplan-file.
    But in wich bgl-Files I can find waypoints?
  5. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    23,306
    Country:
    wales
    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.
  6. lc0277

    lc0277

    Joined:
    25/9/06
    Messages:
    156
    Country:
    france
    For FSX (not FS9), flightplans are saved as XML files (with a .PLN file extension). These XML files contain the type of each waypoint;
    Code:
    <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.
  7. DocMoriarty

    DocMoriarty

    Joined:
    20/12/06
    Messages:
    64
    Country:
    germany
    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.
  8. lc0277

    lc0277

    Joined:
    25/9/06
    Messages:
    156
    Country:
    france
    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.

Share This Page