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/airport.hxx>
27 #include <simgear/props/props.hxx>
28 #include <simgear/props/tiedpropertylist.hxx>
32 namespace Environment {
34 class MagneticVariation;
36 class MetarProperties : public SGReferenced
39 MetarProperties( SGPropertyNode_ptr rootNode );
40 virtual ~MetarProperties();
42 SGPropertyNode_ptr get_root_node() const { return _rootNode; }
43 virtual bool isValid() const { return _metarValidNode->getBoolValue(); }
44 virtual const std::string & getStationId() const { return _station_id; }
45 virtual void setStationId( const std::string & value );
46 virtual void setMetar(SGSharedPtr<FGMetar> m);
47 virtual void invalidate();
50 const char * get_metar() const;
51 void set_metar( const char * metar );
53 const char * get_station_id() const { return _station_id.c_str(); }
54 void set_station_id( const char * value );
55 const char * get_decoded() const { return _decoded.c_str(); }
56 double get_magnetic_variation_deg() const;
57 double get_magnetic_dip_deg() const;
58 double get_wind_from_north_fps() const { return _wind_from_north_fps; }
59 double get_wind_from_east_fps() const { return _wind_from_east_fps; }
60 double get_base_wind_dir() const { return _base_wind_dir; }
61 double get_wind_speed() const { return _wind_speed; }
62 void set_wind_from_north_fps( double value );
63 void set_wind_from_east_fps( double value );
64 void set_base_wind_dir( double value );
65 void set_wind_speed( double value );
67 SGSharedPtr<FGMetar> _metar;
68 SGPropertyNode_ptr _rootNode;
69 SGPropertyNode_ptr _metarValidNode;
71 std::string _station_id;
72 double _station_elevation;
73 double _station_latitude;
74 double _station_longitude;
75 double _min_visibility;
76 double _max_visibility;
78 int _base_wind_range_from;
79 int _base_wind_range_to;
81 double _wind_from_north_fps;
82 double _wind_from_east_fps;
88 double _sea_level_temperature;
89 double _sea_level_dewpoint;
90 double _sea_level_pressure;
101 simgear::TiedPropertyList _tiedProperties;
102 MagneticVariation * _magneticVariation;
105 inline void MetarProperties::set_station_id( const char * value )
111 #endif // __METARPROPERTIES_HXX