From 52c1cb2f7d55d1e34a546446aa816b65c745dbfa Mon Sep 17 00:00:00 2001 From: david Date: Wed, 15 May 2002 12:10:48 +0000 Subject: [PATCH] Take the static temperature, static pressure, and density values from an external source if requested by the /environment/params/control-fdm-atmosphere property. --- src/FDM/YASim/Atmosphere.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/FDM/YASim/Atmosphere.cpp b/src/FDM/YASim/Atmosphere.cpp index 18b54dd24..bc8a754dd 100644 --- a/src/FDM/YASim/Atmosphere.cpp +++ b/src/FDM/YASim/Atmosphere.cpp @@ -1,3 +1,5 @@ +#include
+ #include "Math.hpp" #include "Atmosphere.hpp" namespace yasim { @@ -40,17 +42,26 @@ const float GAMMA = 1.4f; float Atmosphere::getStdTemperature(float alt) { - return getRecord(alt, 1); + if (fgGetBool("/environment/params/control-fdm-atmosphere")) + return fgGetDouble("/environment/temperature-degC") + 273.15; + else + return getRecord(alt, 1); } float Atmosphere::getStdPressure(float alt) { - return getRecord(alt, 2); + if (fgGetBool("/environment/params/control-fdm-atmosphere")) + return fgGetDouble("/environment/pressure-inhg") * 3386.39; + else + return getRecord(alt, 2); } float Atmosphere::getStdDensity(float alt) { - return getRecord(alt, 3); + if (fgGetBool("/environment/params/control-fdm-atmosphere")) + return fgGetDouble("/environment/density-slugft3") * 515.378; + else + return getRecord(alt, 3); } float Atmosphere::calcVEAS(float spd, float pressure, float temp) -- 2.39.5