mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +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(" ");
|
this->getDbKeyAsStringInParentheses(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CAircraftIcaoCode::hasCategory() const
|
||||||
|
{
|
||||||
|
return !m_category.isNull();
|
||||||
|
}
|
||||||
|
|
||||||
bool CAircraftIcaoCode::hasCompleteData() const
|
bool CAircraftIcaoCode::hasCompleteData() const
|
||||||
{
|
{
|
||||||
return hasValidCombinedType() && hasDesignator() && hasValidWtc() && hasManufacturer();
|
return hasValidCombinedType() && hasDesignator() && hasValidWtc() && hasManufacturer();
|
||||||
@@ -704,8 +709,14 @@ namespace BlackMisc
|
|||||||
|
|
||||||
const QString &CAircraftIcaoCode::getUnassignedDesignator()
|
const QString &CAircraftIcaoCode::getUnassignedDesignator()
|
||||||
{
|
{
|
||||||
static const QString i("ZZZZ");
|
static const QString z("ZZZZ");
|
||||||
return i;
|
return z;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CAircraftIcaoCode::getGliderDesignator()
|
||||||
|
{
|
||||||
|
static const QString g("GLID");
|
||||||
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CAircraftIcaoCode &CAircraftIcaoCode::unassignedIcao()
|
const CAircraftIcaoCode &CAircraftIcaoCode::unassignedIcao()
|
||||||
@@ -716,7 +727,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
const QStringList &CAircraftIcaoCode::getSpecialDesignators()
|
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;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -258,6 +258,9 @@ namespace BlackMisc
|
|||||||
//! Get category
|
//! Get category
|
||||||
const CAircraftCategory &getCategory() const { return m_category; }
|
const CAircraftCategory &getCategory() const { return m_category; }
|
||||||
|
|
||||||
|
//! Has category?
|
||||||
|
bool hasCategory() const;
|
||||||
|
|
||||||
//! Set category
|
//! Set category
|
||||||
void setCategory(const CAircraftCategory &category) { m_category = category; }
|
void setCategory(const CAircraftCategory &category) { m_category = category; }
|
||||||
|
|
||||||
@@ -330,6 +333,9 @@ namespace BlackMisc
|
|||||||
//! The unassigned designator ("ZZZZ")
|
//! The unassigned designator ("ZZZZ")
|
||||||
static const QString &getUnassignedDesignator();
|
static const QString &getUnassignedDesignator();
|
||||||
|
|
||||||
|
//! Get the glider designator
|
||||||
|
static const QString &getGliderDesignator();
|
||||||
|
|
||||||
//! Unassigned ICAO code "ZZZZ"
|
//! Unassigned ICAO code "ZZZZ"
|
||||||
static const CAircraftIcaoCode &unassignedIcao();
|
static const CAircraftIcaoCode &unassignedIcao();
|
||||||
|
|
||||||
|
|||||||
@@ -112,6 +112,12 @@ namespace BlackMisc
|
|||||||
this->setPickStrategy(PickByOrder);
|
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)
|
const QString &CAircraftMatcherSetup::algorithmToString(CAircraftMatcherSetup::MatchingAlgorithm algorithm)
|
||||||
{
|
{
|
||||||
static const QString rs("reduce + score based");
|
static const QString rs("reduce + score based");
|
||||||
|
|||||||
@@ -156,6 +156,9 @@ namespace BlackMisc
|
|||||||
//! Reset
|
//! Reset
|
||||||
void reset(MatchingAlgorithm algorithm);
|
void reset(MatchingAlgorithm algorithm);
|
||||||
|
|
||||||
|
//! Use category matching
|
||||||
|
bool useCategoryMatching() const;
|
||||||
|
|
||||||
//! Algorithm to string
|
//! Algorithm to string
|
||||||
static const QString &algorithmToString(MatchingAlgorithm algorithm);
|
static const QString &algorithmToString(MatchingAlgorithm algorithm);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user