mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Exclude emulated driver from FSX settings as this will cause issues
The emulated driver looks like P3D/FSD, but is a different class
This commit is contained in:
@@ -27,6 +27,11 @@ namespace BlackSimPlugin
|
||||
//! Common base class for MS flight simulators
|
||||
class CSimulatorFsCommon : public Common::CSimulatorPluginCommon
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(BlackCore::ISimulator)
|
||||
Q_INTERFACES(BlackMisc::Simulation::ISimulationEnvironmentProvider)
|
||||
Q_INTERFACES(BlackMisc::Simulation::IInterpolationSetupProvider)
|
||||
|
||||
public:
|
||||
//! Destructor
|
||||
virtual ~CSimulatorFsCommon() override;
|
||||
|
||||
@@ -134,11 +134,16 @@ namespace BlackSimPlugin
|
||||
|
||||
CSimulatorFsxCommon *CFsxSettingsComponent::getFsxOrP3DSimulator() const
|
||||
{
|
||||
if (!sGui || !sGui->getISimulator() || sGui->isShuttingDown()) { return nullptr; }
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->getIContextSimulator() || !sGui->getISimulator()) { return nullptr; }
|
||||
const CSimulatorPluginInfo plugin = sGui->getIContextSimulator()->getSimulatorPluginInfo();
|
||||
if (plugin.isEmulatedPlugin()) { return nullptr; } // cast would fail
|
||||
|
||||
ISimulator *simulator = sGui->getISimulator();
|
||||
if (!simulator->getSimulatorInfo().isFsxP3DFamily()) { return nullptr; }
|
||||
if (simulator->getSimulatorInfo() != m_simulator) { return nullptr; }
|
||||
CSimulatorFsxCommon *fsx = static_cast<CSimulatorFsxCommon *>(simulator); // wonder why qobject_cast does not work here
|
||||
if (simulator->getSimulatorInfo() != m_simulator) { return nullptr; }
|
||||
|
||||
//! \todo KB 11/18 wonder why qobject_cast does not work here
|
||||
CSimulatorFsxCommon *fsx = static_cast<CSimulatorFsxCommon *>(simulator);
|
||||
return fsx;
|
||||
}
|
||||
} // ns
|
||||
|
||||
@@ -119,6 +119,8 @@ namespace BlackSimPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(BlackCore::ISimulator)
|
||||
Q_INTERFACES(BlackMisc::Simulation::ISimulationEnvironmentProvider)
|
||||
Q_INTERFACES(BlackMisc::Simulation::IInterpolationSetupProvider)
|
||||
|
||||
public:
|
||||
//! Constructor, parameters as in \sa BlackCore::ISimulatorFactory::create
|
||||
|
||||
Reference in New Issue
Block a user