Ref T773, allow to update CG per model string

* needed if CG is overridden by "dot command"
* update all existing aircraft (in range) if changing CG per modelstring
* made "overriddenCGorDefault" public so it can be checked if overridden
* use overridden value in CContextSimulator::xCtxAddedRemoteAircraftReadyForModelMatching
* allow to clear overridden values
This commit is contained in:
Klaus Basan
2020-03-05 00:19:33 +01:00
committed by Mat Sutcliffe
parent 93652ccd43
commit 2999aebf37
10 changed files with 252 additions and 43 deletions

View File

@@ -1109,6 +1109,13 @@ namespace BlackCore
return c;
}
CCallsignSet CContextNetwork::updateCGForModel(const QString &modelString, const CLength &cg)
{
if (this->isDebugEnabled()) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << modelString << cg.valueRoundedWithUnit(1); }
const CCallsignSet set = m_airspace->updateCGForModel(modelString, cg);
return set;
}
bool CContextNetwork::updateCGAndModelString(const CCallsign &callsign, const CLength &cg, const QString &modelString)
{
if (this->isDebugEnabled()) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << callsign << cg.valueRoundedWithUnit(1) << modelString; }