00001 #ifndef _WINC_SAOTOOL
00002 #define _WINC_SAOTOOL
00003
00004 #include <WXP/Const.h>
00005 #include <WXP/Convert.h>
00006 #include <WXP/SfcData.h>
00007 #include <WXP/SfcWmoData.h>
00008
00009 namespace WXP {
00010 struct SaoTool {
00011 static int decode( SfcWmoData &data, SfcData &sfcdata);
00012 static int decode( char *data, SfcData &sfcdata);
00013
00014 static inline float decodeSlp( float f1 ){
00015 return f1>500?f1/10+900:(f1>=0?f1/10+1000:Const::MISS); }
00016 static inline float decodeAlt( float f1 ){
00017 return f1>500?f1/100+20:(f1>=0?f1/100+30:Const::MISS); }
00018 static inline float decodeAltmb( float f1 ){
00019 return Convert::MBtoIN(f1>500?f1/100+20:(f1>=0?f1/100+30:Const::MISS)); }
00020 };
00021 }
00022 #endif