ChangedModel in ownAircraft context was not really used.

However, there are cases where the "own model" is changed via own model context, mostly in the emulated driver.

* made changedModel -> ps_changedModel a "private" signal
* connected it to simulator context
* used identifier to avoid roundtrips

So the "ownAircraftModelChanged" signal of the simulator context is to be used
This commit is contained in:
Klaus Basan
2019-01-26 20:08:09 +01:00
committed by Mat Sutcliffe
parent d12f164d26
commit 73e566a76e
7 changed files with 44 additions and 11 deletions

View File

@@ -113,6 +113,11 @@ namespace BlackCore
//! \copydoc BlackMisc::IProvider::asQObject
virtual QObject *asQObject() override { return this; }
signals:
//! Changed aircraft model
//! \private Use ISimulatorContext::ownAircraftModelChanged
void ps_changedModel(const BlackMisc::Simulation::CAircraftModel &model, const BlackMisc::CIdentifier &identifier);
public slots:
//! \copydoc IContextOwnAircraft::getOwnAircraft()
//! \ingroup ownaircraftprovider
@@ -226,7 +231,7 @@ namespace BlackCore
//! Simulator model has been changed
//! \ingroup crosscontextfunction
void xCtxChangedSimulatorModel(const BlackMisc::Simulation::CAircraftModel &model);
void xCtxChangedSimulatorModel(const BlackMisc::Simulation::CAircraftModel &model, const BlackMisc::CIdentifier &identifier);
//! Simulator status changed
//! \ingroup crosscontextfunction
@@ -249,6 +254,9 @@ namespace BlackCore
//! Update position history
void evaluateUpdateHistory();
//! Update own model and emit signal with identifier
bool updateOwnModel(const BlackMisc::Simulation::CAircraftModel &model, const BlackMisc::CIdentifier &identifier);
//! Reverse lookup of the model against DB data
static BlackMisc::Simulation::CAircraftModel reverseLookupModel(const BlackMisc::Simulation::CAircraftModel &model);
};