swift
|
Value object encapsulating information about an airpot. More...
Public Types | |
enum | ColumnIndex { IndexIcao = swift::misc::CPropertyIndexRef::GlobalIndexCAirport , IndexLocation , IndexDescriptiveName , IndexPosition , IndexCountry , IndexElevation , IndexOperating } |
Properties by index. | |
![]() | |
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 { IndexRelativeDistance = CPropertyIndexRef::GlobalIndexICoordinateWithRelativePosition , IndexRelativeBearing } |
Properties by index. | |
![]() | |
enum | ColumnIndex { IndexLatitude = CPropertyIndexRef::GlobalIndexICoordinateGeodetic , IndexLongitude , IndexLatitudeAsString , IndexLongitudeAsString , IndexGeodeticHeight , IndexGeodeticHeightAsString , IndexNormalVector } |
Properties by index. | |
![]() | |
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 | |
CAirport ()=default | |
Default constructor. | |
CAirport (const QString &icao) | |
Simplified constructor. | |
CAirport (const CAirportIcaoCode &icao, const swift::misc::geo::CCoordinateGeodetic &position) | |
ATC station constructor. | |
CAirport (const CAirportIcaoCode &icao, const swift::misc::geo::CCoordinateGeodetic &position, const QString &descriptiveName) | |
ATC station constructor. | |
const CAirportIcaoCode & | getIcao () const |
Get ICAO code. | |
const QString & | getIcaoAsString () const |
Get ICAO code as string. | |
void | setIcao (const CAirportIcaoCode &icao) |
Set ICAO code. | |
const QString & | getLocation () const |
Get location (e.g. "London") | |
QString | getLocationPlusOptionalName () const |
Location plus optional name (if available and different from location) | |
void | setLocation (const QString &location) |
Set location. | |
bool | matchesLocation (const QString &location) const |
Matches location? | |
const QString & | getDescriptiveName () const |
Get descriptive name. | |
void | setDescriptiveName (const QString &name) |
Set descriptive name. | |
bool | matchesDescriptiveName (const QString &name) const |
Matches name? | |
const swift::misc::geo::CCoordinateGeodetic & | getPosition () const |
Get the position. | |
void | setPosition (const swift::misc::geo::CCoordinateGeodetic &position) |
Set position. | |
const CCountry & | getCountry () const |
Get the country. | |
void | setCountry (const CCountry &country) |
Set the country. | |
const swift::misc::aviation::CAltitude & | getElevation () const |
Elevation. More... | |
void | setElevation (const swift::misc::aviation::CAltitude &elevation) |
Elevation. More... | |
bool | isOperating () const |
Is the airport still active? | |
void | setOperating (bool operating) |
Sets the value of. More... | |
void | updateMissingParts (const CAirport &airport) |
Update the missing parts in airport. | |
const swift::misc::aviation::CAltitude & | geodeticHeight () const |
Height, ellipsoidal or geodetic height (used in GPS) More... | |
bool | hasValidIcaoCode () const |
Valid ICAO code. | |
virtual bool | isNull () const |
NULL airport? | |
virtual swift::misc::geo::CLatitude | latitude () const |
Latitude. More... | |
virtual swift::misc::geo::CLongitude | longitude () const |
Longitude. More... | |
virtual QVector3D | normalVector () const |
Normal vector. More... | |
virtual std::array< double, 3 > | normalVectorDouble () const |
Normal vector with double precision. More... | |
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 CAirport &compareValue) const |
Compare by index. | |
QString | convertToQString (bool i18n=false) const |
Cast as QString. More... | |
![]() | |
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. | |
![]() | |
const physical_quantities::CLength & | getRelativeDistance () const |
Get the distance. | |
void | setRelativeDistance (const physical_quantities::CLength &distance) |
Set relative distance. | |
const physical_quantities::CAngle & | getRelativeBearing () const |
Get the relative bearing. | |
void | setRelativeBearing (const physical_quantities::CAngle &angle) |
Set bearing to own plane. | |
bool | hasValidRelativeDistance () const |
Valid distance? | |
bool | hasValidRelativeBearing () const |
Valid bearing? | |
physical_quantities::CLength | calculcateAndUpdateRelativeDistance (const geo::ICoordinateGeodetic &position) |
Calculcate distance, set it, and return distance. | |
physical_quantities::CLength | calculcateAndUpdateRelativeDistanceAndBearing (const geo::ICoordinateGeodetic &position) |
Calculcate distance and bearing to plane, set it, and return distance. | |
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 ICoordinateWithRelativePosition &compareValue) const |
Compare for index. More... | |
QString | convertToQString (bool i18n=false) const |
Cast as QString. More... | |
![]() | |
ICoordinateGeodetic ()=default | |
Ctor. | |
virtual | ~ICoordinateGeodetic () |
Destructor. | |
ICoordinateGeodetic (const ICoordinateGeodetic &)=default | |
Copy constructor. | |
ICoordinateGeodetic & | operator= (const ICoordinateGeodetic &)=default |
Copy assignment operator. | |
bool | equalNormalVectorDouble (const std::array< double, 3 > &otherVector) const |
Is equal? Epsilon considered. | |
bool | equalNormalVectorDouble (const ICoordinateGeodetic &otherCoordinate) const |
Is equal, epsilon considered? | |
QString | latitudeAsString () const |
Latitude as string. | |
QString | longitudeAsString () const |
Longitude as string. | |
QString | geodeticHeightAsString () const |
Height as string. | |
bool | isGeodeticHeightNull () const |
Geodetic height null? | |
bool | hasMSLGeodeticHeight () const |
Geodetic height not null and aviation::CAltitude::MeanSeaLevel. | |
physical_quantities::CLength | calculateGreatCircleDistance (const ICoordinateGeodetic &otherCoordinate) const |
Great circle distance. | |
bool | isWithinRange (const ICoordinateGeodetic &otherCoordinate, const physical_quantities::CLength &range) const |
Object within range? | |
physical_quantities::CAngle | calculateBearing (const ICoordinateGeodetic &otherCoordinate) const |
Initial bearing. | |
QVariant | propertyByIndex (CPropertyIndexRef index) const |
Property by index. More... | |
int | comparePropertyByIndex (CPropertyIndexRef index, const ICoordinateGeodetic &compareValue) const |
Compare for index. More... | |
QString | convertToQString (bool i18n=false) const |
Cast as QString. More... | |
bool | isNaNVector () const |
Check values. | |
bool | isNaNVectorDouble () const |
Check values. | |
bool | isInfVector () const |
Check values. | |
bool | isInfVectorDouble () const |
Check values. | |
bool | isValidVectorRange () const |
Check values. | |
![]() | |
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 CAirport | fromDatabaseJson (const QJsonObject &json, const QString &prefix=QString()) |
Object from JSON. | |
![]() | |
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 bool | isValidVector (const std::array< double, 3 > &v) |
Check values. | |
![]() | |
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. | |
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. | |
![]() | |
ICoordinateWithRelativePosition () | |
Constructor. | |
![]() | |
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 | canHandleIndex (CPropertyIndexRef index) |
Can given index be handled? | |
![]() | |
static bool | canHandleIndex (CPropertyIndexRef index) |
Can given index be handled? | |
![]() | |
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? | |
![]() | |
physical_quantities::CAngle | m_relativeBearing { 0, nullptr } |
temporary stored value | |
physical_quantities::CLength | m_relativeDistance { 0, nullptr } |
temporary stored value | |
![]() | |
int | m_dbKey = -1 |
key | |
![]() | |
QString | m_version |
version info | |
![]() | |
qint64 | m_timestampMSecsSinceEpoch = -1 |
timestamp value | |
QString swift::misc::aviation::CAirport::convertToQString | ( | bool | i18n = false | ) | const |
Cast as QString.
Definition at line 62 of file airport.cpp.
|
inlinevirtual |
Height, ellipsoidal or geodetic height (used in GPS)
This is approximately MSL (orthometric) height, aka altitude, aka elevation. The terms "geodetic height", "altitude", and "elevation" are interchangable. "Geodetic height" is the generic, context-free term for the vertical component of a position. This is commonly called "altitude" for objects that can move freely in the vertical component. By a similar convention, "elevation" is commonly used for objects that are fixed to the ground.
Implements swift::misc::geo::ICoordinateGeodetic.
|
inline |
|
inlinevirtual |
Latitude.
Implements swift::misc::geo::ICoordinateGeodetic.
|
inlinevirtual |
Longitude.
Implements swift::misc::geo::ICoordinateGeodetic.
|
inlinevirtual |
Normal vector.
Implements swift::misc::geo::ICoordinateGeodetic.
|
inlinevirtual |
Normal vector with double precision.
Implements swift::misc::geo::ICoordinateGeodetic.
QVariant swift::misc::aviation::CAirport::propertyByIndex | ( | swift::misc::CPropertyIndexRef | index | ) | const |
Property by index.
Definition at line 93 of file airport.cpp.
|
inline |
|
inline |
void swift::misc::aviation::CAirport::setPropertyByIndex | ( | swift::misc::CPropertyIndexRef | index, |
const QVariant & | variant | ||
) |
Set property by index.
Definition at line 112 of file airport.cpp.