mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Ref T472, utility functions for category
This commit is contained in:
committed by
Mat Sutcliffe
parent
5c46fa3afa
commit
360edca4b3
@@ -499,6 +499,11 @@ namespace BlackMisc
|
||||
this->getDbKeyAsStringInParentheses(" ");
|
||||
}
|
||||
|
||||
bool CAircraftIcaoCode::hasCategory() const
|
||||
{
|
||||
return !m_category.isNull();
|
||||
}
|
||||
|
||||
bool CAircraftIcaoCode::hasCompleteData() const
|
||||
{
|
||||
return hasValidCombinedType() && hasDesignator() && hasValidWtc() && hasManufacturer();
|
||||
@@ -704,8 +709,14 @@ namespace BlackMisc
|
||||
|
||||
const QString &CAircraftIcaoCode::getUnassignedDesignator()
|
||||
{
|
||||
static const QString i("ZZZZ");
|
||||
return i;
|
||||
static const QString z("ZZZZ");
|
||||
return z;
|
||||
}
|
||||
|
||||
const QString &CAircraftIcaoCode::getGliderDesignator()
|
||||
{
|
||||
static const QString g("GLID");
|
||||
return g;
|
||||
}
|
||||
|
||||
const CAircraftIcaoCode &CAircraftIcaoCode::unassignedIcao()
|
||||
@@ -716,7 +727,7 @@ namespace BlackMisc
|
||||
|
||||
const QStringList &CAircraftIcaoCode::getSpecialDesignators()
|
||||
{
|
||||
static const QStringList s({ "ZZZZ", "SHIP", "BALL", "GLID", "ULAC", "GYRO", "UHEL" });
|
||||
static const QStringList s({ "ZZZZ", "SHIP", "BALL", getGliderDesignator(), "ULAC", "GYRO", "UHEL" });
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@@ -258,6 +258,9 @@ namespace BlackMisc
|
||||
//! Get category
|
||||
const CAircraftCategory &getCategory() const { return m_category; }
|
||||
|
||||
//! Has category?
|
||||
bool hasCategory() const;
|
||||
|
||||
//! Set category
|
||||
void setCategory(const CAircraftCategory &category) { m_category = category; }
|
||||
|
||||
@@ -330,6 +333,9 @@ namespace BlackMisc
|
||||
//! The unassigned designator ("ZZZZ")
|
||||
static const QString &getUnassignedDesignator();
|
||||
|
||||
//! Get the glider designator
|
||||
static const QString &getGliderDesignator();
|
||||
|
||||
//! Unassigned ICAO code "ZZZZ"
|
||||
static const CAircraftIcaoCode &unassignedIcao();
|
||||
|
||||
|
||||
@@ -112,6 +112,12 @@ namespace BlackMisc
|
||||
this->setPickStrategy(PickByOrder);
|
||||
}
|
||||
|
||||
bool CAircraftMatcherSetup::useCategoryMatching() const
|
||||
{
|
||||
const MatchingMode mm = this->getMatchingMode();
|
||||
return mm.testFlag(ByCategoryGlider) || mm.testFlag(ByCategoryMilitary);
|
||||
}
|
||||
|
||||
const QString &CAircraftMatcherSetup::algorithmToString(CAircraftMatcherSetup::MatchingAlgorithm algorithm)
|
||||
{
|
||||
static const QString rs("reduce + score based");
|
||||
|
||||
@@ -156,6 +156,9 @@ namespace BlackMisc
|
||||
//! Reset
|
||||
void reset(MatchingAlgorithm algorithm);
|
||||
|
||||
//! Use category matching
|
||||
bool useCategoryMatching() const;
|
||||
|
||||
//! Algorithm to string
|
||||
static const QString &algorithmToString(MatchingAlgorithm algorithm);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user