Ref T398, matcher configurable exclusion

This commit is contained in:
Klaus Basan
2018-08-23 17:50:44 +02:00
parent a640343433
commit a975ee9ca4

View File

@@ -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,6 +232,9 @@ namespace BlackCore
matchedModel = candidates.front(); matchedModel = candidates.front();
break; break;
} }
if (log)
{
CMatchingUtils::addLogDetailsToList(log, remoteAircraft, ps.arg(candidates.size()).arg(CAircraftMatcherSetup::strategyToString(usedStrategy))); CMatchingUtils::addLogDetailsToList(log, remoteAircraft, ps.arg(candidates.size()).arg(CAircraftMatcherSetup::strategyToString(usedStrategy)));
CMatchingUtils::addLogDetailsToList(log, remoteAircraft, CMatchingUtils::addLogDetailsToList(log, remoteAircraft,
summary.arg( summary.arg(
@@ -222,6 +245,7 @@ namespace BlackCore
)); ));
} }
} }
}
// copy over callsign validate // copy over callsign validate
matchedModel.setCallsign(remoteAircraft.getCallsign()); matchedModel.setCallsign(remoteAircraft.getCallsign());