mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Ref T298, split military flag into check for civilian/military
* in military -> only military aircraft? * in civilian -> only civilian aircraft?
This commit is contained in:
@@ -125,6 +125,9 @@ namespace BlackMisc
|
||||
static const QString icaoAircraft("by ICAO, aircraft first");
|
||||
static const QString icaoAirline("by ICAO, airline first");
|
||||
static const QString family("by family");
|
||||
static const QString forceMil("force military");
|
||||
static const QString forceCiv("force civilian");
|
||||
static const QString vtol("VTOL");
|
||||
static const QString livery("by livery");
|
||||
static const QString combined("by combined code");
|
||||
static const QString noZeros("scoring, ignore zero scores");
|
||||
@@ -141,6 +144,9 @@ namespace BlackMisc
|
||||
case ByCombinedType: return combined;
|
||||
case ByIcaoOrderAircraftFirst: return icaoAircraft;
|
||||
case ByIcaoOrderAirlineFirst: return icaoAirline;
|
||||
case ByForceCivilian: return forceCiv;
|
||||
case ByForceMilitary: return forceMil;
|
||||
case ByVtol: return vtol;
|
||||
case ScoreIgnoreZeros: return noZeros;
|
||||
case ScorePreferColorLiveries: return preferColorLiveries;
|
||||
case ExcludeNoDbData: return exNoDb;
|
||||
@@ -162,6 +168,9 @@ namespace BlackMisc
|
||||
if (mode.testFlag(ByFamily)) { modes << modeFlagToString(ByFamily); }
|
||||
if (mode.testFlag(ByLivery)) { modes << modeFlagToString(ByLivery); }
|
||||
if (mode.testFlag(ByCombinedType)) { modes << modeFlagToString(ByCombinedType); }
|
||||
if (mode.testFlag(ByForceCivilian)) { modes << modeFlagToString(ByForceCivilian); }
|
||||
if (mode.testFlag(ByForceMilitary)) { modes << modeFlagToString(ByForceMilitary); }
|
||||
if (mode.testFlag(ByVtol)) { modes << modeFlagToString(ByVtol); }
|
||||
if (mode.testFlag(ScoreIgnoreZeros)) { modes << modeFlagToString(ScoreIgnoreZeros); }
|
||||
if (mode.testFlag(ScorePreferColorLiveries)) { modes << modeFlagToString(ScorePreferColorLiveries); }
|
||||
return modes.join(", ");
|
||||
@@ -185,11 +194,11 @@ namespace BlackMisc
|
||||
return unknown;
|
||||
}
|
||||
|
||||
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 excludeNoDbData, bool excludeNoExcluded)
|
||||
CAircraftMatcherSetup::MatchingMode CAircraftMatcherSetup::matchingMode(bool byModelString, bool byIcaoDataAircraft1st, bool byIcaoDataAirline1st, bool byFamily, bool byLivery, bool byCombinedType,
|
||||
bool byForceMilitary, bool byForceCivilian,
|
||||
bool byVtol,
|
||||
bool scoreIgnoreZeros, bool scorePreferColorLiveries,
|
||||
bool excludeNoDbData, bool excludeNoExcluded)
|
||||
{
|
||||
MatchingMode mode = byModelString ? ByModelString : ModeNone;
|
||||
if (byIcaoDataAircraft1st) { mode |= ByIcaoOrderAircraftFirst; }
|
||||
@@ -197,7 +206,8 @@ namespace BlackMisc
|
||||
if (byFamily) { mode |= ByFamily; }
|
||||
if (byLivery) { mode |= ByLivery; }
|
||||
if (byCombinedType) { mode |= ByCombinedType; }
|
||||
if (byMilitary) { mode |= ByMilitary; }
|
||||
if (byForceMilitary) { mode |= ByForceMilitary; }
|
||||
if (byForceCivilian) { mode |= ByForceCivilian; }
|
||||
if (byVtol) { mode |= ByVtol; }
|
||||
if (scoreIgnoreZeros) { mode |= ScoreIgnoreZeros; }
|
||||
if (scorePreferColorLiveries) { mode |= ScorePreferColorLiveries; }
|
||||
|
||||
@@ -41,16 +41,18 @@ namespace BlackMisc
|
||||
ByLivery = 1 << 3,
|
||||
ByCombinedType = 1 << 4,
|
||||
ByManufacturer = 1 << 5,
|
||||
ByMilitary = 1 << 6,
|
||||
ByVtol = 1 << 7,
|
||||
ByIcaoOrderAircraftFirst = (1 << 8) | ByIcaoData,
|
||||
ByIcaoOrderAirlineFirst = (1 << 9) | ByIcaoData,
|
||||
ByForceMilitary = 1 << 6, //!< military (in) will only search in military
|
||||
ByForceCivilian = 1 << 7, //!< civilian (in) will only search in civilian
|
||||
ByMilitary = ByForceCivilian | ByForceMilitary,
|
||||
ByVtol = 1 << 8,
|
||||
ByIcaoOrderAircraftFirst = (1 << 9) | ByIcaoData,
|
||||
ByIcaoOrderAirlineFirst = (1 << 10) | ByIcaoData,
|
||||
// --- score based matching ---
|
||||
ScoreIgnoreZeros = 1 << 10, //!< zero scores are ignored
|
||||
ScorePreferColorLiveries = 1 << 11, //!< prefer color liveries
|
||||
ScoreIgnoreZeros = 1 << 11, //!< zero scores are ignored
|
||||
ScorePreferColorLiveries = 1 << 12, //!< prefer color liveries
|
||||
// --- exclusion ---
|
||||
ExcludeNoDbData = 1 << 12,
|
||||
ExcludeNoExcluded = 1 << 13,
|
||||
ExcludeNoDbData = 1 << 13,
|
||||
ExcludeNoExcluded = 1 << 14,
|
||||
ExcludeDefault = ExcludeNoExcluded | ExcludeNoDbData,
|
||||
// --- others ---
|
||||
ModeNone = 0,
|
||||
@@ -139,7 +141,9 @@ 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 byFamily, bool byLivery, bool byCombinedType,
|
||||
bool byForceMilitary, bool byForceCivilian,
|
||||
bool byVtol,
|
||||
bool scoreIgnoreZeros, bool scorePreferColorLiveries, bool excludeNoDbData, bool excludeNoExcluded);
|
||||
|
||||
private:
|
||||
|
||||
@@ -290,7 +290,12 @@ namespace BlackMisc
|
||||
|
||||
bool CSimulatedAircraft::isVtol() const
|
||||
{
|
||||
return getModel().isVtol();
|
||||
return this->getModel().isVtol();
|
||||
}
|
||||
|
||||
bool CSimulatedAircraft::isMilitary() const
|
||||
{
|
||||
return this->getModel().isMilitary();
|
||||
}
|
||||
|
||||
QString CSimulatedAircraft::getCombinedIcaoLiveryString(bool networkModel) const
|
||||
|
||||
@@ -345,6 +345,9 @@ namespace BlackMisc
|
||||
//! VTOL aircraft?
|
||||
bool isVtol() const;
|
||||
|
||||
//! Is military aircraft
|
||||
bool isMilitary() const;
|
||||
|
||||
//! Combined ICAO / color string
|
||||
QString getCombinedIcaoLiveryString(bool networkModel = false) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user