mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 13:55:36 +08:00
Ref T171, utility functions for interpolator hints/setup
This commit is contained in:
@@ -23,6 +23,10 @@ namespace BlackMisc
|
|||||||
CInterpolationHints::CInterpolationHints(bool isVtolAircraft) : m_isVtol(isVtolAircraft)
|
CInterpolationHints::CInterpolationHints(bool isVtolAircraft) : m_isVtol(isVtolAircraft)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
CInterpolationHints::CInterpolationHints(bool isVtolAircraft, bool hasParts, bool log) :
|
||||||
|
m_isVtol(isVtolAircraft), m_hasParts(hasParts), m_logInterpolation(log)
|
||||||
|
{ }
|
||||||
|
|
||||||
CAltitude CInterpolationHints::getGroundElevation(const Aviation::CAircraftSituation &situation) const
|
CAltitude CInterpolationHints::getGroundElevation(const Aviation::CAircraftSituation &situation) const
|
||||||
{
|
{
|
||||||
if (m_elevationProvider) { return m_elevationProvider(situation); }
|
if (m_elevationProvider) { return m_elevationProvider(situation); }
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ namespace BlackMisc
|
|||||||
//! Constructor
|
//! Constructor
|
||||||
CInterpolationHints(bool isVtolAircraft);
|
CInterpolationHints(bool isVtolAircraft);
|
||||||
|
|
||||||
|
//! Constructor
|
||||||
|
CInterpolationHints(bool isVtolAircraft, bool hasParts, bool log);
|
||||||
|
|
||||||
//! Get elevation
|
//! Get elevation
|
||||||
const BlackMisc::Geo::CElevationPlane &getElevationPlane() const { return m_elevationPlane;}
|
const BlackMisc::Geo::CElevationPlane &getElevationPlane() const { return m_elevationPlane;}
|
||||||
|
|
||||||
@@ -116,9 +119,9 @@ namespace BlackMisc
|
|||||||
bool m_isVtol = false; //!< VTOL aircraft?
|
bool m_isVtol = false; //!< VTOL aircraft?
|
||||||
bool m_hasParts = false; //!< Has valid aircraft parts?
|
bool m_hasParts = false; //!< Has valid aircraft parts?
|
||||||
bool m_logInterpolation = false; //!< log interpolation
|
bool m_logInterpolation = false; //!< log interpolation
|
||||||
BlackMisc::Aviation::CAircraftParts m_aircraftParts; //!< Aircraft parts
|
BlackMisc::Aviation::CAircraftParts m_aircraftParts; //!< Aircraft parts
|
||||||
BlackMisc::Geo::CElevationPlane m_elevationPlane; //!< aircraft's elevation if available
|
BlackMisc::Geo::CElevationPlane m_elevationPlane; //!< aircraft's elevation if available
|
||||||
ElevationProvider m_elevationProvider; //!< Provider of ground elevation (lazy computation)
|
ElevationProvider m_elevationProvider; //!< Provider of ground elevation (lazy computation)
|
||||||
BlackMisc::PhysicalQuantities::CLength m_cgAboveGround { 0, nullptr }; //!< center of gravity above ground
|
BlackMisc::PhysicalQuantities::CLength m_cgAboveGround { 0, nullptr }; //!< center of gravity above ground
|
||||||
|
|
||||||
BLACK_METACLASS(
|
BLACK_METACLASS(
|
||||||
|
|||||||
@@ -156,6 +156,11 @@ namespace BlackMisc
|
|||||||
return m_callsignsToLog;
|
return m_callsignsToLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CInterpolationAndRenderingSetup::logCallsign(const Aviation::CCallsign &callsign) const
|
||||||
|
{
|
||||||
|
return m_callsignsToLog.contains(callsign);
|
||||||
|
}
|
||||||
|
|
||||||
QString CInterpolationAndRenderingSetup::convertToQString(bool i18n) const
|
QString CInterpolationAndRenderingSetup::convertToQString(bool i18n) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(i18n);
|
Q_UNUSED(i18n);
|
||||||
|
|||||||
@@ -113,6 +113,9 @@ namespace BlackMisc
|
|||||||
//! Callsigns for logging
|
//! Callsigns for logging
|
||||||
BlackMisc::Aviation::CCallsignSet getLogCallsigns() const;
|
BlackMisc::Aviation::CCallsignSet getLogCallsigns() const;
|
||||||
|
|
||||||
|
//! Log the given callsign?
|
||||||
|
bool logCallsign(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||||
QString convertToQString(bool i18n = false) const;
|
QString convertToQString(bool i18n = false) const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user