mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Ref T294, display simulator internals correctly
* view rows not selectable * added settings to ISimulator * ISimulator implements initSimulatorInternals() and sets default values * also display plugin name * XPlane using initSimulatorInternals()
This commit is contained in:
@@ -32,6 +32,7 @@ using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::Simulation::Settings;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Weather;
|
||||
@@ -612,6 +613,10 @@ namespace BlackCore
|
||||
|
||||
connect(sApp, &CApplication::aboutToShutdown, this, &ISimulator::unload, Qt::QueuedConnection);
|
||||
|
||||
// info data
|
||||
m_simulatorInternals.setSimulatorName(this->getSimulatorName());
|
||||
m_simulatorInternals.setSwiftPluginName(this->getSimulatorPluginInfo().toQString());
|
||||
|
||||
// info
|
||||
CLogMessage(this).info("Initialized simulator driver: '%1'") << this->getSimulatorInfo().toQString();
|
||||
}
|
||||
@@ -724,6 +729,14 @@ namespace BlackCore
|
||||
// void, can be overridden in specialized drivers
|
||||
}
|
||||
|
||||
void ISimulator::initSimulatorInternals()
|
||||
{
|
||||
const CSimulatorSettings s = this->getSimulatorSettings();
|
||||
m_simulatorInternals.setSimulatorName(this->getSimulatorName());
|
||||
m_simulatorInternals.setSwiftPluginName(this->getSimulatorPluginInfo().toQString());
|
||||
m_simulatorInternals.setSimulatorInstallationDirectory(s.getSimulatorDirectory());
|
||||
}
|
||||
|
||||
void ISimulator::rememberElevationAndCG(const CCallsign &callsign, const QString &modelString, const Geo::CElevationPlane &elevation, const CLength &cg)
|
||||
{
|
||||
if (callsign.isEmpty()) { return; }
|
||||
|
||||
@@ -172,6 +172,9 @@ namespace BlackCore
|
||||
//! Reload weather settings
|
||||
void reloadWeatherSettings();
|
||||
|
||||
//! Settings for current simulator
|
||||
BlackMisc::Simulation::Settings::CSimulatorSettings getSimulatorSettings() const { return m_settings.getSettings(this->getSimulatorInfo()); }
|
||||
|
||||
//! Driver will be unloaded
|
||||
virtual void unload();
|
||||
|
||||
@@ -346,6 +349,9 @@ namespace BlackCore
|
||||
virtual void onSwiftDbAirportsRead();
|
||||
//! @}
|
||||
|
||||
//! Init the internals info
|
||||
virtual void initSimulatorInternals();
|
||||
|
||||
//! Parsed in derived classes
|
||||
virtual bool parseDetails(const BlackMisc::CSimpleCommandParser &parser) = 0;
|
||||
|
||||
@@ -512,6 +518,9 @@ namespace BlackCore
|
||||
BlackMisc::CTokenBucket m_limitUpdateAircraftBucket { 5, 100, 5 }; //!< means 50 per second
|
||||
bool m_limitUpdateAircraft = false; //!< limit the update frequency by using BlackMisc::CTokenBucket
|
||||
|
||||
// general settings
|
||||
BlackMisc::Simulation::Settings::CMultiSimulatorSettings m_settings { this }; //!< simulator settings for all simulators
|
||||
|
||||
// weather
|
||||
bool m_isWeatherActivated = false; //!< Is simulator weather activated?
|
||||
BlackMisc::Geo::CCoordinateGeodetic m_lastWeatherPosition; //!< Own aircraft position at which weather was fetched and injected last
|
||||
|
||||
Reference in New Issue
Block a user