WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
SfcWmoData.h
1#ifndef _WINC_SFCWMODATA
2#define _WINC_SFCWMODATA
3
4#include <WXP/Date.h>
5#include <WXP/StrLib.h>
6
7namespace WXP {
8 class SfcWmoData {
9 char id[11];
10 char data[400];
11 Date date;
12 int pday;
13 int phour;
14 int pmin;
15 int format;
16 int location;
17 char wmo[21];
18
19 public:
20 SfcWmoData();
21 int init();
22
23 inline int setId( const char *rid ){ StrLib::copy( id, 11, rid ); return 1; }
24 inline const char *getId(){ return id; }
25
26 inline int setData( const char *rdata ){
27 StrLib::copy( data, 400, rdata ); return 1; }
28 inline const char *getData(){ return data; }
29
30 inline int setDate( Date &rdate ){ date = rdate; return 1; }
31 int getDate( Date &rdate );
32 inline Date getDate(){ return date; }
33
34 inline int setProdDay( int rpday ){ pday = rpday; return 1; }
35 inline int getProdDay(){ return pday; }
36
37 inline int setProdHour( int rphour ){ phour = rphour; return 1; }
38 inline int getProdHour(){ return phour; }
39
40 inline int setProdMinute( int rpmin ){ pmin = rpmin; return 1; }
41 inline int getProdMinute(){ return pmin; }
42
43 inline int setFormat( int rformat ){ format = rformat; return 1; }
44 inline int getFormat(){ return format; }
45
46 inline int setLocation( int rloc ){ location = rloc; return 1; }
47 inline int getLocation(){ return location; }
48
49 inline int setWmo( const char *rwmo ){
50 StrLib::copy( wmo, 21, rwmo ); return 1; }
51 inline const char *getWmo(){ return wmo; }
52
53 inline bool isMETAR(){ return format >= METAR && format <= SPECI ? true : false; };
54 inline bool isSA(){ return format >= SA && format <= SP ? true : false; };
55 inline bool isSYNOP(){ return format >= SYNOP && format <= CMAN ? true : false; };
56 inline bool isSPEC(){ return format == SPECI || format == SP ? true : false; };
57
58 int printData();
59 int print();
60
61 friend class SfcWmoFile;
62 friend class MetarTool;
63 friend class SfcDecode;
64
65 static inline bool isTypeMETAR( int type ){ return type >= METAR && type <= SPECI ? true : false; };
66 static inline bool isTypeSA( int type ){ return type >= SA && type <= SP ? true : false; };
67 static inline bool isTypeSYNOP( int type ){ return type >= SYNOP && type <= CMAN ? true : false; };
68 static inline bool isTypeSPEC( int type ){ return type == SPECI || type == SP ? true : false; };
69
70 enum Location {
71 UNK,
72 USA,
73 CANADA,
74 MEXICO,
75 OTHER
76 };
77
78 enum DataType {
79 NONE,
80 METAR,
81 SPECI,
82 SA,
83 SP,
84 SYNOP,
85 SHIP,
86 BUOY,
87 DRIBU,
88 MOBIL,
89 CMAN,
90 MISC
91 };
92 };
93}
94
95#endif
This class stores date and time information.
Definition Date.h:8
This class is a set of tools to manage METAR data.
Definition MetarTool.h:8
This class decodes METAR, SAO and SYNOP data files.
Definition SfcDecode.h:11
This class hold information about raw surface reports (METAR, SAO).
Definition SfcWmoData.h:8
This class reads in surface data from a input raw data file from file.
Definition SfcWmoFile.h:10
static int copy(char *s1, int len1, const char s2)
Definition StrLib.cc:506
All WXP classes fall under the WXP namespace.
Definition Angle.h:4