refs #793, added updateAircraftNetworkModel in provider

* adjusted network context (implementing provider interface)
* and airspace monitor (also implementing provider interface)
* also formatted provider / context to new style (less copydoc)
This commit is contained in:
Klaus Basan
2016-10-31 16:23:54 +01:00
parent 0dd9bce697
commit ca6f3b15b7
12 changed files with 108 additions and 149 deletions

View File

@@ -223,6 +223,14 @@ namespace BlackCore
return c > 0;
}
bool CAirspaceMonitor::updateAircraftNetworkModel(const CCallsign &callsign, const CAircraftModel &model, const CIdentifier &originator)
{
if (CIdentifiable::isMyIdentifier(originator)) { return false; }
const CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexNetworkModel, CVariant::from(model));
const int c = this->updateAircraftInRange(callsign, vm);
return c > 0;
}
bool CAirspaceMonitor::updateFastPositionEnabled(const CCallsign &callsign, bool enableFastPositonUpdates)
{
const CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexFastPositionUpdates, CVariant::fromValue(enableFastPositonUpdates));
@@ -928,6 +936,7 @@ namespace BlackCore
// Use anonymous as originator here, since the remote aircraft provider is ourselves and the call to updateAircraftModel() would
// return without doing anything.
this->updateAircraftModel(callsign, model, CIdentifier::anonymous());
this->updateAircraftNetworkModel(callsign, model, CIdentifier::anonymous());
}
else
{