Ref T778, utility functions

This commit is contained in:
Klaus Basan
2020-04-07 18:35:15 +02:00
committed by Mat Sutcliffe
parent 004173b052
commit cfa96a3aeb
4 changed files with 19 additions and 0 deletions

View File

@@ -103,6 +103,11 @@ namespace BlackMisc
return a; return a;
} }
double CElevationPlane::getAltitudeValue(const CLengthUnit &unit) const
{
return this->getAltitude().value(unit);
}
bool CElevationPlane::isNull() const bool CElevationPlane::isNull() const
{ {
return m_radius.isNull() || CCoordinateGeodetic::isNull(); return m_radius.isNull() || CCoordinateGeodetic::isNull();

View File

@@ -94,6 +94,9 @@ namespace BlackMisc
//! Altitude (synonym for geodetic height) //! Altitude (synonym for geodetic height)
Aviation::CAltitude getAltitudeInUnit(const PhysicalQuantities::CLengthUnit &unit) const; Aviation::CAltitude getAltitudeInUnit(const PhysicalQuantities::CLengthUnit &unit) const;
//! Altitude (synonym for geodetic height)
double getAltitudeValue(const PhysicalQuantities::CLengthUnit &unit) const;
//! Existing value? //! Existing value?
virtual bool isNull() const override; virtual bool isNull() const override;

View File

@@ -257,6 +257,12 @@ namespace BlackMisc
return m_cgsPerCallsign.remove(cs); return m_cgsPerCallsign.remove(cs);
} }
void ISimulationEnvironmentProvider::removePendingElevationRequest(const CCallsign &cs)
{
QWriteLocker l(&m_lockElvCoordinates);
m_pendingElevationRequests.remove(cs);
}
CLength ISimulationEnvironmentProvider::minRange(const CLength &range) CLength ISimulationEnvironmentProvider::minRange(const CLength &range)
{ {
return (range.isNull() || range < CElevationPlane::singlePointRadius()) ? return (range.isNull() || range < CElevationPlane::singlePointRadius()) ?

View File

@@ -274,6 +274,11 @@ namespace BlackMisc
//! \threadsafe //! \threadsafe
int removeSimulatorCG(const Aviation::CCallsign &cs); int removeSimulatorCG(const Aviation::CCallsign &cs);
//! Remove pending timestamp
//! \threadsafe
//! \remark useful if we ignore the probe response on sim. side
void removePendingElevationRequest(const Aviation::CCallsign &cs);
//! Min.range considered as single point //! Min.range considered as single point
static PhysicalQuantities::CLength minRange(const PhysicalQuantities::CLength &range); static PhysicalQuantities::CLength minRange(const PhysicalQuantities::CLength &range);