1 // metarproperties.hxx -- Parse a METAR and write properties
3 // Written by David Megginson, started May 2002.
4 // Rewritten by Torsten Dreyer, August 2010
6 // Copyright (C) 2002 David Megginson - david@megginson.com
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #ifndef __METARPROPERTIES_HXX
24 #define __METARPROPERTIES_HXX
26 #include <Airports/simple.hxx>
27 #include <simgear/props/props.hxx>
28 #include "tiedpropertylist.hxx"
30 namespace Environment {
32 class MagneticVariation;
34 class MetarProperties : public SGReferenced
37 MetarProperties( SGPropertyNode_ptr rootNode );
38 virtual ~MetarProperties();
40 SGPropertyNode_ptr get_root_node() const { return _rootNode; }
41 virtual bool isValid() const { return _metarValidNode->getBoolValue(); }
42 virtual const std::string & getStationId() const { return _station_id; }
43 virtual void setStationId( const std::string & value );
44 virtual void setMetar( const std::string & value ) { set_metar( value.c_str() ); }
47 const char * get_metar() const { return _metar.c_str(); }
48 void set_metar( const char * metar );
49 const char * get_station_id() const { return _station_id.c_str(); }
50 void set_station_id( const char * value );
51 const char * get_decoded() const { return _decoded.c_str(); }
52 double get_magnetic_variation_deg() const;
53 double get_magnetic_dip_deg() const;
55 SGPropertyNode_ptr _rootNode;
56 SGPropertyNode_ptr _metarValidNode;
58 std::string _station_id;
59 double _station_elevation;
60 double _station_latitude;
61 double _station_longitude;
62 double _min_visibility;
63 double _max_visibility;
65 int _base_wind_range_from;
66 int _base_wind_range_to;
68 double _wind_from_north_fps;
69 double _wind_from_east_fps;
75 double _sea_level_temperature;
76 double _sea_level_dewpoint;
77 double _sea_level_pressure;
84 TiedPropertyList _tiedProperties;
85 MagneticVariation * _magneticVariation;
88 inline void MetarProperties::set_station_id( const char * value )
94 #endif // __METARPROPERTIES_HXX