mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
[AFV] Utility functions to update simulator settings
This commit is contained in:
committed by
Mat Sutcliffe
parent
124432ceb1
commit
63cc2a7e3e
@@ -17,6 +17,7 @@
|
||||
|
||||
using namespace BlackConfig;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
|
||||
namespace BlackCore
|
||||
@@ -61,6 +62,25 @@ namespace BlackCore
|
||||
return static_cast<ISimulator::SimulatorStatus>(this->getSimulatorStatus());
|
||||
}
|
||||
|
||||
CSimulatorInfo IContextSimulator::getSimulatorInfo() const
|
||||
{
|
||||
return this->getSimulatorPluginInfo().getSimulatorInfo();
|
||||
}
|
||||
|
||||
bool IContextSimulator::updateCurrentSettings(const Simulation::Settings::CSimulatorSettings &settings)
|
||||
{
|
||||
const CSimulatorInfo sim = this->getSimulatorInfo();
|
||||
if (!sim.isSingleSimulator()) { return false; }
|
||||
return this->setSimulatorSettings(settings, sim);
|
||||
}
|
||||
|
||||
bool IContextSimulator::updateCurrentSettingComIntegration(bool comIntegration)
|
||||
{
|
||||
Simulation::Settings::CSimulatorSettings settings = this->getSimulatorSettings();
|
||||
settings.setComIntegrated(comIntegration);
|
||||
return this->updateCurrentSettings(settings);
|
||||
}
|
||||
|
||||
bool IContextSimulator::isSimulatorAvailable() const
|
||||
{
|
||||
return CBuildConfig::isCompiledWithFlightSimulatorSupport() && !this->getSimulatorPluginInfo().isUnspecified();
|
||||
|
||||
@@ -91,6 +91,17 @@ namespace BlackCore
|
||||
//! \fixme To be removed with Qt 5.5 when getSimualtorStatus directly provides the enum
|
||||
BlackCore::ISimulator::SimulatorStatus getSimulatorStatusEnum() const;
|
||||
|
||||
// ---- some convenienc functions implemented on interface level
|
||||
|
||||
//! Current simulator
|
||||
BlackMisc::Simulation::CSimulatorInfo getSimulatorInfo() const;
|
||||
|
||||
//! Update current settings
|
||||
bool updateCurrentSettings(const BlackMisc::Simulation::Settings::CSimulatorSettings &settings);
|
||||
|
||||
//! Update current setting for COM integration (aka "synced")
|
||||
bool updateCurrentSettingComIntegration(bool comIntegration);
|
||||
|
||||
signals:
|
||||
//! Simulator combined status
|
||||
//! \sa ISimulator::SimulatorStatus
|
||||
|
||||
Reference in New Issue
Block a user