diff --git a/src/blackcore/context/contextsimulatorimpl.cpp b/src/blackcore/context/contextsimulatorimpl.cpp index 4b963e03f..51623f53d 100644 --- a/src/blackcore/context/contextsimulatorimpl.cpp +++ b/src/blackcore/context/contextsimulatorimpl.cpp @@ -79,6 +79,7 @@ namespace BlackCore { if (!myself) { return; } this->initByLastUsedModelSet(); + m_aircraftMatcher.setSetup(m_matchingSettings.get()); }); } @@ -756,6 +757,8 @@ namespace BlackCore { if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << setup.toQString(); } m_aircraftMatcher.setSetup(setup); + const CStatusMessage msg = m_matchingSettings.setAndSave(setup); + CLogMessage::preformatted(msg); } CAircraftMatcherSetup CContextSimulator::getMatchingSetup() const diff --git a/src/blackcore/context/contextsimulatorimpl.h b/src/blackcore/context/contextsimulatorimpl.h index c553a77f9..026afd38c 100644 --- a/src/blackcore/context/contextsimulatorimpl.h +++ b/src/blackcore/context/contextsimulatorimpl.h @@ -21,6 +21,7 @@ #include "blackcore/weathermanager.h" #include "blackcore/network.h" #include "blackmisc/simulation/data/modelcaches.h" +#include "blackmisc/simulation/settings/modelmatchersettings.h" #include "blackmisc/simulation/settings/simulatorsettings.h" #include "blackmisc/simulation/aircraftmodellist.h" #include "blackmisc/simulation/interpolationsetuplist.h" @@ -244,7 +245,9 @@ namespace BlackCore BlackMisc::CRegularThread m_listenersThread; //!< waiting for plugin CWeatherManager m_weatherManager { this }; //!< weather management CAircraftMatcher m_aircraftMatcher { this }; //!< model matcher - QMap m_matchingMessages; + QMap m_matchingMessages; //!< all matching log messages per callsign + BlackMisc::CSetting m_matchingSettings { this }; //!< settings + bool m_initallyAddAircraft = false; bool m_enableMatchingMessages = true; bool m_isWeatherActivated = false; diff --git a/src/blackmisc/simulation/settings/modelmatchersettings.h b/src/blackmisc/simulation/settings/modelmatchersettings.h new file mode 100644 index 000000000..8a82d1102 --- /dev/null +++ b/src/blackmisc/simulation/settings/modelmatchersettings.h @@ -0,0 +1,37 @@ +/* Copyright (C) 2018 + * swift project community / contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +//! \file + +#ifndef BLACKMISC_SIMULATION_SETTINGS_MODELMATCHERSETTINGS_H +#define BLACKMISC_SIMULATION_SETTINGS_MODELMATCHERSETTINGS_H + +#include "blackmisc/simulation/aircraftmatchersetup.h" +#include "blackmisc/settingscache.h" + +namespace BlackMisc +{ + namespace Simulation + { + namespace Settings + { + //! Trait for simulator settings + struct TModelMatching : public TSettingTrait + { + //! Key in data cache + static const char *key() { return "Matching"; } + + //! \copydoc BlackCore::TSettingTrait::humanReadable + static const QString &humanReadable() { static const QString name("Model matching"); return name; } + }; + } // ns + } // ns +} // ns + +#endif // guard