swift
|
Value object for ICAO classification. More...
Public Types | |
enum | ColumnIndex { IndexAircraftDesignator = CPropertyIndexRef::GlobalIndexCAircraftIcaoCode , IndexIataCode , IndexFamily , IndexCombinedAircraftType , IndexManufacturer , IndexModelDescription , IndexModelIataDescription , IndexModelSwiftDescription , IndexCombinedDescription , IndexWtc , IndexIsRealworld , IndexIsMilitary , IndexIsLegacy , IndexIsVtol , IndexRank , IndexCategory , IndexDesignatorManufacturer } |
Properties by index. More... | |
![]() | |
using | base_type = CEmpty |
Base class. | |
![]() | |
using | base_type = CEmpty |
Base class is alias of itself. | |
![]() | |
enum | ColumnIndex { IndexPixmap = 10 , IndexIcon , IndexString } |
Base class enums. | |
![]() | |
enum | ColumnIndex { IndexDbIntegerKey = CPropertyIndexRef::GlobalIndexIDatastoreInteger , IndexDbKeyAsString , IndexIsLoadedFromDb , IndexDatabaseIcon , IndexVersion , IndexEndMarker } |
Property index. More... | |
![]() | |
enum | ColumnIndex { IndexUtcTimestamp = CPropertyIndexRef::GlobalIndexITimestampBased , IndexUtcTimestampFormattedYmdhms , IndexUtcTimestampFormattedYmdhmsz , IndexUtcTimestampFormattedMdhms , IndexUtcTimestampFormattedMdhmsz , IndexUtcTimestampFormattedDhms , IndexUtcTimestampFormattedHms , IndexUtcTimestampFormattedHm , IndexMSecsSinceEpoch } |
Properties by index. | |
Public Member Functions | |
CAircraftIcaoCode () | |
Default constructor. | |
CAircraftIcaoCode (const QString &icao, const QString &combinedType="") | |
Constructor. | |
CAircraftIcaoCode (const QString &icao, const QString &combinedType, const QString &manufacturer, const QString &model, CWakeTurbulenceCategory wtc, bool realworld, bool legacy, bool military, int rank) | |
Constructor. | |
CAircraftIcaoCode (const QString &icao, const QString &iata, const QString &combinedType, const QString &manufacturer, const QString &model, CWakeTurbulenceCategory wtc, bool realworld, bool legacy, bool military, int rank) | |
Constructor. | |
CAircraftIcaoCode (const QString &icao, const QString &iata, const QString &family, const QString &combinedType, const QString &manufacturer, const QString &model, const QString &modelIata, const QString &modelSwift, CWakeTurbulenceCategory wtc, bool realworld, bool legacy, bool military, int rank) | |
Constructor. | |
const QString & | getDesignator () const |
Get ICAO designator, e.g. "B737". | |
QString | getDesignatorDbKey () const |
Designator and DB key. | |
QString | getDesignatorManufacturer () const |
Designator + Manufacturer. | |
void | setDesignator (const QString &icaoDesignator) |
Set ICAO designator, e.g. "B737". | |
bool | hasDesignator () const |
Aircraft designator? | |
bool | hasValidDesignator () const |
Valid aircraft designator? | |
bool | hasKnownDesignator () const |
Has designator and designator is not "ZZZZ". | |
bool | hasSpecialDesignator () const |
Special designator. | |
const QString & | getIataCode () const |
IATA code. | |
void | setIataCode (const QString &iata) |
Set IATA code. | |
bool | hasIataCode () const |
Has IATA code? | |
bool | isIataSameAsDesignator () const |
IATA code same as designator? | |
const QString & | getFamily () const |
Family (e.g. A350) | |
void | setFamily (const QString &family) |
Set family. | |
bool | hasFamily () const |
Has family? | |
bool | isFamilySameAsDesignator () const |
Family same as designator? | |
const QString & | getCombinedType () const |
Get type, e.g. "L2J". | |
bool | hasValidCombinedType () const |
Combined type available? | |
QString | getEngineType () const |
Get engine type, e.g. "J". | |
QChar | getEngineTypeChar () const |
Get engine type, e.g. "J". | |
int | getEnginesCount () const |
Engine count if any, -1 if no value is set. | |
QString | getEngineCountString () const |
Engine count as string, if not available "". | |
QString | getAircraftType () const |
Aircraft type, such a L(andplane), S(eaplane), H(elicopter) | |
QChar | getAircraftTypeChar () const |
Aircraft type, such a L(andplane), S(eaplane), H(elicopter) | |
void | setCombinedType (const QString &type) |
Set type. | |
const QString & | getModelDescription () const |
Get IACO model description, e.g. "A-330-200". | |
const QString & | getModelIataDescription () const |
Get IATA model description. | |
const QString & | getModelSwiftDescription () const |
Get swift model description. | |
QString | getCombinedModelDescription () const |
Combined description. | |
bool | matchesAnyDescription (const QString &candidate) const |
Matches any of the (unempty) descriptions. | |
bool | matchesCombinedType (const QString &combinedType) const |
Matches given combined code. More... | |
bool | matchesCombinedTypeAndManufacturer (const QString &combinedType, const QString &manufacturer) const |
Matches combined type and. | |
void | setModelDescription (const QString &modelDescription) |
Set the model description (ICAO description) | |
void | setModelIataDescription (const QString &modelDescription) |
Set the alternative IATA model description. | |
void | setModelSwiftDescription (const QString &modelDescription) |
Set the alternative swift model description. | |
bool | hasModelDescription () const |
Has model description? | |
bool | hasModelIataDescription () const |
Has IATA model description? | |
bool | hasModelSwiftDescription () const |
Has swift model description? | |
const QString & | getManufacturer () const |
Get manufacturer, e.g. "Airbus". | |
void | setManufacturer (const QString &manufacturer) |
Set the manufacturer. | |
bool | hasManufacturer () const |
Manufacturer. | |
bool | matchesManufacturer (const QString &manufacturer) const |
Matching the manufacturer? | |
CWakeTurbulenceCategory | getWtc () const |
Get WTC. | |
void | setWtc (CWakeTurbulenceCategory wtc) |
Set WTC. | |
bool | hasValidWtc () const |
Valid WTC code? | |
bool | isVtol () const |
Is VTOL aircraft (helicopter, tilt wing) | |
bool | isMilitary () const |
Military? | |
bool | isRealWorld () const |
Real world aircraft? | |
bool | isLegacyAircraft () const |
Legacy aircraft (no current ICAO code) | |
bool | isDbDuplicate () const |
Is DB duplicate? This means a redundant ICAO DB entry. More... | |
void | setCodeFlags (bool military, bool legacy, bool realWorld) |
Flags. | |
void | setMilitary (bool military) |
Military. | |
void | setRealWorld (bool realWorld) |
Real world. | |
void | setLegacy (bool legacy) |
Legacy. | |
int | getRank () const |
Ranking. | |
QString | getRankString () const |
Ranking. | |
void | setRank (int rank) |
Ranking. | |
QString | getCombinedIcaoStringWithKey () const |
Combined ICAO descriptive string with key. | |
QString | getCombinedIcaoCategoryStringWithKey () const |
Combined ICAO descriptive string with category and key. | |
QString | getCombinedIataStringWithKey () const |
Combined IATA descriptive string with key. | |
QString | getCombinedFamilyStringWithKey () const |
Combined family descriptive string with key. | |
const CAircraftCategory & | getCategory () const |
Get category. | |
bool | hasCategory () const |
Has category? | |
void | setCategory (const CAircraftCategory &category) |
Set category. | |
void | setCategoryId (int id) |
Set category id. | |
bool | hasCompleteData () const |
All data set? | |
bool | matchesDesignator (const QString &designator, int fuzzyMatch=-1, int *result=nullptr) const |
Matches designator string? | |
bool | matchesIataCode (const QString &iata, int fuzzyMatch=-1, int *result=nullptr) const |
Matches IATA string? More... | |
bool | matchesFamily (const QString &family, int fuzzyMatch=-1, int *result=nullptr) const |
Matches family? | |
bool | matchesDesignatorOrIata (const QString &icaoOrIata) const |
Matches ICAO or IATA code. | |
bool | matchesDesignatorIataOrFamily (const QString &icaoIataOrFamily) const |
Matches ICAO, IATA, family? | |
QVariant | propertyByIndex (swift::misc::CPropertyIndexRef index) const |
Property by index. More... | |
void | setPropertyByIndex (swift::misc::CPropertyIndexRef index, const QVariant &variant) |
Set property by index. More... | |
int | comparePropertyByIndex (CPropertyIndexRef index, const CAircraftIcaoCode &compareValue) const |
Compare for index. More... | |
QString | convertToQString (bool i18n=false) const |
Cast as QString. More... | |
void | updateMissingParts (const CAircraftIcaoCode &otherIcaoCode) |
Update missing parts. | |
CStatusMessageList | validate () const |
Validate data. | |
QString | asHtmlSummary () const |
As a brief HTML summary (e.g. used in tooltips) | |
int | calculateScore (const CAircraftIcaoCode &otherCode, CStatusMessageList *log=nullptr) const |
Considers rank, manufacturer and family 0..100. More... | |
void | guessModelParameters (physical_quantities::CLength &guessedCGOut, physical_quantities::CSpeed &guessedVRotateOut) const |
Guess aircraft model parameters. More... | |
bool | isNull () const |
Null ICAO? | |
![]() | |
int | getMetaTypeId () const |
Returns the Qt meta type ID of this object. More... | |
QString | getClassName () const |
Class name. | |
bool | isA (int metaTypeId) const |
Returns true if this object is an instance of the class with the given meta type ID, or one of its subclasses. | |
![]() | |
void | marshallToDbus (QDBusArgument &arg, Tags...) const |
Marshall without begin/endStructure, for when composed within another object. | |
void | unmarshallFromDbus (const QDBusArgument &arg, Tags...) |
Unmarshall without begin/endStructure, for when composed within another object. | |
![]() | |
void | marshalToDataStream (QDataStream &stream) const |
Marshal a value to a QDataStream. | |
void | unmarshalFromDataStream (QDataStream &stream) |
Unmarshal a value from a QDataStream. | |
![]() | |
QJsonObject | toJson () const |
Cast to JSON object. | |
QString | toJsonString (QJsonDocument::JsonFormat format=QJsonDocument::Indented) const |
Convenience function JSON as string. | |
void | convertFromJson (const QJsonObject &json) |
Assign from JSON object. | |
void | convertFromJson (const QString &jsonString, bool acceptCacheFormat=false) |
Assign from JSON object string. | |
![]() | |
QString | toQString (bool i18n=false) const |
Cast as QString. | |
std::string | toStdString (bool i18n=false) const |
To std string. | |
QString | stringForStreaming () const |
String for streaming operators. | |
![]() | |
CPropertyIndexList | apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false) |
Update by variant map. More... | |
void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
Set property by index. | |
QVariant | propertyByIndex (CPropertyIndexRef index) const |
Property by index. | |
int | comparePropertyByIndex (CPropertyIndexRef index, const Derived &compareValue) const |
Compare for index. | |
bool | equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const |
Is given variant equal to value of property index? | |
![]() | |
CIcons::IconIndex | toIcon () const |
As icon, not implemented by all classes. | |
![]() | |
int | getDbKey () const |
Get DB key. | |
QString | getDbKeyAsString () const |
DB key as string. | |
QJsonValue | getDbKeyAsJsonValue () const |
Key as JSON value, or null. | |
QString | getDbKeyAsStringInParentheses (const QString &prefix={}) const |
Db key in parentheses, e.g. "(3)". | |
void | setDbKey (int key) |
Set the DB key. | |
void | setDbKey (const QString &key) |
DB key passed as string. | |
bool | hasValidDbKey () const |
Has valid DB key. | |
bool | isDbEqual (const IDatastoreObjectWithIntegerKey &other) const |
Same DB key and hence equal. | |
bool | isLoadedFromDb () const |
Loaded from DB. More... | |
bool | matchesDbKeyState (db::DbKeyStateFilter filter) const |
Matches filter? | |
const CIcon & | toDatabaseIcon () const |
Database icon if this has valid key, otherwise empty. | |
![]() | |
const QString & | getVersion () const |
Version info. | |
QVersionNumber | getQVersion () const |
Version as QVersion. | |
bool | hasVersion () const |
Having a version?s. | |
void | setVersion (const QString &version) |
Version info. | |
![]() | |
QDateTime | getUtcTimestamp () const |
Get timestamp. | |
qint64 | getMSecsSinceEpoch () const |
Timestamp as ms value. | |
qint64 | getTimeDifferenceMs (qint64 compareTime) const |
Time difference in ms. | |
qint64 | getTimeDifferenceAbsMs (qint64 compareTime) const |
Time difference in ms. | |
qint64 | getTimeDifferenceToNowMs () const |
Time difference to now. | |
qint64 | getTimeDifferenceMs (const ITimestampBased &compare) const |
Time difference in ms. | |
qint64 | getAbsTimeDifferenceMs (qint64 compareTime) const |
Time difference in ms. | |
qint64 | getAbsTimeDifferenceMs (const ITimestampBased &compare) const |
Time difference in ms. | |
void | setTimestampToNull () |
Set to null. | |
void | setMSecsSinceEpoch (qint64 mSecsSinceEpoch) |
Timestamp as ms value. | |
void | setByYearMonthDayHourMinute (const QString &yyyyMMddhhmmss) |
Set by value such as "20141003231045". | |
void | setUtcTimestamp (const QDateTime ×tamp) |
Set timestamp. | |
bool | isNewerThan (const ITimestampBased &otherTimestampObj) const |
Is this newer than other? | |
bool | isNewerThan (qint64 mSecsSinceEpoch) const |
Is newer than epoch value? | |
bool | isOlderThan (const ITimestampBased &otherTimestampObj) const |
Is this older than other? | |
bool | isOlderThan (qint64 mSecsSinceEpoch) const |
Is this older than other? | |
bool | isOlderThanNowMinusOffset (int offsetMs) const |
Older than now-offset. | |
bool | isSame (const ITimestampBased &otherTimestampObj) const |
Same timestamp. | |
qint64 | msecsTo (const ITimestampBased &otherTimestampObj) const |
Time difference. | |
qint64 | absMsecsTo (const ITimestampBased &otherTimestampObj) const |
Time difference. | |
qint64 | msecsToNow () const |
Milliseconds to now. | |
void | setCurrentUtcTime () |
Set the current time as timestamp. | |
void | addMsecs (qint64 ms) |
Add the given number of milliseconds to the timestamp. | |
QString | getFormattedUtcTimestampHms () const |
As hh:mm:ss. | |
QString | getFormattedUtcTimestampHmsz () const |
As hh:mm:ss.zzz. | |
QString | getFormattedUtcTimestampHm () const |
As hh:mm. | |
QString | getFormattedUtcTimestampDhms () const |
As dd HH mm ss. | |
QString | getFormattedUtcTimestampMdhms () const |
As MM dd HH mm ss. | |
QString | getFormattedUtcTimestampMdhmsz () const |
As MM dd HH mm ss.zzz. | |
QString | getFormattedUtcTimestampYmdhms () const |
As yyyy MM dd HH mm ss. | |
QString | getFormattedUtcTimestampYmdhmsz () const |
As yyyy MM dd HH mm ss.zzz. | |
bool | hasValidTimestamp () const |
Valid timestamp? | |
Static Public Member Functions | |
static const CAircraftIcaoCode & | null () |
NULL object. | |
static bool | isValidDesignator (const QString &designator) |
Valid designator? | |
static bool | isValidCombinedType (const QString &combinedType) |
Valid combined type. | |
static const QString & | getUnassignedDesignator () |
The unassigned designator ("ZZZZ") | |
static const QString & | getGliderDesignator () |
Get the glider designator. | |
static const CAircraftIcaoCode & | unassignedIcao () |
Unassigned ICAO code "ZZZZ". | |
static const QStringList & | getSpecialDesignators () |
List of the special designators ("ZZZZ", "UHEL", ...) | |
static QString | normalizeDesignator (const QString &candidate) |
Normalize designator, remove illegal characters. | |
static QStringList | alternativeCombinedCodes (const QString &combinedCode) |
Create relaxed combined codes, e.g "L2J" -> "L3J", ... | |
static bool | isEPTEngineType (const QChar engineType) |
Engine tye is Electric, Piston, TurboProp. | |
static CStatusMessage | logMessage (const CAircraftIcaoCode &icaoCode, const QString &message, const QStringList &extraCategories={}, CStatusMessage::StatusSeverity s=CStatusMessage::SeverityInfo) |
Specialized log message for matching / reverse lookup. More... | |
static void | addLogDetailsToList (CStatusMessageList *log, const CAircraftIcaoCode &icao, const QString &message, const QStringList &extraCategories={}, CStatusMessage::StatusSeverity s=CStatusMessage::SeverityInfo) |
Specialized log for matching / reverse lookup. More... | |
static CAircraftIcaoCode | fromDatabaseJson (const QJsonObject &json, const QString &prefix=QString()) |
From our database JSON format. | |
![]() | |
static void | registerMetadata () |
Register metadata. | |
![]() | |
template<class DerivedObj = Derived> | |
static DerivedObj | fromJson (const QJsonObject &json) |
Get object from QJsonObject. | |
template<class DerivedObj = Derived> | |
static DerivedObj | fromJson (const QString &jsonString, bool acceptCacheJson=false) |
Get object from JSON string. | |
template<class DerivedObj = Derived> | |
static DerivedObj | fromJsonNoThrow (const QString &jsonString, bool acceptCacheJson, bool &success, QString &errMsg) |
Get object from JSON string. | |
![]() | |
static int | invalidDbKey () |
Invalid key. | |
static int | stringToDbKey (const QString &candidate) |
Convert string to DB key. | |
static const CPropertyIndex & | keyIndex () |
The key index. | |
![]() | |
static bool | isAnyTimestampIndex (int index) |
Any of the timestamp indexes. | |
static bool | canHandleIndex (CPropertyIndexRef index) |
Can given index be handled. | |
Static Public Attributes | |
static constexpr int | DesignatorMinLength = 2 |
designator length (min) | |
static constexpr int | DesignatorMaxLength = 5 |
designator length (max) | |
Additional Inherited Members | |
![]() | |
CValueObject ()=default | |
Default constructor. | |
CValueObject (const CValueObject &)=default | |
Copy constructor. | |
CValueObject & | operator= (const CValueObject &)=default |
Copy assignment operator. | |
~CValueObject ()=default | |
Destructor. | |
CEmpty ()=default | |
Inheriting constructors. | |
CEmpty (const CEmpty &)=default | |
Inheriting constructors. | |
![]() | |
CEmpty ()=default | |
Protected default constructor. | |
CEmpty (const CEmpty &)=default | |
Protected copy constructor. | |
CEmpty & | operator= (const CEmpty &)=default |
Protected copy assignment operator. | |
~CEmpty ()=default | |
Non-virtual protected destructor. | |
![]() | |
IDatastoreObjectWithIntegerKey () | |
Constructor. | |
IDatastoreObjectWithIntegerKey (int key) | |
Constructor. | |
void | setKeyVersionTimestampFromDatabaseJson (const QJsonObject &json, const QString &prefix=QString()) |
Set key and timestamp values. | |
QVariant | propertyByIndex (swift::misc::CPropertyIndexRef index) const |
Property by index. More... | |
void | setPropertyByIndex (swift::misc::CPropertyIndexRef index, const QVariant &variant) |
Set property by index. More... | |
int | comparePropertyByIndex (CPropertyIndexRef index, const IDatastoreObjectWithIntegerKey &compareValue) const |
Compare for index. More... | |
![]() | |
void | setTimestampVersionFromDatabaseJson (const QJsonObject &json, const QString &prefix=QString()) |
Set versionn and timestamp values. | |
![]() | |
ITimestampBased () | |
Constructor. | |
ITimestampBased (qint64 msSincePoch) | |
Constructor. | |
ITimestampBased (const QDateTime ×tamp) | |
Constructor. | |
QVariant | propertyByIndex (CPropertyIndexRef index) const |
Property by index. More... | |
void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
Set property by index. More... | |
int | comparePropertyByIndex (CPropertyIndexRef index, const ITimestampBased &compareValue) const |
Compare for index. More... | |
void | updateMissingParts (const ITimestampBased &other) |
Update missing parts. | |
![]() | |
static bool | existsKey (const QJsonObject &json, const QString &prefix=QString()) |
Is a key available? | |
static bool | canHandleIndex (swift::misc::CPropertyIndexRef index) |
Can given index be handled? | |
![]() | |
int | m_dbKey = -1 |
key | |
![]() | |
QString | m_version |
version info | |
![]() | |
qint64 | m_timestampMSecsSinceEpoch = -1 |
timestamp value | |
Value object for ICAO classification.
Definition at line 29 of file aircrafticaocode.h.
Properties by index.
Enumerator | |
---|---|
IndexDesignatorManufacturer | designator and manufacturer |
Definition at line 35 of file aircrafticaocode.h.
|
static |
Specialized log for matching / reverse lookup.
Definition at line 862 of file aircrafticaocode.cpp.
int swift::misc::aviation::CAircraftIcaoCode::calculateScore | ( | const CAircraftIcaoCode & | otherCode, |
CStatusMessageList * | log = nullptr |
||
) | const |
Considers rank, manufacturer and family 0..100.
Definition at line 153 of file aircrafticaocode.cpp.
int swift::misc::aviation::CAircraftIcaoCode::comparePropertyByIndex | ( | CPropertyIndexRef | index, |
const CAircraftIcaoCode & | compareValue | ||
) | const |
Compare for index.
Definition at line 710 of file aircrafticaocode.cpp.
QString swift::misc::aviation::CAircraftIcaoCode::convertToQString | ( | bool | i18n = false | ) | const |
Cast as QString.
Definition at line 74 of file aircrafticaocode.cpp.
void swift::misc::aviation::CAircraftIcaoCode::guessModelParameters | ( | physical_quantities::CLength & | guessedCGOut, |
physical_quantities::CSpeed & | guessedVRotateOut | ||
) | const |
Guess aircraft model parameters.
Definition at line 257 of file aircrafticaocode.cpp.
bool swift::misc::aviation::CAircraftIcaoCode::isDbDuplicate | ( | ) | const |
Is DB duplicate? This means a redundant ICAO DB entry.
Definition at line 511 of file aircrafticaocode.cpp.
|
static |
Specialized log message for matching / reverse lookup.
Definition at line 852 of file aircrafticaocode.cpp.
bool swift::misc::aviation::CAircraftIcaoCode::matchesCombinedType | ( | const QString & | combinedType | ) | const |
Matches given combined code.
Definition at line 439 of file aircrafticaocode.cpp.
bool swift::misc::aviation::CAircraftIcaoCode::matchesIataCode | ( | const QString & | iata, |
int | fuzzyMatch = -1 , |
||
int * | result = nullptr |
||
) | const |
Matches IATA string?
Definition at line 596 of file aircrafticaocode.cpp.
QVariant swift::misc::aviation::CAircraftIcaoCode::propertyByIndex | ( | swift::misc::CPropertyIndexRef | index | ) | const |
Property by index.
Definition at line 647 of file aircrafticaocode.cpp.
void swift::misc::aviation::CAircraftIcaoCode::setPropertyByIndex | ( | swift::misc::CPropertyIndexRef | index, |
const QVariant & | variant | ||
) |
Set property by index.
Definition at line 678 of file aircrafticaocode.cpp.