mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
Ref T704, moved "ifPossibleReduceNameTelephonyCountry" into airline code list, unified functions
This commit is contained in:
committed by
Mat Sutcliffe
parent
1b4aa1162a
commit
9b5ffdf924
@@ -1801,48 +1801,6 @@ namespace BlackCore
|
||||
**/
|
||||
}
|
||||
|
||||
CAirlineIcaoCodeList CAircraftMatcher::ifPossibleReduceIcaoByAirlineNameTelephonyDesignator(const CCallsign &cs, const QString &airlineName, const QString &telephony, const CAirlineIcaoCodeList &inList, const QString &info, bool &reduced, CStatusMessageList *log)
|
||||
{
|
||||
reduced = false;
|
||||
if (inList.isEmpty())
|
||||
{
|
||||
if (log) { CMatchingUtils::addLogDetailsToList(log, cs, info % u" Empty input list, cannot reduce", getLogCategories()); }
|
||||
return inList;
|
||||
}
|
||||
|
||||
if (telephony.isEmpty() && airlineName.isEmpty())
|
||||
{
|
||||
if (log) { CMatchingUtils::addLogDetailsToList(log, cs, info % u" No name/telephony, cannot reduce " % QString::number(inList.size()) % u" entries", getLogCategories()); }
|
||||
return inList;
|
||||
}
|
||||
|
||||
CAirlineIcaoCodeList step1Data = inList.findByNamesOrTelephonyDesignator(airlineName);
|
||||
if (step1Data.size() < 1 || step1Data.size() == inList.size())
|
||||
{
|
||||
if (log) { CMatchingUtils::addLogDetailsToList(log, cs, info % QStringLiteral(" cannot reduce by '%1'").arg(airlineName), getLogCategories()); }
|
||||
step1Data = inList;
|
||||
}
|
||||
else
|
||||
{
|
||||
reduced = true;
|
||||
if (log) { CMatchingUtils::addLogDetailsToList(log, cs, info % QStringLiteral(" reduced by '%1'").arg(airlineName), getLogCategories()); }
|
||||
}
|
||||
if (step1Data.size() == 1) { return step1Data; }
|
||||
|
||||
CAirlineIcaoCodeList step2Data = inList.findByNamesOrTelephonyDesignator(telephony);
|
||||
if (step2Data.size() < 1 || step2Data.size() == inList.size())
|
||||
{
|
||||
if (log) { CMatchingUtils::addLogDetailsToList(log, cs, info % QStringLiteral(" cannot reduce by '%1'").arg(telephony), getLogCategories()); }
|
||||
step2Data = step1Data;
|
||||
}
|
||||
else
|
||||
{
|
||||
reduced = true;
|
||||
if (log) { CMatchingUtils::addLogDetailsToList(log, cs, info % QStringLiteral(" reduced by '%1'").arg(telephony), getLogCategories()); }
|
||||
}
|
||||
return step2Data;
|
||||
}
|
||||
|
||||
CAircraftModelList CAircraftMatcher::ifPossibleReduceByCombinedType(const CSimulatedAircraft &remoteAircraft, const CAircraftModelList &inList, const CAircraftMatcherSetup &setup, bool &reduced, CStatusMessageList *log)
|
||||
{
|
||||
reduced = false;
|
||||
|
||||
@@ -360,10 +360,6 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
static BlackMisc::Simulation::CAircraftModelList ifPossibleReduceModelsByAirlineNameTelephonyDesignator(const BlackMisc::Aviation::CCallsign &cs, const QString &airlineName, const QString &telephony, const BlackMisc::Simulation::CAircraftModelList &inList, const QString &info, bool &reduced, BlackMisc::CStatusMessageList *log);
|
||||
|
||||
//! Reduce by airline name/telephone designator
|
||||
//! \threadsafe
|
||||
static BlackMisc::Aviation::CAirlineIcaoCodeList ifPossibleReduceIcaoByAirlineNameTelephonyDesignator(const BlackMisc::Aviation::CCallsign &cs, const QString &airlineName, const QString &telephony, const BlackMisc::Aviation::CAirlineIcaoCodeList &inList, const QString &info, bool &reduced, BlackMisc::CStatusMessageList *log);
|
||||
|
||||
//! Installed models by combined code (ie L2J, L1P, ...)
|
||||
//! \threadsafe
|
||||
static BlackMisc::Simulation::CAircraftModelList ifPossibleReduceByCombinedType(const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft, const BlackMisc::Simulation::CAircraftModelList &inList, const BlackMisc::Simulation::CAircraftMatcherSetup &setup, bool &reduced, BlackMisc::CStatusMessageList *log);
|
||||
|
||||
Reference in New Issue
Block a user