• 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.

Developing a "VA Pirep"

Messages
9
Country
italy
Hi all,
This is my first post to this wonderful forum. Thank you for your hospitality.
Now, that's my problem (sorry if the solution is already present in this forum... but I've spent two days searching in... :o ).
I'm developing a .Net Framework 2.0 Application to be used as off-line Pirep Generator. The scope is to track user flight (logging most relevant flight moments - basically, takeoff/route/landing) and then post it to the VA site (all the work is absolutely freeware; the VA is a new one in Italy and will be on line soon. At the moment the forum is reachable at http://utilflightsim.altervista.org/phpBB2/index.php).
Well. Using FSUIPC.dll with the related new assembly FSUIPCClient.dll, I'm able to read all the FS variables (2004 only at the moment, next will be FSX :) ); all, but airport currently used by the user.
After few days of frenetic web/forums search, I've discovered - thanks to Pete Dowson forum - why this was not possible reading FSUIPC offsets. The only way is to retrieve ATIS frequency and compare it with the content of airports bgls as defined in FS9 SCENERY.CFG :mad:
Using a Pete Dowson utility called "MakeRunways" (lot of you surely know it ;) ) I fixed the problem reading one of its output called airpoirts.fsm.
Finally, the question: is there any assembly or other programmatically way to accomplish the same work, that is to retrieve airports and related ATIS frequencies? Any suggestion? Any other way that I've not considered yet?

Several FS addons (freeware or payware) are able to build a database handling airports facilities. Maybe all of them have implemented a BGL decompiler?? Is this the only way??

Thank you very much to all
 
As far as I know the only way is to read the Bgl files for the airports and that involves some sort of decoding or decompiling of the information Each airport record contains the comms data associated with it.

As well as the stock airports you would need to consider addon airports as well since developers enhancing airports or creating missing airports may add or modify the frequencies.

There may well be third party databases that store airport information. I am sure that real world flight planners won't be using MSFS data :) But then you probably want to match what is coming from the users sim.
 
Thank you very much for your answer :)
I'm quite sure that a bgl file decompiling is a very hard way to walk on. But I'm interested to know more about it. Have you some links or documents to put me on this way? I've searched all around the most interesting sites but nothing seems to be published.

Thanks in advance :)
 
Well there is a document created by Winfried Orthman that describes the Bgl format that you need. I seem to recall that it is attached to a post here. Maybe you can search for his name. That cretainly contains what you need to extract com data for airports. I think the FS9 version of his decompiler (NewBglAnalyze) contains the FS9 format in a pdf file.

Alternatively, if you did not want to write a decompiler there are a couple of available that convert the binary format to XML. NewBglAnalyze (FS9) or BglAnalyzeX (FSX) by Winfried or Bgl2Xml (FS9 and FSX) which I wrote.
 
Alternatively, if you did not want to write a decompiler there are a couple of available that convert the binary format to XML.

I really don't :D Too much time expansive, I guess...
I'll right now start the search in this forum.

Thanks very much. If you want, I'll post to you the first release of my .Net dll Assembly that handles the project I was talking earlier.
I'd really appreciate your opinion :)

Have good vacations!;)
 
Well well well... Now I'm able to read new BGL format.... At least: I'm able to extract all airports from it :)
Thank you, Jon. Your help was precious.

But - ther is always a "but" :mad: - the old format BGL files are currently unreadable for me. Does anyone know an explanation document(s) about the old style format?

Thanks in advance.
 
Hi... here I am again :)
In my precedent post I said that I'm able to read all airports... Now I have to correct this: not all airports... the problem is that I reach the AirportData Section and then, I detect just 1 sub section that obviously contains just one airport.
My parser doesn't get any error, all seems to go perfectly... all except the final airports total... Now I'm doing some hex dumping on a file that surely contains a missed airport (LICC) to directly see its data...
There is a question that I would do: what is the section "AdditionalAirportsData"? What does it contain? I can't see any relative record format in Winfried's documentation...
Maybe only the first airport in the file is defined in AirportData Section and then, all the others are in AddtionalAirportData Section? But, if so, the record format I think it's not shared by the two sections; if I try to apply it to the AdditionalAirportData one, I always get a parse error...
Can you help me? Can you explain what this section contains...

