mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 21:45:34 +08:00
resolved pressure constants 1013.2hPa != 29.92inHg
This commit is contained in:
@@ -40,15 +40,35 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Standard pressure 1013,25mbar / 29.92inHg
|
* \brief International Standard Atmosphere pressure at mean sea level, 1013.25hPa
|
||||||
* \return
|
* \return
|
||||||
*/
|
*/
|
||||||
static const CPressure& InternationalStandardSeaLevelPressure()
|
static const CPressure& ISASeaLevelPressure()
|
||||||
{
|
{
|
||||||
static CPressure p(1013.25, CPressureUnit::hPa());
|
static CPressure p(1013.25, CPressureUnit::hPa());
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief ICAO standard pressure datum for flight levels, 1013.2hPa
|
||||||
|
* \return
|
||||||
|
*/
|
||||||
|
static const CPressure& ICAOFlightLevelPressure()
|
||||||
|
{
|
||||||
|
static CPressure p(1013.2, CPressureUnit::hPa());
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Standard pressure datum for flight levels in USA, Canada, parts of Latin America, 29.92inHg
|
||||||
|
* \return
|
||||||
|
*/
|
||||||
|
static const CPressure& USFlightLevelPressure()
|
||||||
|
{
|
||||||
|
static CPressure p(29.92, CPressureUnit::inHg());
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Unicom frequency
|
* \brief Unicom frequency
|
||||||
* \return
|
* \return
|
||||||
|
|||||||
@@ -627,17 +627,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
static const CPressureUnit &inHg()
|
static const CPressureUnit &inHg()
|
||||||
{
|
{
|
||||||
static CPressureUnit inhg(QT_TRANSLATE_NOOP("CMeasurementUnit", "inch of mercury 0C"), "inHg", false, 3386.389);
|
static CPressureUnit inhg(QT_TRANSLATE_NOOP("CMeasurementUnit", "inch of mercury"), "inHg", false, 3386.389);
|
||||||
return inhg;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Inch of mercury for flight level 29,92inHg = 1013,25mbar = 1013,25hPa
|
|
||||||
* \return
|
|
||||||
*/
|
|
||||||
static const CPressureUnit &inHgFL()
|
|
||||||
{
|
|
||||||
static CPressureUnit inhg(QT_TRANSLATE_NOOP("CMeasurementUnit", "inch of mercury"), "inHg", false, 3386.5307486631);
|
|
||||||
return inhg;
|
return inhg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -653,7 +643,6 @@ public:
|
|||||||
u.append(CPressureUnit::bar());
|
u.append(CPressureUnit::bar());
|
||||||
u.append(CPressureUnit::hPa());
|
u.append(CPressureUnit::hPa());
|
||||||
u.append(CPressureUnit::inHg());
|
u.append(CPressureUnit::inHg());
|
||||||
u.append(CPressureUnit::inHgFL());
|
|
||||||
u.append(CPressureUnit::mbar());
|
u.append(CPressureUnit::mbar());
|
||||||
u.append(CPressureUnit::psi());
|
u.append(CPressureUnit::psi());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,13 +122,11 @@ void CTestPhysicalQuantities::pressureTests()
|
|||||||
{
|
{
|
||||||
CPressure p1(1013.25, CPressureUnit::hPa());
|
CPressure p1(1013.25, CPressureUnit::hPa());
|
||||||
CPressure p2(29.92, CPressureUnit::inHg());
|
CPressure p2(29.92, CPressureUnit::inHg());
|
||||||
CPressure p3(29.92, CPressureUnit::inHgFL());
|
|
||||||
CPressure p4(p1);
|
CPressure p4(p1);
|
||||||
p4.switchUnit(CPressureUnit::mbar());
|
p4.switchUnit(CPressureUnit::mbar());
|
||||||
|
|
||||||
// does not match exactly
|
// does not match exactly
|
||||||
QVERIFY2(p1 != p2, "Standard pressure test little difference");
|
QVERIFY2(p1 != p2, "Standard pressure test little difference");
|
||||||
QVERIFY2(p1 == p3, "Standard pressure test matching");
|
|
||||||
QVERIFY2(p1.unitValueToDouble() == p4.unitValueToDouble(), "mbar/hPa test");
|
QVERIFY2(p1.unitValueToDouble() == p4.unitValueToDouble(), "mbar/hPa test");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,7 +193,7 @@ void CTestPhysicalQuantities::memoryTests()
|
|||||||
*/
|
*/
|
||||||
void CTestPhysicalQuantities::basicArithmetic()
|
void CTestPhysicalQuantities::basicArithmetic()
|
||||||
{
|
{
|
||||||
CPressure p1 = CPhysicalQuantitiesConstants::InternationalStandardSeaLevelPressure();
|
CPressure p1 = CPhysicalQuantitiesConstants::ISASeaLevelPressure();
|
||||||
CPressure p2(p1);
|
CPressure p2(p1);
|
||||||
p2 *= 2.0;
|
p2 *= 2.0;
|
||||||
CPressure p3 = p1 + p1;
|
CPressure p3 = p1 + p1;
|
||||||
|
|||||||
Reference in New Issue
Block a user