mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 12:35:43 +08:00
Improved way to get situation with altitude offset
This commit is contained in:
@@ -965,6 +965,14 @@ namespace BlackMisc
|
||||
return alt;
|
||||
}
|
||||
|
||||
CAircraftSituation CAircraftSituation::withAltitudeOffset(const CLength &offset) const
|
||||
{
|
||||
if (offset.isNull()) { return *this; }
|
||||
CAircraftSituation copy(*this);
|
||||
copy.addAltitudeOffset(offset);
|
||||
return copy;
|
||||
}
|
||||
|
||||
void CAircraftSituation::setPressureAltitude(const CAltitude &altitude)
|
||||
{
|
||||
Q_ASSERT(altitude.getAltitudeType() == CAltitude::PressureAltitude);
|
||||
|
||||
@@ -392,6 +392,9 @@ namespace BlackMisc
|
||||
//! Add offset to altitude
|
||||
CAltitude addAltitudeOffset(const PhysicalQuantities::CLength &offset);
|
||||
|
||||
//! Situation with altitude offset
|
||||
CAircraftSituation withAltitudeOffset(const PhysicalQuantities::CLength &offset) const;
|
||||
|
||||
//! Get pressure altitude
|
||||
const CAltitude &getPressureAltitude() const { return m_pressureAltitude; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user