mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 10:25:36 +08:00
Ref T298, model matching settings trait and used settings in simulator context
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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<BlackMisc::Aviation::CCallsign, BlackMisc::CStatusMessageList> m_matchingMessages;
|
||||
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;
|
||||
|
||||
37
src/blackmisc/simulation/settings/modelmatchersettings.h
Normal file
37
src/blackmisc/simulation/settings/modelmatchersettings.h
Normal file
@@ -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<CAircraftMatcherSetup>
|
||||
{
|
||||
//! 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
|
||||
Reference in New Issue
Block a user