mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +08:00
Ref T773, utility functions to clean cache and find max. elevation
This commit is contained in:
committed by
Mat Sutcliffe
parent
466c761616
commit
ab41c1e930
@@ -133,6 +133,20 @@ namespace BlackMisc
|
||||
return stats;
|
||||
}
|
||||
|
||||
template<class OBJ, class CONTAINER>
|
||||
CAltitude IGeoObjectList<OBJ, CONTAINER>::findMaxHeight() const
|
||||
{
|
||||
if (this->container().isEmpty()) { return CAltitude::null(); }
|
||||
CAltitude max = CAltitude::null();
|
||||
for (const OBJ &obj : this->container())
|
||||
{
|
||||
if (!obj.hasMSLGeodeticHeight()) { continue; }
|
||||
const CAltitude alt = obj.geodeticHeight();
|
||||
if (max.isNull() || alt > max) { max = alt; }
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
int IGeoObjectList<OBJ, CONTAINER>::removeOutsideRange(const ICoordinateGeodetic &coordinate, const PhysicalQuantities::CLength &range)
|
||||
{
|
||||
|
||||
@@ -83,6 +83,9 @@ namespace BlackMisc
|
||||
//! Find min/max/average height
|
||||
MinMaxAverageHeight findMinMaxAverageHeight() const;
|
||||
|
||||
//! Find min/max/average height
|
||||
Aviation::CAltitude findMaxHeight() const;
|
||||
|
||||
//! Remove outside range
|
||||
int removeOutsideRange(const ICoordinateGeodetic &coordinate, const PhysicalQuantities::CLength &range);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user