]> git.mxchange.org Git - flightgear.git/blob - src/WeatherCM/FGWeatherParse.h
Cygwin32 build tweaks.
[flightgear.git] / src / WeatherCM / FGWeatherParse.h
1 /*****************************************************************************
2
3  Header:       FGWeatherParse.h 
4  Author:       Christian Mayer
5  Date started: 28.05.99
6
7  -------- Copyright (C) 1999 Christian Mayer (fgfs@christianmayer.de) --------
8
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  details.
18
19  You should have received a copy of the GNU General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA  02111-1307, USA.
22
23  Further information about the GNU General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25
26 FUNCTIONAL DESCRIPTION
27 ------------------------------------------------------------------------------
28 Parse the weather that can be downloaded from 
29
30     http://129.13.102.67/out/flight/yymmddhhdata.txt.gz
31
32 where yy stands for the year, mm for the month, dd for the day and hh for the
33 hour.
34 The columns are explained at
35
36     http://129.13.102.67/out/flight/kopf.txt
37
38 and a list of the stations can be found at
39
40     http://129.13.102.67/out/flight/wmoconv.txt.gz
41
42 Many thanks to Georg Mueller (Georg.Mueller@imk.fzk.de) of the 
43
44     Institut fuer Meteorologie und Klimaforschung, Universitaet Karlsruhe
45
46 for makeking such a service aviable. 
47 You can also visit his homepage at http://www.wetterzentrale.de
48
49 HISTORY
50 ------------------------------------------------------------------------------
51 18.10.1999 Christian Mayer      Created
52 *****************************************************************************/
53
54 /****************************************************************************/
55 /* SENTRY                                                                   */
56 /****************************************************************************/
57 #ifndef FGWeatherParse_H
58 #define FGWeatherParse_H
59
60 /****************************************************************************/
61 /* INCLUDES                                                                 */
62 /****************************************************************************/
63 #include <Include/compiler.h>
64 #include <vector>
65
66 #include <Misc/fgstream.hxx>
67
68 #include "FGPhysicalProperties.h"
69
70 /****************************************************************************/
71 /* DEFINES                                                                  */
72 /****************************************************************************/
73 FG_USING_STD(vector);
74
75 /****************************************************************************/
76 /* CLASS DECLARATION                                                        */
77 /****************************************************************************/
78 class FGWeatherParse
79 {
80 public:
81     struct entry;
82
83 private:
84     vector<entry> weather_station;
85
86 protected:
87 public:
88     /************************************************************************/
89     /* A line (i.e. entry) in the data file looks like:                     */
90     /*  yyyy mm dd hh XXXXX BBBBB LLLLLL UUUUU VVVVV TTTTT DDDDD PPPPP pppp */
91     /************************************************************************/
92     struct entry
93     {
94         int year;                       // The yyyy
95         int month;                      // The mm
96         int day;                        // The dd
97         int hour;                       // The hh
98         unsigned int station_number;    // The XXXXX
99         float lat;                      // The BBBBBB   negative = south
100         float lon;                      // The LLLLLLL  negative = west 
101         float x_wind;                   // The UUUUU    negative = to the weat
102         float y_wind;                   // The VVVVV    negative = to the south
103         float temperature;              // The TTTTT    in degC
104         float dewpoint;                 // The DDDDD    in degC
105         float airpressure;              // The PPPPP    in hPa
106         float airpressure_history[4];   // The pppp     in hPa
107     };
108
109     FGWeatherParse();
110     ~FGWeatherParse();
111
112     void input(const char *file);
113
114     unsigned int stored_stations(void) const
115     {
116         return weather_station.size();
117     }
118
119     entry getEntry(const unsigned int nr) const
120     {
121         return weather_station[nr];
122     }
123
124     FGPhysicalProperties2D getFGPhysicalProperties2D(const unsigned int nr) const;
125 };
126
127 /****************************************************************************/
128 #endif /*FGWeatherParse_H*/