• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA Missing som NAV data parsing BGL

Messages
9
Country
norway
I'm creating a BGL parser so the users of my app can get a correct copy of their information (including add-on scenery/edits/etc). I've got airports, ils/vor and the name list up and running, but I'm missing a lot of ils/vors.

An example is 46130.bgl which contains information for EIDW. I get the ILS for rwy 16, but not for rwy 10/28 (ICAOs: IDE/IDW). I only get 3 nav aids from the whole file. 'bglanalyze' manages to pull out those ILSes though so they have to be there somewhere. There's a section with ID: 0x0028 that I don't know what's for. Could they be hidden there?

Any hints would be very much appreciated.

Regards
carlsb3rg
 
Most Navaids are not in the airport Bgl files for the most part. They are in Bgl files starting with NV. I assume this is for FS9 or FSX? You might also like to run my Bgl2Xml GUI for these files and it will show you what is there.
 
Embarassing

Thanks for your reply!

I've just started doing this stuff and with all the bits and bytes and mixed terms in Orthmann's PDF (record, subrecord, section, etc), I had somehow missed the fact that you could have multiple airport/vorils records in each subsection. ;)

So everything WAS there (as I discovered with BglAnalyzeX and also your excellent Bgl2Xml), I was just getting the first record in each subsection.

I'm trying to create as generic a parser as possible. You might know what I mean having done all this before, but my methods are abstract up until the point that the actual record type is known. In other words, I started with:

parseairport(data + offset)
offset =+ fixedrecord
while (peek ahead = runway type) parserunway
while (peek ahead = another airport subrecord) parseanotherrunwaysubrecord

But now I've gotten it pretty well refactored to:

parsesection()
{
parsesubsection()
{
parserecord()
{
parsesubrecords()
}
}
}

and injecting the correct ISection/ISubsection/IRecord/ISubrecord implementations as they're needed. The code is getting sexy ;) The hard part is making sure you don't open/close/move filepointers more than necessary to avoid performance impact. I also have filtering so you can ignore sections that aren't needed.

Even though your parser is good, I want something that will run without converting to xml first on the users machine. My first app that will be using the library will be a multiplayer routeplanner, and after that I'll probably make a simple WPF-based ATC interface. The code is looking so fast that I'll probably re-parse all the files every time the app is loaded so it will catch new /modified data.

btw: I'm only doing FSX files.
 
Last edited:
Given the format of the files I imagine that all parsers are going to work to a similar process. How you implement it may be different of course. While you see an XML output from Bgl2Xml the actual decompiler generates an object graph of the file. Each object is then able to decompile itself and generate XML to re-create itself. The end product is what you see as the output. The same code is used in Airport Design Editor. I only have one parser for all my tools.
 
I'm obviously generating an object graph myself. So I would need your source code to get what I want ;)
 
The principle is simple. Everything derives from a base class. That base class has an Items property that is a list of the base class. So at the top of the tree is a SceneryFile class and its' children are all the elements of the file directly linked to it. Each of them then has children so you would get:

SceneryFile:
.....Airport
..........Runway
...............ILS
..........Parking

etc etc

But then I am sure you know all this.........
 
Back
Top