Style and comments

This commit is contained in:
Klaus Basan
2018-07-12 01:57:56 +02:00
parent dd4ce91744
commit 6af1998f58
5 changed files with 6 additions and 2 deletions

View File

@@ -70,6 +70,7 @@ namespace BlackMisc
CAircraftSituationChange();
//! Ctor with n situations
//! \remark the timestamps of the latest situation will be used
CAircraftSituationChange(const CAircraftSituationList &situations, const PhysicalQuantities::CLength &cg, bool isVtol, bool alreadySortedLatestFirst = false, bool calcStdDeviations = false);
//! Get callsign

View File

@@ -56,6 +56,7 @@ namespace BlackMisc
if (elevationPlane.isNull()) { return 0; }
if (this->isEmpty()) { return 0; }
// the change has the timestamps of the latest situation
Q_ASSERT_X(m_tsAdjustedSortHint == CAircraftSituationList::AdjustedTimestampLatestFirst || this->isSortedAdjustedLatestFirstWithoutNullPositions(), Q_FUNC_INFO, "Need sorted situations without NULL positions");
const CAircraftSituationChange simpleChange(*this, model.getCG(), model.isVtol(), true, false);
int c = 0; // changed elevations

View File

@@ -82,6 +82,7 @@ namespace BlackMisc
const CAircraftSituationChangeList changes = this->remoteAircraftSituationChanges(m_callsign);
m_pastSituationsChange = (changes.size() > 1) ? changes[1] : CAircraftSituationChange::null();
// fixing offset
if (setup.isFixingSceneryOffset() && m_pastSituationsChange.hasSceneryDeviation() && m_model.hasCG())
{
const CLength os = m_pastSituationsChange.getGuessedSceneryDeviationCG();

View File

@@ -416,8 +416,9 @@ namespace BlackMisc
void CRemoteAircraftProvider::storeChange(const CAircraftSituationChange &change)
{
QWriteLocker lock(&m_lockChanges);
// a change with the same timestamp will be replaced
const CCallsign cs(change.getCallsign());
QWriteLocker lock(&m_lockChanges);
CAircraftSituationChangeList &changeList = m_changesByCallsign[cs];
changeList.push_frontKeepLatestAdjustedFirst(change, true, IRemoteAircraftProvider::MaxSituationsPerCallsign);
}

View File

@@ -420,7 +420,7 @@ namespace BlackMisc
Aviation::CAircraftSituationPerCallsign m_latestSituationByCallsign; //!< latest situations, for performance reasons per callsign, thread safe access required
Aviation::CAircraftSituationPerCallsign m_latestOnGroundProviderElevation; //!< situation on ground with elevation from provider
Aviation::CAircraftPartsListPerCallsign m_partsByCallsign; //!< parts, for performance reasons per callsign, thread safe access required
Aviation::CAircraftSituationChangeListPerCallsign m_changesByCallsign; //!< changes, for performance reasons per callsign, thread safe access required
Aviation::CAircraftSituationChangeListPerCallsign m_changesByCallsign; //!< changes, for performance reasons per callsign, thread safe access required (same timestamps as corresponding situations)
Aviation::CCallsignSet m_aircraftWithParts; //!< aircraft supporting parts, thread safe access required
int m_situationsAdded = 0; //!< total number of situations added, thread safe access required
int m_partsAdded = 0; //!< total number of parts added, thread safe access required