mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-29 20:55:42 +08:00
Style and comments
This commit is contained in:
@@ -70,6 +70,7 @@ namespace BlackMisc
|
|||||||
CAircraftSituationChange();
|
CAircraftSituationChange();
|
||||||
|
|
||||||
//! Ctor with n situations
|
//! 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);
|
CAircraftSituationChange(const CAircraftSituationList &situations, const PhysicalQuantities::CLength &cg, bool isVtol, bool alreadySortedLatestFirst = false, bool calcStdDeviations = false);
|
||||||
|
|
||||||
//! Get callsign
|
//! Get callsign
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ namespace BlackMisc
|
|||||||
if (elevationPlane.isNull()) { return 0; }
|
if (elevationPlane.isNull()) { return 0; }
|
||||||
if (this->isEmpty()) { 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");
|
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);
|
const CAircraftSituationChange simpleChange(*this, model.getCG(), model.isVtol(), true, false);
|
||||||
int c = 0; // changed elevations
|
int c = 0; // changed elevations
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ namespace BlackMisc
|
|||||||
const CAircraftSituationChangeList changes = this->remoteAircraftSituationChanges(m_callsign);
|
const CAircraftSituationChangeList changes = this->remoteAircraftSituationChanges(m_callsign);
|
||||||
m_pastSituationsChange = (changes.size() > 1) ? changes[1] : CAircraftSituationChange::null();
|
m_pastSituationsChange = (changes.size() > 1) ? changes[1] : CAircraftSituationChange::null();
|
||||||
|
|
||||||
|
// fixing offset
|
||||||
if (setup.isFixingSceneryOffset() && m_pastSituationsChange.hasSceneryDeviation() && m_model.hasCG())
|
if (setup.isFixingSceneryOffset() && m_pastSituationsChange.hasSceneryDeviation() && m_model.hasCG())
|
||||||
{
|
{
|
||||||
const CLength os = m_pastSituationsChange.getGuessedSceneryDeviationCG();
|
const CLength os = m_pastSituationsChange.getGuessedSceneryDeviationCG();
|
||||||
|
|||||||
@@ -416,8 +416,9 @@ namespace BlackMisc
|
|||||||
|
|
||||||
void CRemoteAircraftProvider::storeChange(const CAircraftSituationChange &change)
|
void CRemoteAircraftProvider::storeChange(const CAircraftSituationChange &change)
|
||||||
{
|
{
|
||||||
QWriteLocker lock(&m_lockChanges);
|
// a change with the same timestamp will be replaced
|
||||||
const CCallsign cs(change.getCallsign());
|
const CCallsign cs(change.getCallsign());
|
||||||
|
QWriteLocker lock(&m_lockChanges);
|
||||||
CAircraftSituationChangeList &changeList = m_changesByCallsign[cs];
|
CAircraftSituationChangeList &changeList = m_changesByCallsign[cs];
|
||||||
changeList.push_frontKeepLatestAdjustedFirst(change, true, IRemoteAircraftProvider::MaxSituationsPerCallsign);
|
changeList.push_frontKeepLatestAdjustedFirst(change, true, IRemoteAircraftProvider::MaxSituationsPerCallsign);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -420,7 +420,7 @@ namespace BlackMisc
|
|||||||
Aviation::CAircraftSituationPerCallsign m_latestSituationByCallsign; //!< latest situations, for performance reasons per callsign, thread safe access required
|
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::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::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
|
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_situationsAdded = 0; //!< total number of situations added, thread safe access required
|
||||||
int m_partsAdded = 0; //!< total number of parts added, thread safe access required
|
int m_partsAdded = 0; //!< total number of parts added, thread safe access required
|
||||||
|
|||||||
Reference in New Issue
Block a user