mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
Ref T298, exclude models from matching configurable
This commit is contained in:
@@ -129,6 +129,8 @@ namespace BlackMisc
|
||||
static const QString combined("by combined code");
|
||||
static const QString noZeros("scoring, ignore zero scores");
|
||||
static const QString preferColorLiveries("scoring, prefer color liveries");
|
||||
static const QString exNoDb("excl.without DB data");
|
||||
static const QString exExcl("excl.excluded");
|
||||
|
||||
switch (modeFlag)
|
||||
{
|
||||
@@ -141,6 +143,8 @@ namespace BlackMisc
|
||||
case ByIcaoOrderAirlineFirst: return icaoAirline;
|
||||
case ScoreIgnoreZeros: return noZeros;
|
||||
case ScorePreferColorLiveries: return preferColorLiveries;
|
||||
case ExcludeNoDbData: return exNoDb;
|
||||
case ExcludeNoExcluded: return exExcl;
|
||||
default: break;
|
||||
}
|
||||
|
||||
@@ -184,7 +188,8 @@ namespace BlackMisc
|
||||
CAircraftMatcherSetup::MatchingMode CAircraftMatcherSetup::matchingMode(
|
||||
bool byModelString, bool byIcaoDataAircraft1st, bool byIcaoDataAirline1st, bool byFamily, bool byLivery, bool byCombinedType,
|
||||
bool byMilitary, bool byVtol,
|
||||
bool scoreIgnoreZeros, bool scorePreferColorLiveries)
|
||||
bool scoreIgnoreZeros, bool scorePreferColorLiveries,
|
||||
bool excludeNoDbData, bool excludeNoExcluded)
|
||||
{
|
||||
MatchingMode mode = byModelString ? ByModelString : ModeNone;
|
||||
if (byIcaoDataAircraft1st) { mode |= ByIcaoOrderAircraftFirst; }
|
||||
@@ -196,6 +201,8 @@ namespace BlackMisc
|
||||
if (byVtol) { mode |= ByVtol; }
|
||||
if (scoreIgnoreZeros) { mode |= ScoreIgnoreZeros; }
|
||||
if (scorePreferColorLiveries) { mode |= ScorePreferColorLiveries; }
|
||||
if (excludeNoDbData) { mode |= ExcludeNoDbData; }
|
||||
if (excludeNoExcluded) { mode |= ExcludeNoExcluded; }
|
||||
return mode;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -48,12 +48,16 @@ namespace BlackMisc
|
||||
// --- score based matching ---
|
||||
ScoreIgnoreZeros = 1 << 10, //!< zero scores are ignored
|
||||
ScorePreferColorLiveries = 1 << 11, //!< prefer color liveries
|
||||
// --- exclusion ---
|
||||
ExcludeNoDbData = 1 << 12,
|
||||
ExcludeNoExcluded = 1 << 13,
|
||||
ExcludeDefault = ExcludeNoExcluded | ExcludeNoDbData,
|
||||
// --- others ---
|
||||
ModeNone = 0,
|
||||
ModeByFLags = ByMilitary | ByVtol,
|
||||
ModeDefaultScore = ScoreIgnoreZeros | ScorePreferColorLiveries,
|
||||
ModeDefaultReduce = ModeByFLags | ByModelString | ByFamily | ByManufacturer | ByCombinedType | ByIcaoOrderAircraftFirst | ByLivery,
|
||||
ModeDefaultReducePlusScore = ModeByFLags | ByModelString | ByFamily | ByManufacturer | ByCombinedType | ByIcaoOrderAircraftFirst | ModeDefaultScore,
|
||||
ModeDefaultScore = ScoreIgnoreZeros | ScorePreferColorLiveries | ExcludeDefault,
|
||||
ModeDefaultReduce = ModeByFLags | ByModelString | ByFamily | ByManufacturer | ByCombinedType | ByIcaoOrderAircraftFirst | ByLivery | ExcludeDefault,
|
||||
ModeDefaultReducePlusScore = ModeByFLags | ByModelString | ByFamily | ByManufacturer | ByCombinedType | ByIcaoOrderAircraftFirst | ModeDefaultScore | ExcludeDefault
|
||||
};
|
||||
Q_DECLARE_FLAGS(MatchingMode, MatchingModeFlag)
|
||||
|
||||
@@ -136,7 +140,7 @@ namespace BlackMisc
|
||||
//! Mode by flags
|
||||
static MatchingMode matchingMode(bool byModelString, bool byIcaoDataAircraft1st, bool byIcaoDataAirline1st,
|
||||
bool byFamily, bool byLivery, bool byCombinedType, bool byMilitary, bool byVtol,
|
||||
bool scoreIgnoreZeros, bool scorePreferColorLiveries);
|
||||
bool scoreIgnoreZeros, bool scorePreferColorLiveries, bool excludeNoDbData, bool excludeNoExcluded);
|
||||
|
||||
private:
|
||||
int m_algorithm = static_cast<int>(MatchingStepwiseReducePlusScoreBased);
|
||||
|
||||
Reference in New Issue
Block a user