- SGMetarCloud() :
- _coverage(-1),
- _altitude(NaN),
- _type(0),
- _type_long(0) {}
-
- inline int getCoverage() const { return _coverage; }
- inline double getAltitude_m() const { return _altitude; }
- inline double getAltitude_ft() const { return _altitude == NaN ? NaN : _altitude * SG_METER_TO_FEET; }
- inline char *getTypeString() const { return _type; }
- inline char *getTypeLongString() const { return _type_long; }
+ enum Coverage {
+ COVERAGE_NIL = -1,
+ COVERAGE_CLEAR = 0,
+ COVERAGE_FEW = 1,
+ COVERAGE_SCATTERED = 2,
+ COVERAGE_BROKEN = 3,
+ COVERAGE_OVERCAST = 4
+ };
+
+ static const char * COVERAGE_NIL_STRING;
+ static const char * COVERAGE_CLEAR_STRING;
+ static const char * COVERAGE_FEW_STRING;
+ static const char * COVERAGE_SCATTERED_STRING;
+ static const char * COVERAGE_BROKEN_STRING;
+ static const char * COVERAGE_OVERCAST_STRING;
+
+ SGMetarCloud() : _coverage(COVERAGE_NIL), _altitude(SGMetarNaN), _type(0), _type_long(0) {}
+
+ void set(double alt, Coverage cov = COVERAGE_NIL );
+
+ inline Coverage getCoverage() const { return _coverage; }
+ static Coverage getCoverage( const std::string & coverage );
+ inline double getAltitude_m() const { return _altitude; }
+ inline double getAltitude_ft() const { return _altitude == SGMetarNaN ? SGMetarNaN : _altitude * SG_METER_TO_FEET; }
+ inline const char *getTypeString() const { return _type; }
+ inline const char *getTypeLongString() const { return _type_long; }