![]() |
|
|||||||
| Register | Wiki | Downloads | FAQ | Members List | Social Groups | Calendar | Search | Today's Posts | Mark Forums Read |
| SimConnect Use this forum for all your SimConnect related discussions |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
METAR Format Decoder
This question pops up with regularity on various sub-fora here and, as far as I can see, has never received a satisfactory response. Since hope springs eternal, I thought I'd give it new life by asking it again: Does anyone have an FSX METAR decoder class/function that they are willing to share? (Notice the emphasis on FSX METAR; standard FAA METARs - while not trivial - are simpler.)
I am building one right now and it causes me to want to pull all my hair out in frustration. Not only is FSX METAR a METAR - i.e. something inherently hard to parse - but it features all kinds of extensions and optional parts that make it even harder, without employing some Artificial Intelligence, it seems. Why does it have to be so complicated? Anyway, I would appreciate any and all help in finding/developing a viable FSX METAR parser/decoder. I will publish the results for all to see, if I ever get to the point of being able to fully parse and interpret an FSX-generated METAR. AW |
|
#2
|
|||
|
|||
|
Quote:
![]() I friend, who is a METAR Decoder Software GURU, was starting to work on it, and was unfortunally taken ill, so the project is on hold. Yes, it's a Challenge ... ![]() Geoff |
|
#3
|
|||
|
|||
|
To decode FSX real weather, I'm using the following function made be me (so sorry for the ugly code and for the french variables & comments).
There are still many cases I'm not taking in account, so it will be great to develop a class or function very reliable and complete DecodeMeteo.cs |
|
#4
|
|||
|
|||
|
Quote:
As it were, I ended up writing a 650+ line class, and I am not even done yet.Quote:
Meanwhile, I discovered that FSX lies about the weather. It reports clear skies when there are scattered or even broken clouds visible... AW |
|
#5
|
|||
|
|||
|
So here is my take on the task of parsing an FSX METAR. You can download the result of my attempts at http://navsim.org/files/ParseMetar.0.1.0.zip. It's a Pascal (Delphi 7) project, containing a simple command-line harness, and the parser class (TMetarParser).
The parser is a Finite State Machine with 15 states currently. I realize that it is still inadequate in many ways, as it is unfinished, but it works most of the time. I will be very interested in seeing examples of FSX-generated METARs that are not parsed correctly.-AW |
|
#6
|
||||
|
||||
|
I'm interested in a Metar parser for C++. I can get the metar string with simConnect but I am completely stuck. Started to look at regex, but it's horrible to implement in C++. So I'd be grateful if someone could share their solution or at least give some clues how to proceed.
Cheers, Vitus
__________________
|
|
#7
|
||||
|
||||
|
Quote:
Doug |
|
#8
|
||||
|
||||
|
Quote:
coooooool! I'd love to read about your experience!
__________________
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| .ASM file format results incorrect vs. require format | johnnyboy | General | 1 | 11 Jan 2011 20:12 |
| Open .air format | Simon853 | FSX SDK feedback | 0 | 22 Jan 2008 18:23 |
| Sending Metar to FSX | pdgnr | SimConnect | 3 | 04 Dec 2006 04:53 |
| Sending Metar to FSX | pdgnr | SimConnect | 0 | 02 Dec 2006 07:34 |