Ref T773, style

This commit is contained in:
Klaus Basan
2020-02-11 00:07:00 +01:00
committed by Mat Sutcliffe
parent f4f34341e6
commit 5f1bd14fcf
8 changed files with 48 additions and 44 deletions

View File

@@ -1363,18 +1363,22 @@ namespace BlackCore
if (!correctedSituation.hasGroundElevation() && !canLikelySkipNearGround)
{
// fetch from cache or request
const CAircraftSituationList situations = this->remoteAircraftSituations(callsign);
const CAircraftSituationList situations = this->remoteAircraftSituations(callsign);
const CAircraftSituation situationWithElv = situations.findCLosestElevationWithinRange(correctedSituation, correctedSituation.getDistancePerTime(100, CElevationPlane::singlePointRadius()));
if (!situationWithElv.getGroundElevation().isNull())
{
// from nearby situations of own aircraft
correctedSituation.transferGroundElevation(situationWithElv);
}
else
{
// from cache
const CLength distance(correctedSituation.getDistancePerTime250ms(CElevationPlane::singlePointRadius())); // distance per ms
const CElevationPlane ep = this->findClosestElevationWithinRangeOrRequest(correctedSituation, distance, callsign);
haveRequestedElevation = ep.isNull(); // NULL means we requested
Q_ASSERT_X(ep.isNull() || !ep.getRadius().isNull(), Q_FUNC_INFO, "null radius");
haveRequestedElevation = ep.isNull(); // NULL means we requested
Q_ASSERT_X(haveRequestedElevation || !ep.getRadius().isNull(), Q_FUNC_INFO, "null radius");
// also can handle NULL elevations
correctedSituation.setGroundElevation(ep, CAircraftSituation::FromCache);
}
@@ -1382,7 +1386,7 @@ namespace BlackCore
{
// we have a new situation, so we try to get the elevation
// so far we have requested it, but we set it upfront either by
// a) average value from other plane in the vicinity or
// a) average value from other planes in the vicinity or
// b) by extrapolating
const CElevationPlane averagePlane = this->averageElevationOfNonMovingAircraft(situation, CElevationPlane::majorAirportRadius(), 2);
if (!averagePlane.isNull())
@@ -1392,7 +1396,7 @@ namespace BlackCore
else
{
// values before updating (i.e. "storing") so the new situation is not yet considered
const CAircraftSituationList oldSituations = this->remoteAircraftSituations(callsign);
const CAircraftSituationList oldSituations = this->remoteAircraftSituations(callsign);
const CAircraftSituationChangeList oldChanges = this->remoteAircraftSituationChanges(callsign);
if (oldSituations.size() > 1)
{

View File

@@ -298,14 +298,14 @@ namespace BlackCore
static constexpr int FastProcessIntervalMs = 50; //!< interval in ms
QTimer m_fastProcessTimer; //!< process timer for fast updates
//! Processing by timer
//! Fast processing by timer
void fastProcessing();
// Processing for validations etc. (slow)
static constexpr int SlowProcessIntervalMs = 125 * 1000; //!< interval in ms
QTimer m_slowProcessTimer; //!< process timer for slow updates
//! Slow processing
//! Slow processing by timer
void slowProcessing();
// model matching times

View File

@@ -408,7 +408,7 @@ namespace BlackCore
protected:
//! Constructor with all the providers
ISimulator(const BlackMisc::Simulation::CSimulatorPluginInfo &pluginInfo,
BlackMisc::Simulation::IOwnAircraftProvider *ownAircraftProvider,
BlackMisc::Simulation::IOwnAircraftProvider *ownAircraftProvider,
BlackMisc::Simulation::IRemoteAircraftProvider *remoteAircraftProvider,
BlackMisc::Weather::IWeatherGridProvider *weatherGridProvider,
BlackMisc::Network::IClientProvider *clientProvider,