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:
Klaus Basan
2018-10-28 19:17:26 +01:00
parent 75d57b4afa
commit 38bd626638
3 changed files with 15 additions and 3 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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