]> git.mxchange.org Git - flightgear.git/blob - src/Environment/fgmetar.hxx
Create TimeManager subsystem, and collect the time related code out of main.cxx and...
[flightgear.git] / src / Environment / fgmetar.hxx
1 // metar interface class
2 //
3 // Written by Melchior FRANZ, started January 2005.
4 //
5 // Copyright (C) 2005  Melchior FRANZ - mfranz@aon.at
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 //
21 // $Id$
22
23 #ifndef _FGMETAR_HXX
24 #define _FGMETAR_HXX
25
26 #include <vector>
27 #include <map>
28 #include <string>
29 #include <time.h>
30
31 #include <simgear/environment/metar.hxx>
32
33 using std::vector;
34 using std::map;
35 using std::string;
36
37
38 class FGMetar : public SGMetar, public SGReferenced {
39 public:
40         FGMetar(const string& icao, const string& proxy = "", const string& port = "",
41                         const string &auth = "");
42
43         long    getAge_min()                    const;
44         time_t  getTime()                       const { return _time; }
45         double  getRain()                       const { return _rain / 3.0; }
46         double  getHail()                       const { return _hail / 3.0; }
47         double  getSnow()                       const { return _snow / 3.0; }
48         bool    getSnowCover()                  const { return _snow_cover; }
49
50 private:
51         time_t  _rq_time;
52         time_t  _time;
53         bool    _snow_cover;
54 };
55
56 #endif // _FGMETAR_HXX