mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Remove ISimulator::getSimulatorInfo()
To provide maximum flexibility, the simulator info is specified by each plugin in the JSON metadata file. * Renamed SCimulatorInfo to CSimulatorPluginInfo * Removed pre-defined simulator infos (UnspecifiedSim, FSX, etc) * CContextSimulator keeps track of which plugin is loaded and its info * QSignalMapper keeps track of which listener emitted the simulatorStared() signal * CSimulatorPluginInfo contains name, simulator name and description * TODO: GUI part * TODO: CTestFsCommon
This commit is contained in:
committed by
Roland Winklmeier
parent
3897fb2d1a
commit
63e48ae332
@@ -36,7 +36,7 @@ namespace BlackSimPlugin
|
||||
{
|
||||
|
||||
CSimulatorXPlane::CSimulatorXPlane(IOwnAircraftProvider *ownAircraftProvider, IRemoteAircraftProvider *remoteAircraftProvider, QObject *parent) :
|
||||
CSimulatorCommon(CSimulatorInfo::XP(), ownAircraftProvider, remoteAircraftProvider, parent)
|
||||
CSimulatorCommon(ownAircraftProvider, remoteAircraftProvider, parent)
|
||||
{
|
||||
m_watcher = new QDBusServiceWatcher(this);
|
||||
m_watcher->setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
|
||||
@@ -458,7 +458,7 @@ namespace BlackSimPlugin
|
||||
void CSimulatorXPlaneListener::ps_serviceRegistered(const QString &serviceName)
|
||||
{
|
||||
if (serviceName == xbusServiceName())
|
||||
emit simulatorStarted(m_simulatorInfo);
|
||||
emit simulatorStarted();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -194,7 +194,6 @@ namespace BlackSimPlugin
|
||||
private:
|
||||
QDBusConnection m_conn { "default" };
|
||||
QDBusServiceWatcher* m_watcher { nullptr };
|
||||
const BlackSim::CSimulatorInfo m_simulatorInfo = BlackSim::CSimulatorInfo::XP();
|
||||
|
||||
};
|
||||
|
||||
@@ -212,10 +211,7 @@ namespace BlackSimPlugin
|
||||
BlackMisc::Simulation::IRemoteAircraftProvider *renderedAircraftProvider,
|
||||
QObject *parent) override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulatorFactory::getSimulatorInfo
|
||||
virtual BlackSim::CSimulatorInfo getSimulatorInfo() const override { return BlackSim::CSimulatorInfo::XP(); }
|
||||
|
||||
//! \copydoc BlackCore::ISimulatorFactory::getListener
|
||||
//! \copydoc BlackCore::ISimulatorFactory::createListener
|
||||
virtual BlackCore::ISimulatorListener *createListener(QObject *parent = nullptr) override { return new CSimulatorXPlaneListener(parent); }
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"short_name" : "XP",
|
||||
"full_name" : "X-Plane"
|
||||
"name" : "swift_generic_xplane",
|
||||
"simulator" : "X-Plane",
|
||||
"description" : "X-Plane support via the xbus plugin"
|
||||
}
|
||||
Reference in New Issue
Block a user