refs #364, refs #368 Updated some value classes: user, client, icao, callsign, aircraft

* parsing homebase from user
* updating to Simulation/AircraftModel
* known ICAO function
* renaming, style changes
* convenience functions
This commit is contained in:
Klaus Basan
2015-01-18 20:52:09 +01:00
parent 4ab1577ac0
commit 2d6e906176
11 changed files with 182 additions and 77 deletions

View File

@@ -29,7 +29,8 @@ namespace BlackMisc
{
IndexCallsignString = BlackMisc::CPropertyIndex::GlobalIndexCCallsign,
IndexCallsignStringAsSet,
IndexTelephonyDesignator
IndexTelephonyDesignator,
IndexSuffix
};
//! Default constructor.
@@ -49,8 +50,13 @@ namespace BlackMisc
bool isEmpty() const { return this->m_callsignAsSet.isEmpty(); }
//! ATC callsign
//! \sa atcCallsignSuffixes()
bool isAtcCallsign() const;
//! ATC alike callsign
//! \sa atcAlikeCallsignSuffixes()
bool isAtcAlikeCallsign() const;
//! Get callsign.
const QString &asString() const { return this->m_callsign; }
@@ -87,9 +93,12 @@ namespace BlackMisc
//! Valid callsign?
static bool isValidCallsign(const QString &callsign);
//! List of ATC suffixes (e.g. TWR);
//! List of real ATC suffixes (e.g. TWR);
static const QStringList &atcCallsignSuffixes();
//! List of real ("TWR") and treated like ATC suffixes (e.g. OBS);
static const QStringList &atcAlikeCallsignSuffixes();
protected:
//! \copydoc CValueObject::convertToQString()
virtual QString convertToQString(bool i18n = false) const override;
@@ -110,10 +119,10 @@ namespace BlackMisc
} // namespace
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Aviation::CCallsign, (
attr(o.m_callsign, flags<CaseInsensitiveComparison>()),
attr(o.m_callsignAsSet, flags<DisabledForComparison>()),
attr(o.m_telephonyDesignator, flags<DisabledForComparison>())
))
attr(o.m_callsign, flags<CaseInsensitiveComparison>()),
attr(o.m_callsignAsSet, flags<DisabledForComparison>()),
attr(o.m_telephonyDesignator, flags<DisabledForComparison>())
))
Q_DECLARE_METATYPE(BlackMisc::Aviation::CCallsign)
#endif // guard