mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
Model matching resolution for airline groups
* UI * setup class
This commit is contained in:
@@ -75,6 +75,16 @@ namespace BlackMisc
|
||||
this->setMatchingMode(m);
|
||||
}
|
||||
|
||||
void CAircraftMatcherSetup::setAirlineGroupBehaviour(bool ifNoAirline, bool sameAsAirline)
|
||||
{
|
||||
MatchingMode m = this->getMatchingMode();
|
||||
const bool icao = m.testFlag(ByIcaoData);
|
||||
m.setFlag(ByAirlineGroupIfNoAirline, ifNoAirline);
|
||||
m.setFlag(ByAirlineGroupSameAsAirline, sameAsAirline);
|
||||
m.setFlag(ByIcaoData, icao);
|
||||
this->setMatchingMode(m);
|
||||
}
|
||||
|
||||
QString CAircraftMatcherSetup::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
@@ -192,6 +202,8 @@ namespace BlackMisc
|
||||
static const QString categoryGlider("glider categories");
|
||||
static const QString categoryMilitary("military categories");
|
||||
static const QString revModelString("reverse model lookup");
|
||||
static const QString agSameAsAirline("group as airline");
|
||||
static const QString agIfNoAirline("group if no airline");
|
||||
|
||||
switch (modeFlag)
|
||||
{
|
||||
@@ -214,6 +226,8 @@ namespace BlackMisc
|
||||
case ExcludeNoExcluded: return exExcl;
|
||||
case ModelSetRemoveFailedModel: return removeFromModelSet;
|
||||
case ModelVerificationAtStartup: return verification;
|
||||
case ByAirlineGroupIfNoAirline: return agIfNoAirline;
|
||||
case ByAirlineGroupSameAsAirline: return agSameAsAirline;
|
||||
case ModelVerificationOnlyWarnError: return verificationWarn;
|
||||
case ModelFailoverIfNoModelCanBeAdded: return modelFailedAdded;
|
||||
default: break;
|
||||
@@ -243,9 +257,10 @@ namespace BlackMisc
|
||||
if (mode.testFlag(ScorePreferColorLiveries)) { modes << modeFlagToString(ScorePreferColorLiveries); }
|
||||
if (mode.testFlag(ModelSetRemoveFailedModel)) { modes << modeFlagToString(ModelSetRemoveFailedModel); }
|
||||
if (mode.testFlag(ModelVerificationAtStartup)) { modes << modeFlagToString(ModelVerificationAtStartup); }
|
||||
if (mode.testFlag(ByAirlineGroupIfNoAirline)) { modes << modeFlagToString(ByAirlineGroupIfNoAirline); }
|
||||
if (mode.testFlag(ByAirlineGroupSameAsAirline)) { modes << modeFlagToString(ByAirlineGroupSameAsAirline); }
|
||||
if (mode.testFlag(ModelVerificationOnlyWarnError)) { modes << modeFlagToString(ModelVerificationOnlyWarnError); }
|
||||
if (mode.testFlag(ModelFailoverIfNoModelCanBeAdded)) { modes << modeFlagToString(ModelFailoverIfNoModelCanBeAdded); }
|
||||
|
||||
return modes.join(", ");
|
||||
}
|
||||
|
||||
|
||||
@@ -43,8 +43,10 @@ namespace BlackMisc
|
||||
ByForceCivilian = 1 << 7, //!< civilian (in) will only search in civilian
|
||||
ByMilitary = ByForceCivilian | ByForceMilitary,
|
||||
ByVtol = 1 << 8,
|
||||
ByIcaoOrderAircraftFirst = (1 << 9) | ByIcaoData,
|
||||
ByIcaoOrderAirlineFirst = (1 << 10) | ByIcaoData,
|
||||
ByIcaoOrderAircraftFirst = (1 << 9) | ByIcaoData,
|
||||
ByIcaoOrderAirlineFirst = (1 << 10) | ByIcaoData,
|
||||
ByAirlineGroupSameAsAirline = (1 << 11) | ByIcaoData,
|
||||
ByAirlineGroupIfNoAirline = (1 << 12) | ByIcaoData,
|
||||
ByCategoryGlider = 1 << 20,
|
||||
ByCategoryMilitary = 1 << 21,
|
||||
|
||||
@@ -76,8 +78,8 @@ namespace BlackMisc
|
||||
|
||||
// default depending on algorithm
|
||||
ModeDefaultScore = ScoreIgnoreZeros | ScorePreferColorLiveries | ExcludeDefault | ReverseLookupDefault,
|
||||
ModeDefaultReduce = ModeByFLags | ByModelString | ByFamily | ByManufacturer | ByCombinedType | ByIcaoOrderAircraftFirst | ByLivery | ExcludeDefault | ReverseLookupDefault,
|
||||
ModeDefaultReducePlusScore = ModeByFLags | ByModelString | ByFamily | ByManufacturer | ByCombinedType | ByIcaoOrderAircraftFirst | ModeDefaultScore | ExcludeDefault | ReverseLookupDefault,
|
||||
ModeDefaultReduce = ModeByFLags | ByModelString | ByFamily | ByManufacturer | ByCombinedType | ByIcaoOrderAircraftFirst | ByAirlineGroupIfNoAirline | ReverseLookupDefault | ExcludeDefault | ByLivery,
|
||||
ModeDefaultReducePlusScore = ModeByFLags | ByModelString | ByFamily | ByManufacturer | ByCombinedType | ByIcaoOrderAircraftFirst | ByAirlineGroupIfNoAirline | ReverseLookupDefault | ExcludeDefault | ModeDefaultScore,
|
||||
};
|
||||
Q_DECLARE_FLAGS(MatchingMode, MatchingModeFlag)
|
||||
|
||||
@@ -186,6 +188,9 @@ namespace BlackMisc
|
||||
//! Set reverse lookup flags
|
||||
void setReverseLookup(bool useModelLookup);
|
||||
|
||||
//! Airline group behaviour
|
||||
void setAirlineGroupBehaviour(bool ifNoAirline, bool sameAsAirline);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user