Actually, this is the developing state of my VA Pirep Application:
1. able to extract part of the airports present in BGLs :mad:
2. able to calculate the distance between two geographical points (any formats: decimal or degree) using the Thaddeus Vincenty formula
3. able to determining the closest airport, relative to the current aircraft position

Next to do:
1. to fix the airport data extraction :mad:
2. to listen the simulator to prohibited settings (pause for more of xx minutes, slew mode, accelerated time and so on..)
3. to manage not sended pirep (saved cryptated on the user hd)
4. to send pirep to the VA site

Please Scruffyduck and Arno (and obviously everyone that can): can you help me in some way? If it's necessary I should post some files...

Thank you very much for your attention.
 
There is a question that I would do: what is the section "AdditionalAirportsData"? What does it contain? I can't see any relative record format in Winfried's documentation...

It contains some information about services and runway data that is somewhat unreliable. My decompiler (SDE) ignores this record with no ill effects that I have ever come across
 
Thank you, Jon...:)
Your help was precious: infact, I did misunderstand the relation between SectionPointers and SectionHeaders. In BGL section header chapter Winfried wrote:
The section pointer records in the header point to the section header which consist of 1..n subsection pointer records. The number of subsection pointer records present is given in the section pointer record.
Each subsection pointer record is 16 bytes long...

I thought that the relation between the Section Headers and Subsections Headers was 1 to many... So I checked just the first airport set of the BGL :mad:....

Well, now I'm able to catch the closest airport relative to the current aircraft position and their distance. So, I'm able to know if the flight was correctly started and ended.
The main goal is accomplished :D

Will follow the rest...:cool:
 
Hi again...
This isn' t a really value add... but can be usefull in the future :)
Well, the NameList Record should specify informations about the state/region/city in which the airport is located. Is this correct?
If so, I don't understand to which part of the BGL the relative offsets point... I'll try to better explain my doubt: if I'd like to retrieve the city name of a specified ICAO ident, I should move the file reader to seek:
Code:
([start of record offset] + [city list offset])
then I expect to find a string array (??) in which to search for the relative ICAOIdent city name index... but... which is the record structure? I must expect a string variable of fixed lenght? Where is it defined?:confused::confused:
 
You get information about the number of city names at byte 12 decimal and the offset to the city list at byte 30 decimal.

The city data is just a sequence of bytes and you need to extract the names from that sequence of bytes. I can't remember the detail without looking at the code in SDE (which is written in C#) but each name is terminated with a zero byte.

If you can read C or C++ then the code for bglxml is in the public domain (with version 1.8 I think). although this is for FS9 the namelist format has not changed to FSX.
 
... oh, well... so I have to to read every single byte until 0 (to obtain a name) in a loop from 1 to NumberOfCityNames; all this, starting to read from CityNamesList offset....
The same for all others parts except ICAO list :)

Thank you Jon... you and fsdeveloper.com certainly will be mentioned in my application "credits" box.. :D:D
 
After some coding work, now my PIREP is quite to be deployed... It works fine and has accomplished the main goal: to log an off line flight.
Our VA accepts also on line flights, executed on its own servers. It Could be quite perfect :D if I can detect the multiplayer session access, in order to certify that the flight was made using the declared mode.

I don't know how to develope that and no standard FSUIPC way seems to me useful...

Well, it doesn't seem so important and the reason is that quite all pilots are honest simpilots after all :rolleyes:. But now I'm a bit curious and I'd like to know if some others have found some work around...

Thank you very much for your attention.
 
Back
Top