mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
refs #535, find standard livery
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "blackmisc/predicates.h"
|
||||
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Aviation;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -30,7 +31,7 @@ namespace BlackMisc
|
||||
return this->findBy(&CLivery::getAirlineIcaoCodeDesignator, i);
|
||||
}
|
||||
|
||||
CLivery CLiveryList::findByAirlineIcaoDesignatorStdLivery(const QString &icao) const
|
||||
CLivery CLiveryList::findStdLiveryByAirlineIcaoDesignator(const QString &icao) const
|
||||
{
|
||||
QString i(icao.trimmed().toUpper());
|
||||
if (i.isEmpty()) { return CLivery(); }
|
||||
@@ -42,6 +43,11 @@ namespace BlackMisc
|
||||
});
|
||||
}
|
||||
|
||||
CLivery CLiveryList::findStdLiveryByAirlineIcaoDesignator(const CAirlineIcaoCode &icao) const
|
||||
{
|
||||
return this->findStdLiveryByAirlineIcaoDesignator(icao.getDesignator());
|
||||
}
|
||||
|
||||
CLivery CLiveryList::findByCombinedCode(const QString &combinedCode) const
|
||||
{
|
||||
if (!CLivery::isValidCombinedCode(combinedCode)) { return CLivery(); }
|
||||
@@ -72,7 +78,7 @@ namespace BlackMisc
|
||||
if (liveryPattern.hasValidAirlineDesignator())
|
||||
{
|
||||
QString icao(liveryPattern.getAirlineIcaoCodeDesignator());
|
||||
CLivery l(this->findByAirlineIcaoDesignatorStdLivery(icao));
|
||||
CLivery l(this->findStdLiveryByAirlineIcaoDesignator(icao));
|
||||
if (l.hasCompleteData()) { return l; }
|
||||
}
|
||||
return CLivery();
|
||||
|
||||
Reference in New Issue
Block a user