mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 05:51:23 +08:00
Ref T398, matcher configurable exclusion
This commit is contained in:
@@ -165,6 +165,26 @@ namespace BlackCore
|
|||||||
|
|
||||||
if (!resolvedInPrephase)
|
if (!resolvedInPrephase)
|
||||||
{
|
{
|
||||||
|
// sanity
|
||||||
|
const int noString = modelSet.removeAllWithoutModelString();
|
||||||
|
static const QString noModelStr("Excluded %1 models without model string");
|
||||||
|
if (noString > 0 && log) { CMatchingUtils::addLogDetailsToList(log, remoteAircraft, noModelStr.arg(noString)); }
|
||||||
|
|
||||||
|
// exclusion
|
||||||
|
if (setup.getMatchingMode().testFlag(CAircraftMatcherSetup::ExcludeNoDbData))
|
||||||
|
{
|
||||||
|
const int noDbKey = modelSet.removeObjectsWithoutDbKey();
|
||||||
|
static const QString excludedStr("Excluded %1 models without DB key");
|
||||||
|
if (noDbKey > 0 && log) { CMatchingUtils::addLogDetailsToList(log, remoteAircraft, excludedStr.arg(noDbKey)); }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (setup.getMatchingMode().testFlag(CAircraftMatcherSetup::ExcludeNoExcluded))
|
||||||
|
{
|
||||||
|
const int excluded = modelSet.removeIfExcluded();
|
||||||
|
static const QString excludedStr("Excluded %1 models marked 'Excluded'");
|
||||||
|
if (excluded > 0 && log) { CMatchingUtils::addLogDetailsToList(log, remoteAircraft, excludedStr.arg(excluded)); }
|
||||||
|
}
|
||||||
|
|
||||||
// Reduce by ICAO if the flag is set
|
// Reduce by ICAO if the flag is set
|
||||||
static const QString msInfo("Using '%1' with model set with %2 models");
|
static const QString msInfo("Using '%1' with model set with %2 models");
|
||||||
CMatchingUtils::addLogDetailsToList(log, remoteAircraft, msInfo.arg(setup.getMatchingAlgorithmAsString()).arg(modelSet.size()), getLogCategories());
|
CMatchingUtils::addLogDetailsToList(log, remoteAircraft, msInfo.arg(setup.getMatchingAlgorithmAsString()).arg(modelSet.size()), getLogCategories());
|
||||||
@@ -212,14 +232,18 @@ namespace BlackCore
|
|||||||
matchedModel = candidates.front();
|
matchedModel = candidates.front();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
CMatchingUtils::addLogDetailsToList(log, remoteAircraft, ps.arg(candidates.size()).arg(CAircraftMatcherSetup::strategyToString(usedStrategy)));
|
|
||||||
CMatchingUtils::addLogDetailsToList(log, remoteAircraft,
|
if (log)
|
||||||
summary.arg(
|
{
|
||||||
remoteAircraft.getAircraftIcaoCode().getCombinedType(), matchedModel.getAircraftIcaoCode().getCombinedType(),
|
CMatchingUtils::addLogDetailsToList(log, remoteAircraft, ps.arg(candidates.size()).arg(CAircraftMatcherSetup::strategyToString(usedStrategy)));
|
||||||
remoteAircraft.getAircraftIcaoCode().getDesignatorDbKey(), matchedModel.getAircraftIcaoCode().getDesignatorDbKey(),
|
CMatchingUtils::addLogDetailsToList(log, remoteAircraft,
|
||||||
remoteAircraft.getAirlineIcaoCode().getVDesignatorDbKey(), matchedModel.getAirlineIcaoCode().getVDesignatorDbKey(),
|
summary.arg(
|
||||||
remoteAircraft.getLivery().getCombinedCodePlusInfoAndId(), matchedModel.getLivery().getCombinedCodePlusInfoAndId()
|
remoteAircraft.getAircraftIcaoCode().getCombinedType(), matchedModel.getAircraftIcaoCode().getCombinedType(),
|
||||||
));
|
remoteAircraft.getAircraftIcaoCode().getDesignatorDbKey(), matchedModel.getAircraftIcaoCode().getDesignatorDbKey(),
|
||||||
|
remoteAircraft.getAirlineIcaoCode().getVDesignatorDbKey(), matchedModel.getAirlineIcaoCode().getVDesignatorDbKey(),
|
||||||
|
remoteAircraft.getLivery().getCombinedCodePlusInfoAndId(), matchedModel.getLivery().getCombinedCodePlusInfoAndId()
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user