Jump to content

SMP still crashes with metar parsing


Jose Almeida
 Share

Recommended Posts

To follow up, the culprit was whoever's reporting the weather at MMMT (in Veracruz, Mexico):

MMMT 011510Z 00000KT 5SM VCFG FEW020 22/19 A2986 RMK 8/100 FG LYR SFC

The code we use from NOAA to parse METAR data can't handle the case of SFC being the last thing in the METAR report. It doesn't make sense; SFC should be followed by VIS and a visibility distance (SFC VIS indicates surface visibility)

I've coded up a fix so RWC will just ignore this case instead of crashing for our next release, in case it happens again.

 

Link to comment
Share on other sites

2 hours ago, Jose Almeida said:

Frank,

Instead of coding for every possible metar inconsistency couldn't just code something like "I can't figure this out, let's ignore these guys" :rolleyes:

Afraid it doesn't work that way! Fundamentally they are bugs in NOAA's METAR parsing library that I'm fixing.

Link to comment
Share on other sites

I understand that, Frank, but anything is better than a crash; wouldn't it be possible to have a global "On Error DO" that somehow avoided the crash, even if it meant switching to default clouds?

No. Frank was quite clear as to why but I think your limited knowledge of programming is not allowing you to understand why his explanation actually makes sense as to why your request cannot be done.

Link to comment
Share on other sites

1 hour ago, sundog said:

Some languages do have the concept of exceptions that the application can "catch," but this METAR code is written in C where that's not an option.

 

In my mother tongue there's a saying that can be losely translated by "Trying to teach Our Father to the priest"; I guess that's what I was trying to do. I've done a little programming, never in C and mostly in interpreted languages.

Link to comment
Share on other sites

  • 1 month later...

The METAR.rwx file you provided doesn't look like a standard one. Are you using some third-party weather addon? I couldn't find an indication of one in your log, but that METAR came from someplace. If you're using NOAA, perhaps it's not the latest version or it's not installed properly.

However, I was able to load that METAR.rwx in SMP/RWC just fine, so the problem's not the METAR file itself (assuming you're using SMP 4.0.1).

As far as I know, you're the only person experiencing this sort of thing. Re-installing X-Plane from a clean installation might be a good idea, to rule out some unique quirk of how your many add-ons are installed.

 

 

Link to comment
Share on other sites

Frank,

It was going to be the last post but then I decided to perform anothe experiment and I want to tell you about it.

I analyzed the NOAA plugin scripts and found the lines that update the METAR.rwx file, so I disabled those lines. Apparently the plugin does not use them and seems to run fine, as a result I hav no METAR.rwx, only MAXMETAR.rwx.

So far so good,

José

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...