Maybe you could add a metar-check-hook. Normally, it doesn't check. By
setting a hook to a check routine (in a separate file or something), you can
check the metar syntax immediately after processing it.
This way, you can concentrate on the metar decoder now, and add the checking
software later, and have severa subsequent versions without changing the
metar decoder.
I don't know if this fits in your phpweather 2 design.
Greetz,
Ray
>From: Martin Geisler <gim...@gi...>
>Reply-To: Martin Geisler <gim...@gi...>
>To: php...@li...
>Subject: Re: SV: Strange METAR
>Date: Tue, 26 Mar 2002 17:42:38 +0100
>
>"Funder, Johnny OTP" <jh...@NA...> writes:
>
>Hi Johnny
>
> > You are right 0200KT is wrong. Looking at the current weather in
> > England my guess is that the last number of the velosity is missing
> > should most likely read 02007KT og something like that.
>
>OK, but that would be rather difficult for the script to figure that
>out by itself :-)
>
> > The reason the decoding is fooled, is (as I have mentioned before)
> > because each group is decoded as a group by it self and not in the
> > context of the message.
>
>I know - it should probably be reworked a bit.
>
> > Normally when decoding metars we make sure that the sequence of the
> > groups are correct and that eg. there must be a cloud group and if a
> > weathergroup is present it must be placed correctly in the metar
> > message.
>
>Hmm, we should probably have such logic in PHP Weather too. Let's look
>at that when we have a version 2 ready...
>
>--
>Martin Geisler My GnuPG Key: 0xF7F6B57B
>
>See my homepage at http://www.gimpster.com/ for:
>PHP Weather => Shows the current weather on your webpage.
>PHP Shell => A telnet-connection (almost :-) in a PHP page.
><< attach3 >>
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
|