mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 11:05:33 +08:00
Ref T717, "testRemoteAircraft" simulator context functions
This commit is contained in:
@@ -313,6 +313,9 @@ namespace BlackCore
|
||||
//! Set matching setup
|
||||
virtual void setMatchingSetup(const BlackMisc::Simulation::CAircraftMatcherSetup &setup) = 0;
|
||||
|
||||
//! Test a remote aircraft
|
||||
virtual bool testRemoteAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, bool add) = 0;
|
||||
|
||||
//! Get matching setup
|
||||
virtual BlackMisc::Simulation::CAircraftMatcherSetup getMatchingSetup() const = 0;
|
||||
|
||||
|
||||
@@ -410,6 +410,15 @@ namespace BlackCore
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::testRemoteAircraft
|
||||
virtual bool testRemoteAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, bool add) override
|
||||
{
|
||||
Q_UNUSED(aircraft);
|
||||
Q_UNUSED(add);
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
return false;
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::setMatchingSetup
|
||||
virtual BlackMisc::Simulation::CAircraftMatcherSetup getMatchingSetup() const override
|
||||
{
|
||||
|
||||
@@ -1002,6 +1002,23 @@ namespace BlackCore
|
||||
return msgs;
|
||||
}
|
||||
|
||||
bool CContextSimulator::testRemoteAircraft(const CSimulatedAircraft &aircraft, bool add)
|
||||
{
|
||||
if (!m_simulatorPlugin.second || !m_simulatorPlugin.second->isConnected()) { return false; }
|
||||
bool added = add;
|
||||
if (add)
|
||||
{
|
||||
m_simulatorPlugin.second->setTestMode(true);
|
||||
added = m_simulatorPlugin.second->logicallyAddRemoteAircraft(aircraft);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_simulatorPlugin.second->logicallyRemoveRemoteAircraft(aircraft.getCallsign());
|
||||
m_simulatorPlugin.second->setTestMode(false); // AFTER we have removed it
|
||||
}
|
||||
return added;
|
||||
}
|
||||
|
||||
bool CContextSimulator::parseCommandLine(const QString &commandLine, const CIdentifier &originator)
|
||||
{
|
||||
Q_UNUSED(originator);
|
||||
|
||||
@@ -127,6 +127,7 @@ namespace BlackCore
|
||||
virtual void setMatchingSetup(const BlackMisc::Simulation::CAircraftMatcherSetup &setup) override;
|
||||
virtual BlackMisc::Simulation::CAircraftMatcherSetup getMatchingSetup() const override;
|
||||
virtual BlackMisc::CStatusMessageList copyFsxTerrainProbe(const BlackMisc::Simulation::CSimulatorInfo &simulator) override;
|
||||
virtual bool testRemoteAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, bool add) override;
|
||||
|
||||
// also in IAircraftModelSetProvider
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSet() const override;
|
||||
|
||||
@@ -370,5 +370,10 @@ namespace BlackCore
|
||||
return m_dBusInterface->callDBusRet<CStatusMessageList>(QLatin1String("copyFsxTerrainProbe"), simulator);
|
||||
}
|
||||
|
||||
bool CContextSimulatorProxy::testRemoteAircraft(const CSimulatedAircraft &aircraft, bool add)
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<bool>(QLatin1String("testRemoteAircraft"), aircraft, add);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -110,6 +110,7 @@ namespace BlackCore
|
||||
virtual void setMatchingSetup(const BlackMisc::Simulation::CAircraftMatcherSetup &setup) override;
|
||||
virtual BlackMisc::Simulation::CAircraftMatcherSetup getMatchingSetup() const override;
|
||||
virtual BlackMisc::CStatusMessageList copyFsxTerrainProbe(const BlackMisc::Simulation::CSimulatorInfo &simulator) override;
|
||||
virtual bool testRemoteAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, bool add) override;
|
||||
//! @}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user