]> git.mxchange.org Git - flightgear.git/blob - src/WeatherCM/FGPhysicalProperties_bind.cpp
Erik Hofman:
[flightgear.git] / src / WeatherCM / FGPhysicalProperties_bind.cpp
1 /*****************************************************************************
2
3  Module:       FGPhysicalProperties_bind.cpp
4  Author:       Christian Mayer
5  Date started: 15.03.02
6  Called by:    main program
7
8  -------- Copyright (C) 2002 Christian Mayer (fgfs@christianmayer.de) --------
9
10  This program is free software; you can redistribute it and/or modify it under
11  the terms of the GNU General Public License as published by the Free Software
12  Foundation; either version 2 of the License, or (at your option) any later
13  version.
14
15  This program is distributed in the hope that it will be useful, but WITHOUT
16  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
18  details.
19
20  You should have received a copy of the GNU General Public License along with
21  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
22  Place - Suite 330, Boston, MA  02111-1307, USA.
23
24  Further information about the GNU General Public License can also be found on
25  the world wide web at http://www.gnu.org.
26
27 FUNCTIONAL DESCRIPTION
28 ------------------------------------------------------------------------------
29 Initialice the FGPhysicalProperties struct to something sensible(?)
30
31 HISTORY
32 ------------------------------------------------------------------------------
33 15.03.2002 Christian Mayer      Created
34 *****************************************************************************/
35
36 #include "FGPhysicalProperties.h"
37
38
39 WeatherPrecision FGPhysicalProperties::getWind_x( int number ) const
40 {
41     if (number >= Wind.size())
42     {
43       cerr << "Error: There are " << Wind.size() << " entries for wind, but number " << number << " got requested!\n";
44       return 0.0;
45     }
46
47     map<Altitude,FGWindItem>::const_iterator it = Wind.begin(); 
48
49     while( number > 0)
50     {
51       it++;
52       number--;
53     }
54
55     return it->second.x();
56 }
57
58 void FGPhysicalProperties::setWind_x( int number, WeatherPrecision x)
59 {
60     if (number >= Wind.size())
61     {
62       cerr << "Error: There are " << Wind.size() << " entries for wind, but number " << number << " got requested!\n";
63     }
64
65     map<Altitude,FGWindItem>::iterator it = Wind.begin(); 
66
67     while( number > 0)
68     {
69       it++;
70       number--;
71     }
72
73     it->second.x( x );
74 }
75
76 WeatherPrecision FGPhysicalProperties::getWind_y( int number ) const
77 {
78     if (number >= Wind.size())
79     {
80       cerr << "Error: There are " << Wind.size() << " entries for wind, but number " << number << " got requested!\n";
81       return 0.0;
82     }
83
84     map<Altitude,FGWindItem>::const_iterator it = Wind.begin(); 
85
86     while( number > 0)
87     {
88       it++;
89       number--;
90     }
91
92     return it->second.y();
93 }
94
95 void FGPhysicalProperties::setWind_y( int number, WeatherPrecision y)
96 {
97     if (number >= Wind.size())
98     {
99       cerr << "Error: There are " << Wind.size() << " entries for wind, but number " << number << " got requested!\n";
100     }
101
102     map<Altitude,FGWindItem>::iterator it = Wind.begin(); 
103
104     while( number > 0)
105     {
106       it++;
107       number--;
108     }
109
110     it->second.y( y );
111 }
112
113 WeatherPrecision FGPhysicalProperties::getWind_z( int number ) const
114 {
115     if (number >= Wind.size())
116     {
117       cerr << "Error: There are " << Wind.size() << " entries for wind, but number " << number << " got requested!\n";
118       return 0.0;
119     }
120
121     map<Altitude,FGWindItem>::const_iterator it = Wind.begin(); 
122
123     while( number > 0)
124     {
125       it++;
126       number--;
127     }
128
129     return it->second.z();
130 }
131
132 void FGPhysicalProperties::setWind_z( int number, WeatherPrecision z)
133 {
134     if (number >= Wind.size())
135     {
136       cerr << "Error: There are " << Wind.size() << " entries for wind, but number " << number << " got requested!\n";
137     }
138
139     map<Altitude,FGWindItem>::iterator it = Wind.begin(); 
140
141     while( number > 0)
142     {
143       it++;
144       number--;
145     }
146
147     it->second.z( z );
148 }
149
150 WeatherPrecision FGPhysicalProperties::getWind_a( int number ) const
151 {
152     if (number >= Wind.size())
153     {
154       cerr << "Error: There are " << Wind.size() << " entries for wind, but number " << number << " got requested!\n";
155       return 0.0;
156     }
157
158     map<Altitude,FGWindItem>::const_iterator it = Wind.begin(); 
159
160     while( number > 0)
161     {
162       it++;
163       number--;
164     }
165
166     return it->first;
167 }
168
169 void FGPhysicalProperties::setWind_a( int number, WeatherPrecision a)
170 {
171     if (number >= Wind.size())
172     {
173       cerr << "Error: There are " << Wind.size() << " entries for wind, but number " << number << " got requested!\n";
174     }
175
176     map<Altitude,FGWindItem>::iterator it = Wind.begin(); 
177
178     while( number > 0)
179     {
180       it++;
181       number--;
182     }
183
184     it->first;
185 }
186
187 WeatherPrecision FGPhysicalProperties::getTurbulence_x( int number ) const
188 {
189     if (number >= Turbulence.size())
190     {
191       cerr << "Error: There are " << Turbulence.size() << " entries for Turbulence, but number " << number << " got requested!\n";
192       return 0.0;
193     }
194
195     map<Altitude,FGTurbulenceItem>::const_iterator it = Turbulence.begin(); 
196
197     while( number > 0)
198     {
199       it++;
200       number--;
201     }
202
203     return it->second.x();
204 }
205
206 void FGPhysicalProperties::setTurbulence_x( int number, WeatherPrecision x)
207 {
208     if (number >= Turbulence.size())
209     {
210       cerr << "Error: There are " << Turbulence.size() << " entries for Turbulence, but number " << number << " got requested!\n";
211     }
212
213     map<Altitude,FGTurbulenceItem>::iterator it = Turbulence.begin(); 
214
215     while( number > 0)
216     {
217       it++;
218       number--;
219     }
220
221     it->second.x( x );
222 }
223
224 WeatherPrecision FGPhysicalProperties::getTurbulence_y( int number ) const
225 {
226     if (number >= Turbulence.size())
227     {
228       cerr << "Error: There are " << Turbulence.size() << " entries for Turbulence, but number " << number << " got requested!\n";
229       return 0.0;
230     }
231
232     map<Altitude,FGTurbulenceItem>::const_iterator it = Turbulence.begin(); 
233
234     while( number > 0)
235     {
236       it++;
237       number--;
238     }
239
240     return it->second.y();
241 }
242
243 void FGPhysicalProperties::setTurbulence_y( int number, WeatherPrecision y)
244 {
245     if (number >= Turbulence.size())
246     {
247       cerr << "Error: There are " << Turbulence.size() << " entries for Turbulence, but number " << number << " got requested!\n";
248     }
249
250     map<Altitude,FGTurbulenceItem>::iterator it = Turbulence.begin(); 
251
252     while( number > 0)
253     {
254       it++;
255       number--;
256     }
257
258     it->second.y( y );
259 }
260
261 WeatherPrecision FGPhysicalProperties::getTurbulence_z( int number ) const
262 {
263     if (number >= Turbulence.size())
264     {
265       cerr << "Error: There are " << Turbulence.size() << " entries for Turbulence, but number " << number << " got requested!\n";
266       return 0.0;
267     }
268
269     map<Altitude,FGTurbulenceItem>::const_iterator it = Turbulence.begin(); 
270
271     while( number > 0)
272     {
273       it++;
274       number--;
275     }
276
277     return it->second.z();
278 }
279
280 void FGPhysicalProperties::setTurbulence_z( int number, WeatherPrecision z)
281 {
282     if (number >= Turbulence.size())
283     {
284       cerr << "Error: There are " << Turbulence.size() << " entries for Turbulence, but number " << number << " got requested!\n";
285     }
286
287     map<Altitude,FGTurbulenceItem>::iterator it = Turbulence.begin(); 
288
289     while( number > 0)
290     {
291       it++;
292       number--;
293     }
294
295     it->second.z( z );
296 }
297
298 WeatherPrecision FGPhysicalProperties::getTurbulence_a( int number ) const
299 {
300     if (number >= Turbulence.size())
301     {
302       cerr << "Error: There are " << Turbulence.size() << " entries for Turbulence, but number " << number << " got requested!\n";
303       return 0.0;
304     }
305
306     map<Altitude,FGTurbulenceItem>::const_iterator it = Turbulence.begin(); 
307
308     while( number > 0)
309     { 
310       it++;
311       number--;
312     }
313
314     return it->first;
315 }
316
317 void FGPhysicalProperties::setTurbulence_a( int number, WeatherPrecision a)
318 {
319     if (number >= Turbulence.size())
320     {
321       cerr << "Error: There are " << Turbulence.size() << " entries for Turbulence, but number " << number << " got requested!\n";
322     }
323
324     map<Altitude,FGTurbulenceItem>::iterator it = Turbulence.begin(); 
325
326     while( number > 0)
327     {
328       it++;
329       number--;
330     }
331
332     it->first;
333 }
334
335 WeatherPrecision FGPhysicalProperties::getTemperature_x( int number ) const
336 {
337     if (number >= Temperature.size())
338     {
339       cerr << "Error: There are " << Temperature.size() << " entries for Temperature, but number " << number << " got requested!\n";
340       return 0.0;
341     }
342
343     map<Altitude,WeatherPrecision>::const_iterator it = Temperature.begin(); 
344
345     while( number > 0)
346     {
347       it++;
348       number--;
349     }
350
351     return it->second;
352 }
353
354 void FGPhysicalProperties::setTemperature_x( int number, WeatherPrecision x)
355 {
356     if (number >= Temperature.size())
357     {
358       cerr << "Error: There are " << Temperature.size() << " entries for Temperature, but number " << number << " got requested!\n";
359     }
360
361     map<Altitude,WeatherPrecision>::iterator it = Temperature.begin(); 
362
363     while( number > 0)
364     {
365       it++;
366       number--;
367     }
368
369     it->second = x;
370 }
371
372 WeatherPrecision FGPhysicalProperties::getTemperature_a( int number ) const
373 {
374     if (number >= Temperature.size())
375     {
376       cerr << "Error: There are " << Temperature.size() << " entries for Temperature, but number " << number << " got requested!\n";
377       return 0.0;
378     }
379
380     map<Altitude,WeatherPrecision>::const_iterator it = Temperature.begin(); 
381
382     while( number > 0)
383     { 
384       it++;
385       number--;
386     }
387
388     return it->first;
389 }
390
391 void FGPhysicalProperties::setTemperature_a( int number, WeatherPrecision a)
392 {
393     if (number >= Temperature.size())
394     {
395       cerr << "Error: There are " << Temperature.size() << " entries for Temperature, but number " << number << " got requested!\n";
396     }
397
398     map<Altitude,WeatherPrecision>::iterator it = Temperature.begin(); 
399
400     while( number > 0)
401     {
402       it++;
403       number--;
404     }
405
406     it->first;
407 }
408 WeatherPrecision FGPhysicalProperties::getVaporPressure_x( int number ) const
409 {
410     if (number >= VaporPressure.size())
411     {
412       cerr << "Error: There are " << VaporPressure.size() << " entries for VaporPressure, but number " << number << " got requested!\n";
413       return 0.0;
414     }
415
416     map<Altitude,WeatherPrecision>::const_iterator it = VaporPressure.begin(); 
417
418     while( number > 0)
419     {
420       it++;
421       number--;
422     }
423
424     return it->second;
425 }
426
427 void FGPhysicalProperties::setVaporPressure_x( int number, WeatherPrecision x)
428 {
429     if (number >= VaporPressure.size())
430     {
431       cerr << "Error: There are " << Temperature.size() << " entries for VaporPressure, but number " << number << " got requested!\n";
432     }
433
434     map<Altitude,WeatherPrecision>::iterator it = VaporPressure.begin(); 
435
436     while( number > 0)
437     {
438       it++;
439       number--;
440     }
441
442     it->second = x;
443 }
444
445 WeatherPrecision FGPhysicalProperties::getVaporPressure_a( int number ) const
446 {
447     if (number >= VaporPressure.size())
448     {
449       cerr << "Error: There are " << VaporPressure.size() << " entries for VaporPressure, but number " << number << " got requested!\n";
450       return 0.0;
451     }
452
453     map<Altitude,WeatherPrecision>::const_iterator it = VaporPressure.begin(); 
454
455     while( number > 0)
456     { 
457       it++;
458       number--;
459     }
460
461     return it->first;
462 }
463
464 void FGPhysicalProperties::setVaporPressure_a( int number, WeatherPrecision a)
465 {
466     if (number >= VaporPressure.size())
467     {
468       cerr << "Error: There are " << VaporPressure.size() << " entries for VaporPressure, but number " << number << " got requested!\n";
469     }
470
471     map<Altitude,WeatherPrecision>::iterator it = VaporPressure.begin(); 
472
473     while( number > 0)
474     {
475       it++;
476       number--;
477     }
478
479     it->first;
480 }