Ref T223, use const values for standard pressure

* standardISASeaLevelPressure
* use static const values for standard pressure
* minor formatting
This commit is contained in:
Klaus Basan
2018-01-14 21:19:02 +01:00
parent 56adde399e
commit f049900e1f
13 changed files with 72 additions and 48 deletions

View File

@@ -46,8 +46,9 @@ namespace BlackWxPlugin
double millibarToLevel(double millibar)
{
static const double hPaStandardPressure = CPhysicalQuantitiesConstants::ICAOFlightLevelPressure().value(CPressureUnit::mbar());
millibar /= 100;
double level = (1 - std::pow(millibar / 1013.25, 0.190284)) * 145366.45;
double level = (1 - std::pow(millibar / hPaStandardPressure, 0.190284)) * 145366.45;
return level;
}