6#ifndef SWIFT_MISC_SIMULATION_AIRCRAFTMATCHERSETUP_H
7#define SWIFT_MISC_SIMULATION_AIRCRAFTMATCHERSETUP_H
14namespace swift::misc::simulation
24 MatchingStepwiseReducePlusScoreBased,
25 MatchingStepwiseReduce,
35 ByCombinedType = 1 << 4,
36 ByManufacturer = 1 << 5,
41 ByIcaoOrderAircraftFirst = (1 << 9) |
ByIcaoData,
42 ByIcaoOrderAirlineFirst = (1 << 10) |
ByIcaoData,
43 ByAirlineGroupSameAsAirline = (1 << 11) |
ByIcaoData,
44 ByAirlineGroupIfNoAirline = (1 << 12) |
ByIcaoData,
47 ExcludeNoDbData = 1 << 13,
48 ExcludeNoExcluded = 1 << 14,
49 ExcludeDefault = ExcludeNoExcluded | ExcludeNoDbData,
52 ModelSetRemoveFailedModel = 1 << 15,
53 ModelVerificationAtStartup = 1 << 16,
54 ModelFailoverIfNoModelCanBeAdded = 1 << 17,
55 ModelVerificationOnlyWarnError = 1 << 18,
58 ByCategoryGlider = 1 << 20,
59 ByCategoryMilitary = 1 << 21,
60 ByCategorySmallAircraft = 1 << 22,
63 ReverseLookupModelString = 1 << 25,
64 ReverseLookupSwiftLiveryIds = 1 << 26,
65 ReverseLookupDefault = ReverseLookupModelString | ReverseLookupSwiftLiveryIds,
73 ModeByFLags = ByMilOrCivilian | ByVtol,
76 ModeDefaultSet = ModelSetRemoveFailedModel | ModelVerificationAtStartup | ModelFailoverIfNoModelCanBeAdded,
80 ModeDefaultReduce = ModeByFLags |
ByModelString | ByFamily | ByManufacturer | ByCombinedType |
81 ByIcaoOrderAircraftFirst | ByAirlineGroupIfNoAirline | ReverseLookupDefault |
82 ExcludeDefault | ByLivery,
83 ModeDefaultReducePlusScore = ModeByFLags |
ByModelString | ByFamily | ByManufacturer | ByCombinedType |
84 ByIcaoOrderAircraftFirst | ByAirlineGroupIfNoAirline | ReverseLookupDefault |
85 ExcludeDefault | ModeDefaultScore,
87 Q_DECLARE_FLAGS(MatchingMode, MatchingModeFlag)
94 ForceEnginecount = 1 << 1,
97 Q_DECLARE_FLAGS(ForceMode, ForceModeFlag)
110 IndexMatchingAlgorithm = CPropertyIndexRef::GlobalIndexCAircraftMatcherSetup,
114 IndexMsNetworkEntryFile,
115 IndexMsMatchingStageFile,
116 IndexMsNetworkEnabled,
117 IndexMsMatchingStageEnabled
127 CAircraftMatcherSetup(MatchingAlgorithm algorithm, MatchingMode mode, PickSimilarStrategy pickStrategy);
136 bool setMatchingAlgorithm(MatchingAlgorithm algorithm,
bool reset =
true);
142 ForceMode
getForceMode()
const {
return static_cast<ForceMode
>(m_force); }
152 bool isReverseLookupModelString()
const;
153 bool isReverseLookupSwiftLiveryIds()
const;
154 void resetReverseLookup();
180 bool doRunMsReverseLookupScript()
const;
181 bool doRunMsMatchingStageScript()
const;
198 return this->
getMatchingMode().testFlag(ModelVerificationOnlyWarnError);
206 void setVerificationAtStartup(
bool verify);
209 void setOnlyShowVerificationWarningsAndErrors(
bool only);
230 void setAirlineGroupBehaviour(
bool ifNoAirline,
bool sameAsAirline);
233 QString convertToQString(
bool i18n =
false)
const;
245 void reset(MatchingAlgorithm algorithm);
248 bool useCategoryMatching()
const;
251 static const QString &algorithmToString(MatchingAlgorithm algorithm);
254 static const QString &modeFlagToString(MatchingModeFlag modeFlag);
257 static QString modeToString(MatchingMode mode);
260 static const QString &forceFlagToString(ForceModeFlag forceFlag);
263 static QString forceToString(ForceMode force);
266 static const QString &strategyToString(PickSimilarStrategy strategy);
269 static MatchingMode matchingMode(
bool revModelString,
bool revLiveryIds,
bool byModelString,
270 bool byIcaoDataAircraft1st,
bool byIcaoDataAirline1st,
bool byFamily,
271 bool byLivery,
bool byCombinedType,
bool byForceMilitary,
bool byForceCivilian,
272 bool byVtol,
bool byGliderCategory,
bool byMilitaryCategory,
273 bool bySmallAircraftCategory,
bool scoreIgnoreZeros,
274 bool scorePreferColorLiveries,
bool excludeNoDbData,
bool excludeNoExcluded,
275 bool modelVerification,
bool modelVerificationWarnError,
276 bool modelSetRemoveFailedModel,
bool modelFailover);
279 int m_algorithm =
static_cast<int>(MatchingStepwiseReducePlusScoreBased);
280 int m_mode =
static_cast<int>(ModeDefaultReducePlusScore);
281 int m_strategy =
static_cast<int>(PickByOrder);
282 int m_force =
static_cast<int>(ForceNothing);
285 bool m_msReverseEnabled =
false;
286 bool m_msMatchingEnabled =
false;
303Q_DECLARE_METATYPE(swift::misc::simulation::CAircraftMatcherSetup::MatchingMode)
305Q_DECLARE_METATYPE(swift::misc::simulation::CAircraftMatcherSetup::ForceMode)
308Q_DECLARE_OPERATORS_FOR_FLAGS(swift::misc::simulation::CAircraftMatcherSetup::MatchingMode)
Non-owning reference to a CPropertyIndex with a subset of its features.
void setMsMatchingStageEnabled(bool enabled)
Is matching script enabled.
ColumnIndex
Properties by index.
bool removeFromSetIfFailed() const
Remove if failed?
bool onlyShowVerificationWarningsAndErrors() const
Verification only shown for warning/errors?
const QString & getPickStrategyAsString() const
Strategy as string.
static const QString & algorithmToString(MatchingAlgorithm algorithm)
Algorithm to string.
void setMsReverseLookupFile(const QString &file)
Set matching files.
QString getForceModeAsString() const
Force mode as string.
bool isDbDataOnly() const
DB data?
bool doVerificationAtStartup() const
Verification at startup?
MatchingMode getMatchingMode() const
Matching mode.
void setMsReverseLookupEnabled(bool enabled)
Is matching script enabled.
static QString forceToString(ForceMode force)
Force to string.
static QString modeToString(MatchingMode mode)
Enumeration as string.
PickSimilarStrategy
How to pick among similar candiates.
MatchingModeFlag
Enabled matching mode flags.
@ ScorePreferColorLiveries
prefer color liveries
@ ByIcaoData
ICAO airline and aircraft codes.
@ ScoreIgnoreZeros
zero scores are ignored
@ ByMilitary
military (in) will only search in military
@ ByCivilian
civilian (in) will only search in civilian
@ ByModelString
allow exact model string match
const QString & getMsReverseLookupFile() const
Get matching files.
CAircraftMatcherSetup()
Constructor.
ForceModeFlag
Force values.
const QString & getMsMatchingStageFile() const
Get matching files.
void setPickStrategy(PickSimilarStrategy strategy)
Set the strategy.
ForceMode getForceMode() const
Force mode.
bool doModelAddFailover() const
Failover if model cannot be loaded.
QString getMatchingModeAsString() const
Matching mode as string.
void setMsMatchingStageFile(const QString &file)
Set matching files.
void setMatchingMode(MatchingMode mode)
Dynamic offset values?
bool isMsMatchingStageEnabled() const
Is matching script enabled.
const QString & getMatchingAlgorithmAsString() const
Algorithm as string.
MatchingAlgorithm getMatchingAlgorithm() const
Algorithm.
void setForceMode(ForceMode fm)
Force mode.
static const QString & strategyToString(PickSimilarStrategy strategy)
Strategy to string.
PickSimilarStrategy getPickStrategy() const
Strategy among equally suitable models.
bool isMsReverseLookupEnabled() const
Is matching script enabled.
MatchingAlgorithm
Matching algorithm.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...