mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 07:15:34 +08:00
Add method in ISimulator to get aircraft model
Route AircraftModel requests from Context Simulator to ISimulator refs #235
This commit is contained in:
@@ -89,7 +89,11 @@ namespace BlackCore
|
||||
|
||||
Network::CAircraftModel CContextSimulator::getOwnAircraftModel() const
|
||||
{
|
||||
return this->m_aircraftModel;
|
||||
// If no ISimulator object is available, return a dummy.
|
||||
if (!m_simulator)
|
||||
return Network::CAircraftModel();
|
||||
|
||||
return this->m_simulator->getAircraftModel();
|
||||
}
|
||||
|
||||
bool CContextSimulator::loadSimulatorPlugin(const CSimulatorInfo &simulatorInfo)
|
||||
|
||||
@@ -32,9 +32,6 @@ namespace BlackCore
|
||||
//! \brief Destructor
|
||||
virtual ~CContextSimulator();
|
||||
|
||||
//! Model name, e.g. as used with FSX "Cessna C172 Skyhawk"
|
||||
void setModelName(const QString &modelName) { this->m_aircraftModel.setQueriedModelString(modelName); }
|
||||
|
||||
public slots:
|
||||
|
||||
//! \copydoc IContextSimulator::getSimulatorPluginList()
|
||||
@@ -107,6 +104,7 @@ namespace BlackCore
|
||||
void findSimulatorPlugins();
|
||||
|
||||
BlackMisc::Network::CAircraftModel m_aircraftModel;
|
||||
BlackMisc::Aviation::CAircraft m_ownAircraft;
|
||||
BlackCore::ISimulator *m_simulator;
|
||||
|
||||
QTimer *m_updateTimer;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "blacksim/simulatorinfo.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/avaircraft.h"
|
||||
#include "blackmisc/nwaircraftmodel.h"
|
||||
#include <QObject>
|
||||
|
||||
namespace BlackCore
|
||||
@@ -79,6 +80,9 @@ namespace BlackCore
|
||||
//! Display a status message in the simulator
|
||||
virtual void displayStatusMessage(const BlackMisc::CStatusMessage &message) const = 0;
|
||||
|
||||
//! Aircraft Model
|
||||
virtual BlackMisc::Network::CAircraftModel getAircraftModel() const = 0;
|
||||
|
||||
signals:
|
||||
//! Emitted when the connection status has changed
|
||||
void statusChanged(ISimulator::Status status);
|
||||
|
||||
Reference in New Issue
Block a user