mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
Ref T259, Ref T243 elevation provider statistics
This commit is contained in:
@@ -24,13 +24,12 @@ namespace BlackMisc
|
||||
if (m_elvCoordinates.containsObjectInRange(elevationCoordinate, minRange(epsilon))) { return false; }
|
||||
}
|
||||
{
|
||||
// we keep latest at fron
|
||||
// we keep latest at front
|
||||
// * we assume we find them faster
|
||||
// * and need the more frequently (the recent ones)
|
||||
QWriteLocker l(&m_lockElvCoordinates);
|
||||
if (m_elvCoordinates.size() > MaxElevations) { m_elvCoordinates.pop_back(); }
|
||||
m_elvCoordinates.push_front(elevationCoordinate);
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -95,7 +94,19 @@ namespace BlackMisc
|
||||
CElevationPlane ISimulationEnvironmentProvider::findClosestElevationWithinRange(const ICoordinateGeodetic &reference, const PhysicalQuantities::CLength &range) const
|
||||
{
|
||||
const CCoordinateGeodetic coordinate = this->getElevationCoordinates().findClosestWithinRange(reference, minRange(range));
|
||||
return CElevationPlane(coordinate, reference); // plane with radis = distnace to reference
|
||||
const bool found = !coordinate.isNull();
|
||||
{
|
||||
QWriteLocker l{&m_lockElvCoordinates };
|
||||
if (found) { m_elvFound++; }
|
||||
else { m_elvMissed++; }
|
||||
}
|
||||
return CElevationPlane(coordinate, reference); // plane with radis = distance to reference
|
||||
}
|
||||
|
||||
QPair<int, int> ISimulationEnvironmentProvider::getElevationsFoundMissed() const
|
||||
{
|
||||
QReadLocker l(&m_lockElvCoordinates);
|
||||
return QPair<int, int>(m_elvFound, m_elvMissed);
|
||||
}
|
||||
|
||||
CSimulatorPluginInfo ISimulationEnvironmentProvider::getSimulatorPluginInfo() const
|
||||
@@ -162,6 +173,7 @@ namespace BlackMisc
|
||||
{
|
||||
QWriteLocker l(&m_lockElvCoordinates);
|
||||
m_elvCoordinates.clear();
|
||||
m_elvFound = m_elvMissed = 0;
|
||||
}
|
||||
|
||||
void ISimulationEnvironmentProvider::clearCGs()
|
||||
@@ -183,6 +195,12 @@ namespace BlackMisc
|
||||
return this->provider()->findClosestElevationWithinRange(reference, range);
|
||||
}
|
||||
|
||||
QPair<int, int> CSimulationEnvironmentAware::getElevationsFoundMissed() const
|
||||
{
|
||||
if (!this->hasProvider()) { return QPair<int, int>(0, 0); }
|
||||
return this->provider()->getElevationsFoundMissed();
|
||||
}
|
||||
|
||||
CSimulatorPluginInfo CSimulationEnvironmentAware::getSimulatorPluginInfo() const
|
||||
{
|
||||
if (!this->hasProvider()) { return CSimulatorPluginInfo(); }
|
||||
|
||||
Reference in New Issue
Block a user