mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-11 06:25:33 +08:00
Ref T260, adjusted context/remote provider
* signal from simulator -> context * return number of updated situations
This commit is contained in:
committed by
Roland Winklmeier
parent
b706a4adbe
commit
e97de13545
@@ -699,7 +699,7 @@ namespace BlackCore
|
||||
return c;
|
||||
}
|
||||
|
||||
bool CContextNetwork::updateAircraftGroundElevation(const CCallsign &callsign, const CElevationPlane &elevation)
|
||||
int CContextNetwork::updateAircraftGroundElevation(const CCallsign &callsign, const CElevationPlane &elevation)
|
||||
{
|
||||
return m_airspace->updateAircraftGroundElevation(callsign, elevation);
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace BlackCore
|
||||
std::function<void(const BlackMisc::Simulation::CAirspaceAircraftSnapshot &)> aircraftSnapshotSlot
|
||||
) override;
|
||||
virtual bool updateAircraftRendered(const BlackMisc::Aviation::CCallsign &callsign, bool rendered) override;
|
||||
virtual bool updateAircraftGroundElevation(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Geo::CElevationPlane &elevation) override;
|
||||
virtual int updateAircraftGroundElevation(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Geo::CElevationPlane &elevation) override;
|
||||
virtual void updateMarkAllAsNotRendered() override;
|
||||
virtual BlackMisc::Simulation::CAirspaceAircraftSnapshot getLatestAirspaceAircraftSnapshot() const override;
|
||||
//! @}
|
||||
|
||||
@@ -358,6 +358,8 @@ namespace BlackCore
|
||||
Q_ASSERT(c);
|
||||
c = connect(simulator, &ISimulator::physicallyAddingRemoteModelFailed, this, &CContextSimulator::addingRemoteAircraftFailed);
|
||||
Q_ASSERT(c);
|
||||
c = connect(simulator, &ISimulator::receivedRequestedElevation, this, &CContextSimulator::onReceivedRequestedElevation);
|
||||
Q_ASSERT(c);
|
||||
c = connect(simulator, &ISimulator::ownAircraftModelChanged, this, &IContextSimulator::ownAircraftModelChanged);
|
||||
Q_ASSERT(c);
|
||||
c = connect(simulator, &ISimulator::aircraftRenderingChanged, this, &IContextSimulator::aircraftRenderingChanged);
|
||||
@@ -557,6 +559,12 @@ namespace BlackCore
|
||||
emit getIContextOwnAircraft()->changedAircraftCockpit(ownAircraft, IContextSimulator::InterfaceName());
|
||||
}
|
||||
|
||||
void CContextSimulator::onReceivedRequestedElevation(const CElevationPlane &plane, const CCallsign &callsign)
|
||||
{
|
||||
if (!isSimulatorSimulating()) { return; }
|
||||
emit this->receivedRequestedElevation(plane, callsign);
|
||||
}
|
||||
|
||||
void CContextSimulator::xCtxChangedRemoteAircraftModel(const CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator)
|
||||
{
|
||||
if (CIdentifiable::isMyIdentifier(originator)) { return; }
|
||||
|
||||
@@ -66,13 +66,6 @@ namespace BlackCore
|
||||
friend class BlackCore::CCoreFacade;
|
||||
friend class IContextSimulator;
|
||||
|
||||
public:
|
||||
//! Destructor
|
||||
virtual ~CContextSimulator();
|
||||
|
||||
//! Gracefully shut down, e.g. for plugin unloading
|
||||
void gracefulShutdown();
|
||||
|
||||
public slots:
|
||||
// ----------------------------- context interface -----------------------------
|
||||
//! \publicsection
|
||||
@@ -126,6 +119,15 @@ namespace BlackCore
|
||||
// ----------------------------- context interface -----------------------------
|
||||
|
||||
public:
|
||||
//! Destructor
|
||||
virtual ~CContextSimulator();
|
||||
|
||||
//! Gracefully shut down, e.g. for plugin unloading
|
||||
void gracefulShutdown();
|
||||
|
||||
//! Simulator object
|
||||
ISimulator *simulator() const;
|
||||
|
||||
//! Register dot commands
|
||||
static void registerHelp()
|
||||
{
|
||||
@@ -136,8 +138,10 @@ namespace BlackCore
|
||||
BlackMisc::CSimpleCommandParser::registerCommand({".ris parts on|off", "aircraft parts"});
|
||||
}
|
||||
|
||||
//! Simulator object
|
||||
ISimulator *simulator() const;
|
||||
signals:
|
||||
//! A requested elevation has been received
|
||||
//! \remark only meant to be used locally, not via DBus
|
||||
void receivedRequestedElevation(const BlackMisc::Geo::CElevationPlane &plane, const BlackMisc::Aviation::CCallsign &callsign);
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
@@ -192,6 +196,9 @@ namespace BlackCore
|
||||
//! Simulator has changed cockpit
|
||||
void onCockpitChangedFromSimulator(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft);
|
||||
|
||||
//! Received elevation
|
||||
void onReceivedRequestedElevation(const BlackMisc::Geo::CElevationPlane &plane, const BlackMisc::Aviation::CCallsign &callsign);
|
||||
|
||||
//! Failed adding remote aircraft
|
||||
void addingRemoteAircraftFailed(const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft, const BlackMisc::CStatusMessage &message);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user