mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Ref T292, Ref T285 replaced model set loader in matcher
This commit is contained in:
@@ -490,7 +490,7 @@ namespace BlackCore
|
||||
return icao;
|
||||
}
|
||||
|
||||
int CAircraftMatcher::setModelSet(const CAircraftModelList &models, const CSimulatorInfo &simulatorHint)
|
||||
int CAircraftMatcher::setModelSet(const CAircraftModelList &models, const CSimulatorInfo &simulator)
|
||||
{
|
||||
CAircraftModelList modelsCleaned(models);
|
||||
const int r1 = modelsCleaned.removeAllWithoutModelString();
|
||||
@@ -503,39 +503,24 @@ namespace BlackCore
|
||||
}
|
||||
if (modelsCleaned.isEmpty())
|
||||
{
|
||||
CLogMessage(this).error("No models for matching, swift without a model set will not work!");
|
||||
CLogMessage(this).error("No models for matching ('%1'), swift without a model set will not work!") << simulator.toQString();
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).info("Set %1 models in matcher, simulator '%2'") << modelsCleaned.size() << simulatorHint.toQString();
|
||||
CLogMessage(this).info("Set %1 models in matcher, simulator '%2'") << modelsCleaned.size() << simulator.toQString();
|
||||
}
|
||||
m_modelSet = modelsCleaned;
|
||||
m_simulator = simulatorHint;
|
||||
m_modelSetInfo = QString("Set: '%1' entries: %2").arg(simulatorHint.toQString()).arg(modelsCleaned.size());
|
||||
m_simulator = simulator;
|
||||
m_modelSetInfo = QString("Set: '%1' entries: %2").arg(simulator.toQString()).arg(modelsCleaned.size());
|
||||
return models.size();
|
||||
}
|
||||
|
||||
const CAircraftModel &CAircraftMatcher::getDefaultModel() const
|
||||
{
|
||||
return m_defaultModel;
|
||||
}
|
||||
|
||||
void CAircraftMatcher::setDefaultModel(const CAircraftModel &defaultModel)
|
||||
{
|
||||
m_defaultModel = defaultModel;
|
||||
m_defaultModel.setModelType(CAircraftModel::TypeModelMatchingDefaultModel);
|
||||
}
|
||||
|
||||
CMatchingStatistics CAircraftMatcher::getCurrentStatistics() const
|
||||
{
|
||||
return m_statistics;
|
||||
}
|
||||
|
||||
void CAircraftMatcher::clearMatchingStatistics()
|
||||
{
|
||||
m_statistics.clear();
|
||||
}
|
||||
|
||||
void CAircraftMatcher::evaluateStatisticsEntry(const QString &sessionId, const CCallsign &callsign, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery)
|
||||
{
|
||||
Q_UNUSED(livery);
|
||||
|
||||
@@ -159,19 +159,19 @@ namespace BlackCore
|
||||
|
||||
//! Set the models we want to use
|
||||
//! \note uses a set from "somewhere else" so it can also be used with arbitrary sets for testing
|
||||
int setModelSet(const BlackMisc::Simulation::CAircraftModelList &models, const BlackMisc::Simulation::CSimulatorInfo &simulatorHint = {});
|
||||
int setModelSet(const BlackMisc::Simulation::CAircraftModelList &models, const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
//! Default model
|
||||
const BlackMisc::Simulation::CAircraftModel &getDefaultModel() const;
|
||||
const BlackMisc::Simulation::CAircraftModel &getDefaultModel() const { return m_defaultModel; }
|
||||
|
||||
//! Set default model, can be set by driver specific for simulator
|
||||
void setDefaultModel(const BlackMisc::Simulation::CAircraftModel &defaultModel);
|
||||
|
||||
//! The current statistics
|
||||
BlackMisc::Simulation::CMatchingStatistics getCurrentStatistics() const;
|
||||
BlackMisc::Simulation::CMatchingStatistics getCurrentStatistics() const { return m_statistics; }
|
||||
|
||||
//! Clear the statistics
|
||||
void clearMatchingStatistics();
|
||||
void clearMatchingStatistics() { m_statistics.clear(); }
|
||||
|
||||
//! Evaluate if a statistics entry makes sense and add it
|
||||
void evaluateStatisticsEntry(const QString &sessionId, const BlackMisc::Aviation::CCallsign &callsign, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery);
|
||||
|
||||
Reference in New Issue
Block a user