Take the static temperature, static pressure, and density values from
an external source if requested by the /environment/params/control-fdm-atmosphere property.
This commit is contained in:
parent
cade7aad70
commit
52c1cb2f7d
1 changed files with 14 additions and 3 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
#include <Main/fg_props.hxx>
|
||||||
|
|
||||||
#include "Math.hpp"
|
#include "Math.hpp"
|
||||||
#include "Atmosphere.hpp"
|
#include "Atmosphere.hpp"
|
||||||
namespace yasim {
|
namespace yasim {
|
||||||
|
@ -40,17 +42,26 @@ const float GAMMA = 1.4f;
|
||||||
|
|
||||||
float Atmosphere::getStdTemperature(float alt)
|
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)
|
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)
|
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)
|
float Atmosphere::calcVEAS(float spd, float pressure, float temp)
|
||||||
|
|
Loading…
Add table
Reference in a new issue