X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWeatherCM%2FFGAirPressureItem.h;h=21192904b71b5949905a0e02681e3ce76869caaa;hb=a4e81f4ff075e6a3c0c2ea1b5a29c0bcdfdbc671;hp=3b4d422f096bb6b5e9dabb04b31f7640ab3286be;hpb=275154500802cc9405b5905b3b055e5c4a17b33f;p=flightgear.git diff --git a/src/WeatherCM/FGAirPressureItem.h b/src/WeatherCM/FGAirPressureItem.h index 3b4d422f0..21192904b 100644 --- a/src/WeatherCM/FGAirPressureItem.h +++ b/src/WeatherCM/FGAirPressureItem.h @@ -37,6 +37,10 @@ HISTORY suggestion 19.10.1999 Christian Mayer change to use PLIB's sg instead of Point[2/3]D and lots of wee code cleaning +15.12.1999 Christian Mayer changed the air pressure calculation to a much + more realistic formula. But as I need for that + the temperature I moved the code to + FGPhysicalProperties *****************************************************************************/ /****************************************************************************/ @@ -62,27 +66,30 @@ FGAirPressureItem operator-(const FGAirPressureItem& arg); /* CLASS DECLARATION */ /* NOTE: The value stored in 'value' is the air preasure that we'd have at */ /* an altitude of 0.0 The correct airpreasure at the stored altitude */ -/* gets calulated when getValue() is called. */ +/* gets calulated in FGPhyiscalProperties as I need to know the */ +/* temperatures at the different altitudes for that. */ /****************************************************************************/ class FGAirPressureItem { private: - WeatherPrecision value; + WeatherPrecision value; //that's the airpressure at 0 metres protected: public: - FGAirPressureItem(const WeatherPrecision v) {value = v;} + FGAirPressureItem(const WeatherPrecision v) {value = v; } FGAirPressureItem() {value = FG_WEATHER_DEFAULT_AIRPRESSURE;} - WeatherPrecision getValue(const WeatherPrecision& alt) const + WeatherPrecision getValue() const { - return (WeatherPrecision)((value / 101325.0) * - ( - 1.01325e5 + alt * (-1.19459535223623e1 + alt * (5.50461110007561e-4 + alt * (-1.13574703113648e-8 + alt * 8.61601726143988e-14))) - )); + return value; }; - + + void setValue(WeatherPrecision p) + { + value = p; + }; + FGAirPressureItem& operator*=(const WeatherPrecision arg); FGAirPressureItem& operator+=(const FGAirPressureItem& arg); FGAirPressureItem& operator-=(const FGAirPressureItem& arg);