mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 19:05:31 +08:00
Ref T268, airspace monitor also consider closest elevations (from same callsign situations)
This commit is contained in:
@@ -303,12 +303,11 @@ namespace BlackCore
|
|||||||
m_bookingsRequested = true;
|
m_bookingsRequested = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAirspaceMonitor::enableWatchdog(bool enable)
|
bool CAirspaceMonitor::enableWatchdog(bool enable)
|
||||||
{
|
|
||||||
if (this->analyzer())
|
|
||||||
{
|
{
|
||||||
|
if (!this->analyzer()) { return false; }
|
||||||
this->analyzer()->setEnabled(enable);
|
this->analyzer()->setEnabled(enable);
|
||||||
}
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAirspaceMonitor::testCreateDummyOnlineAtcStations(int number)
|
void CAirspaceMonitor::testCreateDummyOnlineAtcStations(int number)
|
||||||
@@ -976,10 +975,20 @@ namespace BlackCore
|
|||||||
if (!correctedSituation.hasGroundElevation() && !correctedSituation.canLikelySkipNearGroundInterpolation())
|
if (!correctedSituation.hasGroundElevation() && !correctedSituation.canLikelySkipNearGroundInterpolation())
|
||||||
{
|
{
|
||||||
// fetch from cache or request
|
// fetch from cache or request
|
||||||
const CLength distance(correctedSituation.getDistancePerTime250ms()); // distnacee per ms
|
const CAircraftSituationList situations = this->remoteAircraftSituations(callsign);
|
||||||
const CElevationPlane ep = this->findClosestElevationWithinRangeOrRequest(correctedSituation, distance, callsign);
|
CElevationPlane ep = situations.findCLosestElevationWithinRange(correctedSituation, correctedSituation.getDistancePerTime(100, CElevationPlane::singlePointRadius()));
|
||||||
|
if (!ep.isNull())
|
||||||
|
{
|
||||||
|
correctedSituation.setGroundElevation(ep, CAircraftSituation::FromOtherSituations);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const CLength distance(correctedSituation.getDistancePerTime250ms(CElevationPlane::singlePointRadius())); // distnacee per ms
|
||||||
|
ep = this->findClosestElevationWithinRangeOrRequest(correctedSituation, distance, callsign);
|
||||||
Q_ASSERT_X(ep.isNull() || !ep.getRadius().isNull(), Q_FUNC_INFO, "null radius");
|
Q_ASSERT_X(ep.isNull() || !ep.getRadius().isNull(), Q_FUNC_INFO, "null radius");
|
||||||
correctedSituation.setGroundElevation(ep, CAircraftSituation::FromCache);
|
correctedSituation.setGroundElevation(ep, CAircraftSituation::FromCache);
|
||||||
|
}
|
||||||
|
|
||||||
if (!correctedSituation.hasGroundElevation())
|
if (!correctedSituation.hasGroundElevation())
|
||||||
{
|
{
|
||||||
// we have a new situation, so we try to get the elevation
|
// we have a new situation, so we try to get the elevation
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ namespace BlackCore
|
|||||||
CAirspaceAnalyzer *analyzer() const { return m_analyzer; }
|
CAirspaceAnalyzer *analyzer() const { return m_analyzer; }
|
||||||
|
|
||||||
//! \copydoc CAirspaceAnalyzer::setEnabled
|
//! \copydoc CAirspaceAnalyzer::setEnabled
|
||||||
void enableWatchdog(bool enable);
|
bool enableWatchdog(bool enable);
|
||||||
|
|
||||||
//! Gracefully shut down, e.g. for thread safety
|
//! Gracefully shut down, e.g. for thread safety
|
||||||
void gracefulShutdown();
|
void gracefulShutdown();
|
||||||
|
|||||||
Reference in New Issue
Block a user