mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
Ref T566, configurable matching log in matcher/simulator components
* log flag/enum in own file * pass "what to log" as parameter
This commit is contained in:
committed by
Mat Sutcliffe
parent
991c7d59ef
commit
0d2e6dd997
@@ -14,6 +14,7 @@
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackmisc/simulation/aircraftmatchersetup.h"
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
#include "blackmisc/simulation/matchinglog.h"
|
||||
#include "blackmisc/simulation/matchingstatistics.h"
|
||||
#include "blackmisc/simulation/categorymatcher.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
@@ -44,25 +45,6 @@ namespace BlackCore
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! What to log
|
||||
enum MatchingLogFlag
|
||||
{
|
||||
LogNothing = 0,
|
||||
LogModelstring = 1 << 0,
|
||||
LogStepwiseReduce = 1 << 1,
|
||||
LogScoring = 1 << 2,
|
||||
LogCombinedDefaultType = 1 << 3,
|
||||
LogMinimal = 1 << 10,
|
||||
LogAll = LogModelstring | LogStepwiseReduce | LogScoring | LogCombinedDefaultType
|
||||
};
|
||||
Q_DECLARE_FLAGS(MatchingLog, MatchingLogFlag)
|
||||
|
||||
//! Log flag to string
|
||||
static const QString &matchingLogFlagToString(MatchingLogFlag logFlag);
|
||||
|
||||
//! Log flag to string
|
||||
static const QString matchingLogToString(MatchingLog log);
|
||||
|
||||
//! Log categories
|
||||
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||
|
||||
@@ -88,7 +70,7 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
BlackMisc::Simulation::CAircraftModel getClosestMatch(
|
||||
const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft,
|
||||
MatchingLog whatToLog,
|
||||
BlackMisc::Simulation::MatchingLog whatToLog,
|
||||
BlackMisc::CStatusMessageList *log = nullptr) const;
|
||||
|
||||
//! Return an valid airline ICAO code
|
||||
@@ -249,19 +231,19 @@ namespace BlackCore
|
||||
static BlackMisc::Simulation::CAircraftModelList getClosestMatchStepwiseReduceImplementation(
|
||||
const BlackMisc::Simulation::CAircraftModelList &modelSet, const BlackMisc::Simulation::CAircraftMatcherSetup &setup,
|
||||
const BlackMisc::Simulation::CCategoryMatcher &categoryMatcher, const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft,
|
||||
MatchingLog whatToLog, BlackMisc::CStatusMessageList *log = nullptr);
|
||||
BlackMisc::Simulation::MatchingLog whatToLog, BlackMisc::CStatusMessageList *log = nullptr);
|
||||
|
||||
//! The score based implementation
|
||||
static BlackMisc::Simulation::CAircraftModelList getClosestMatchScoreImplementation(const BlackMisc::Simulation::CAircraftModelList &modelSet, const BlackMisc::Simulation::CAircraftMatcherSetup &setup, const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft, int &maxScore, BlackCore::CAircraftMatcher::MatchingLog whatToLog, BlackMisc::CStatusMessageList *log = nullptr);
|
||||
static BlackMisc::Simulation::CAircraftModelList getClosestMatchScoreImplementation(const BlackMisc::Simulation::CAircraftModelList &modelSet, const BlackMisc::Simulation::CAircraftMatcherSetup &setup, const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft, int &maxScore, BlackMisc::Simulation::MatchingLog whatToLog, BlackMisc::CStatusMessageList *log = nullptr);
|
||||
|
||||
//! Get combined type default model, i.e. get a default model under consideration of the combined code such as "L2J"
|
||||
//! \see BlackMisc::Simulation::CSimulatedAircraft::getAircraftIcaoCombinedType
|
||||
//! \remark in any case a (default) model is returned
|
||||
static BlackMisc::Simulation::CAircraftModel getCombinedTypeDefaultModel(const BlackMisc::Simulation::CAircraftModelList &modelSet, const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft, const BlackMisc::Simulation::CAircraftModel &defaultModel, MatchingLog whatToLog, BlackMisc::CStatusMessageList *log = nullptr);
|
||||
static BlackMisc::Simulation::CAircraftModel getCombinedTypeDefaultModel(const BlackMisc::Simulation::CAircraftModelList &modelSet, const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft, const BlackMisc::Simulation::CAircraftModel &defaultModel, BlackMisc::Simulation::MatchingLog whatToLog, BlackMisc::CStatusMessageList *log = nullptr);
|
||||
|
||||
//! Search in models by key (aka model string)
|
||||
//! \threadsafe
|
||||
static BlackMisc::Simulation::CAircraftModel matchByExactModelString(const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft, const BlackMisc::Simulation::CAircraftModelList &models, MatchingLog whatToLog, BlackMisc::CStatusMessageList *log);
|
||||
static BlackMisc::Simulation::CAircraftModel matchByExactModelString(const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft, const BlackMisc::Simulation::CAircraftModelList &models, BlackMisc::Simulation::MatchingLog whatToLog, BlackMisc::CStatusMessageList *log);
|
||||
|
||||
//! Installed models by ICAO data
|
||||
//! \threadsafe
|
||||
@@ -338,7 +320,4 @@ namespace BlackCore
|
||||
};
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackCore::CAircraftMatcher::MatchingLogFlag)
|
||||
Q_DECLARE_METATYPE(BlackCore::CAircraftMatcher::MatchingLog)
|
||||
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user