mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Allow to save interpolation/rendering setup
- setting trait - save/load logic in context - adjusted UI, allow to reset global setup
This commit is contained in:
@@ -306,7 +306,7 @@ namespace BlackCore
|
||||
CInterpolationAndRenderingSetupGlobal CContextSimulator::getInterpolationAndRenderingSetupGlobal() const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (m_simulatorPlugin.first.isUnspecified()) { return CInterpolationAndRenderingSetupGlobal(); }
|
||||
if (m_simulatorPlugin.first.isUnspecified()) { return m_renderSettings.get(); }
|
||||
Q_ASSERT(m_simulatorPlugin.second);
|
||||
return m_simulatorPlugin.second->getInterpolationSetupGlobal();
|
||||
}
|
||||
@@ -338,6 +338,12 @@ namespace BlackCore
|
||||
void CContextSimulator::setInterpolationAndRenderingSetupGlobal(const CInterpolationAndRenderingSetupGlobal &setup)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << setup; }
|
||||
|
||||
// anyway save for future reference
|
||||
const CStatusMessage m = m_renderSettings.setAndSave(setup);
|
||||
CLogMessage::preformatted(m);
|
||||
|
||||
// transfer to sim
|
||||
if (m_simulatorPlugin.first.isUnspecified()) { return; }
|
||||
Q_ASSERT(m_simulatorPlugin.second);
|
||||
m_simulatorPlugin.second->setInterpolationSetupGlobal(setup);
|
||||
@@ -439,8 +445,9 @@ namespace BlackCore
|
||||
// when everything is set up connected, update the current plugin info
|
||||
m_simulatorPlugin.first = simulatorPluginInfo;
|
||||
m_simulatorPlugin.second = simulator;
|
||||
m_simulatorPlugin.second->setInterpolationSetupGlobal(m_renderSettings.get());
|
||||
|
||||
// Emit signal after this function completes
|
||||
// Emit signal after this function completes completely decoupled
|
||||
QPointer<CContextSimulator> myself(this);
|
||||
QTimer::singleShot(0, this, [ = ]
|
||||
{
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "blackmisc/simulation/data/modelcaches.h"
|
||||
#include "blackmisc/simulation/settings/modelmatchersettings.h"
|
||||
#include "blackmisc/simulation/settings/simulatorsettings.h"
|
||||
#include "blackmisc/simulation/settings/interpolationrenderingsetupsettings.h"
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
#include "blackmisc/simulation/interpolationsetuplist.h"
|
||||
#include "blackmisc/simulation/remoteaircraftprovider.h"
|
||||
@@ -244,18 +245,20 @@ namespace BlackCore
|
||||
CWeatherManager m_weatherManager { this }; //!< weather management
|
||||
CAircraftMatcher m_aircraftMatcher { this }; //!< model matcher
|
||||
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::CStatusMessageList> m_matchingMessages; //!< all matching log messages per callsign
|
||||
BlackMisc::CSetting<BlackMisc::Simulation::Settings::TModelMatching> m_matchingSettings { this }; //!< settings
|
||||
|
||||
bool m_initallyAddAircraft = false;
|
||||
bool m_enableMatchingMessages = true;
|
||||
bool m_isWeatherActivated = false;
|
||||
|
||||
// settings
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TSimulatorLastSelection> m_modelSetSimulator { this }; //!< current simulator (used with radio buttons)
|
||||
BlackMisc::Simulation::Settings::CMultiSimulatorSettings m_simulatorSettings { this }; //!< for directories of XPlane
|
||||
BlackMisc::CSettingReadOnly<BlackMisc::Simulation::Settings::TSimulatorMessages> m_messageSettings { this }; //!< settings for messages
|
||||
BlackMisc::CSettingReadOnly<Application::TEnabledSimulators> m_enabledSimulators { this, &CContextSimulator::changeEnabledSimulators };
|
||||
QString m_networkSessionId; //!< Network session of CServer::getServerSessionId, if not connected empty
|
||||
|
||||
// settings
|
||||
BlackMisc::CSettingReadOnly<Application::TEnabledSimulators> m_enabledSimulators { this, &CContextSimulator::changeEnabledSimulators };
|
||||
BlackMisc::CSetting<BlackMisc::Simulation::Settings::TModelMatching> m_matchingSettings { this }; //!< settings
|
||||
BlackMisc::CData<BlackMisc::Simulation::Data::TSimulatorLastSelection> m_modelSetSimulator { this }; //!< current simulator (used with radio buttons)
|
||||
BlackMisc::Simulation::Settings::CMultiSimulatorSettings m_simulatorSettings { this }; //!< for directories of XPlane
|
||||
BlackMisc::CSetting<BlackMisc::Simulation::Settings::TInterpolationAndRenderingSetupGlobal> m_renderSettings { this }; //!< rendering/interpolation settings
|
||||
BlackMisc::CSettingReadOnly<BlackMisc::Simulation::Settings::TSimulatorMessages> m_messageSettings { this }; //!< settings for messages
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user