00001 /* 00002 * Atmosphere.h 00003 * 00004 * Part of Fly! Legacy project 00005 * 00006 * Copyright (c) 2004 Chris Wallace 00007 * 00008 * Fly! Legacy is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * Fly! Legacy is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with Fly! Legacy; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 * 00022 */ 00023 00029 #ifndef ATMOSPHERE_H_ 00030 #define ATMOSPHERE_H_ 00031 00032 #include "FlyLegacy.h" 00033 00034 00035 // 00036 // CAtmosphereModel 00037 // 00038 // Abstract base class that all atmosphere model implementations must support 00039 // 00040 // 00041 // 00042 class CAtmosphereModel { 00043 public: 00044 // Constructors/destructor 00045 CAtmosphereModel (void); 00046 00047 // CAtmosphereModel methods 00048 // Set baseline conditions 00049 virtual void SetTemperatureC (float m_msl, float t) = 0; 00050 virtual void SetPressureKgM2 (float m_msl, float p) = 0; 00051 00052 // Get temperature at specified position in various units 00053 virtual float GetTemperatureC (float m_msl); 00054 virtual float GetTemperatureK (float m_msl); 00055 virtual float GetTemperatureF (float ft_msl); 00056 virtual float GetTemperatureR (float ft_msl); 00057 00058 // Get dewpoint in various units 00059 virtual float GetDewpointC (float m_msl); 00060 virtual float GetDewpointK (float m_msl); 00061 virtual float GetDewpointF (float ft_msl); 00062 virtual float GetDewpointR (float ft_msl); 00063 00064 // Get relative humidity in percentage 00065 virtual float GetRelativeHumidity (float m_msl); 00066 00067 // Get atmospheric pressure in various units 00068 virtual float GetPressureKgM2 (float m_msl); 00069 virtual float GetPressureSlugsFt2 (float ft_msl); 00070 virtual float GetPressureInchesHg (float ft_msl); 00071 00072 // Get air pressure in various units 00073 virtual float GetDensityKgM3 (float m_msl); 00074 virtual float GetDensitySlugsFt3 (float ft_msl); 00075 00076 protected: 00077 }; 00078 00079 00080 // 00081 // CAtmosphereModelFly2 00082 // 00083 // This concrete CAtmosphereModel subclass implements the standard Fly! II 00084 // atmosphere model. This is similar to the International Standard 00085 // Atmosphere with some important differences. See Docs/Atmosphere.doc 00086 // for details. 00087 // 00088 class CAtmosphereModelFly2 { 00089 public: 00090 // Constructors/destructor 00091 CAtmosphereModelFly2 (void); 00092 00093 // CAtmosphereModel methods 00094 // Set baseline conditions 00095 void SetTemperatureC (float m_msl, float t); 00096 void SetPressureKgM2 (float m_msl, float p); 00097 00098 // Get temperature at specified position in various units 00099 float GetTemperatureC (float m_msl); 00100 float GetTemperatureK (float m_msl); 00101 float GetTemperatureF (float ft_msl); 00102 float GetTemperatureR (float ft_msl); 00103 00104 // Get dewpoint in various units 00105 float GetDewpointC (float m_msl); 00106 float GetDewpointK (float m_msl); 00107 float GetDewpointF (float ft_msl); 00108 float GetDewpointR (float ft_msl); 00109 00110 // Get relative humidity in percentage 00111 // Fly! II uses a dry air model, no humidity 00112 float GetRelativeHumidity (float m_msl) { return 0.0f; }; 00113 00114 // Get atmospheric pressure in various units 00115 float GetPressureKgM2 (float m_msl); 00116 float GetPressureSlugsFt2 (float ft_msl); 00117 float GetPressureInchesHg (float ft_msl); 00118 00119 // Get air pressure in various units 00120 float GetDensityKgM3 (float m_msl); 00121 float GetDensitySlugsFt3 (float ft_msl); 00122 00123 protected: 00124 float tempOffset; // Sea Level temperature offset from +15 C (in deg C) 00125 float pressureOffset; // Sea Level pressure offset from 1.013E+5 Pa (in Pa) 00126 }; 00127 00128 00129 #endif // ATMOSPHERE_H_ 00130
|
|
Documentation generated by
|