mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +08:00
refs #291, getAirportsInRange for simulator, simulator context
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "blacksim/simulatorinfolist.h"
|
||||
#include "blackmisc/nwaircraftmodel.h"
|
||||
#include "blackmisc/avaircraft.h"
|
||||
#include "blackmisc/avairportlist.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include <QObject>
|
||||
|
||||
@@ -81,6 +82,9 @@ namespace BlackCore
|
||||
//! Simulator info
|
||||
virtual BlackSim::CSimulatorInfo getSimulatorInfo() const = 0;
|
||||
|
||||
//! Airports in range
|
||||
virtual BlackMisc::Aviation::CAirportList getAirportsInRange() const = 0;
|
||||
|
||||
//! Aircraft model
|
||||
virtual BlackMisc::Network::CAircraftModel getOwnAircraftModel() const = 0;
|
||||
|
||||
|
||||
@@ -93,12 +93,20 @@ namespace BlackCore
|
||||
Network::CAircraftModel CContextSimulator::getOwnAircraftModel() const
|
||||
{
|
||||
// If no ISimulator object is available, return a dummy.
|
||||
if (!m_simulator)
|
||||
return Network::CAircraftModel();
|
||||
if (!m_simulator) { return Network::CAircraftModel(); }
|
||||
|
||||
return this->m_simulator->getAircraftModel();
|
||||
}
|
||||
|
||||
CAirportList CContextSimulator::getAirportsInRange() const
|
||||
{
|
||||
// If no ISimulator object is available, return a dummy.
|
||||
if (!m_simulator) { return CAirportList(); }
|
||||
|
||||
return this->m_simulator->getAirportsInRange();
|
||||
}
|
||||
}
|
||||
|
||||
bool CContextSimulator::loadSimulatorPlugin(const CSimulatorInfo &simulatorInfo)
|
||||
{
|
||||
if (this->m_simulator && this->m_simulator->getSimulatorInfo() == simulatorInfo) { return true; } // already loaded
|
||||
|
||||
@@ -59,6 +59,9 @@ namespace BlackCore
|
||||
//! \copydoc IContextSimulator::getAircraftModel()
|
||||
virtual BlackMisc::Network::CAircraftModel getOwnAircraftModel() const override;
|
||||
|
||||
//! \copydoc IContextSimulator::getAirportsInRange()
|
||||
virtual BlackMisc::Aviation::CAirportList getAirportsInRange() const override;
|
||||
|
||||
//! \copydoc IContextSimulator::loadSimulatorPlugin()
|
||||
virtual bool loadSimulatorPlugin(const BlackSim::CSimulatorInfo &simulatorInfo) override;
|
||||
|
||||
|
||||
@@ -63,6 +63,11 @@ namespace BlackCore
|
||||
return m_dBusInterface->callDBusRet<BlackMisc::Network::CAircraftModel>(QLatin1Literal("getOwnAircraftModel"));
|
||||
}
|
||||
|
||||
CAirportList CContextSimulatorProxy::getAirportsInRange() const
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<BlackMisc::Aviation::CAirportList>(QLatin1Literal("getAirportsInRange"));
|
||||
}
|
||||
|
||||
BlackSim::CSimulatorInfo CContextSimulatorProxy::getSimulatorInfo() const
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<BlackSim::CSimulatorInfo>(QLatin1Literal("getSimulatorInfo"));
|
||||
|
||||
@@ -57,6 +57,9 @@ namespace BlackCore
|
||||
//! \copydoc IContextSimulator::getAircraftModel()
|
||||
virtual BlackMisc::Network::CAircraftModel getOwnAircraftModel() const override;
|
||||
|
||||
//! \copydoc IContextSimulator::getAirportsInRange()
|
||||
virtual BlackMisc::Aviation::CAirportList getAirportsInRange() const override;
|
||||
|
||||
//! \copydoc IContextSimulator::getSimulatorInfo
|
||||
virtual BlackSim::CSimulatorInfo getSimulatorInfo() const override;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "blacksim/simulatorinfo.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/avaircraft.h"
|
||||
#include "blackmisc/avairportlist.h"
|
||||
#include "blackmisc/nwaircraftmodel.h"
|
||||
#include <QObject>
|
||||
|
||||
@@ -84,6 +85,10 @@ namespace BlackCore
|
||||
//! Aircraft Model
|
||||
virtual BlackMisc::Network::CAircraftModel getAircraftModel() const = 0;
|
||||
|
||||
//! Airports in range
|
||||
virtual BlackMisc::Aviation::CAirportList getAirportsInRange() const = 0;
|
||||
|
||||
|
||||
signals:
|
||||
//! Emitted when the connection status has changed
|
||||
void statusChanged(ISimulator::Status status);
|
||||
|
||||
Reference in New Issue
Block a user