|
swift
|
Value object encapsulating information of aircraft's parts. More...
#include <aircraftparts.h>
Public Types | |
| enum | ColumnIndex { IndexLights = CPropertyIndexRef::GlobalIndexCAircraftParts , IndexGearDown , IndexFlapsPercentage , IndexSpoilersOut , IndexEngines , IndexEnginesAsString , IndexIsOnGround } |
| Properties by index. More... | |
| enum | PartsDetails { NotSet , FSDAircraftParts , GuessedParts } |
| Parts Details. More... | |
| Public Types inherited from swift::misc::CValueObject< CAircraftParts > | |
| using | base_type |
| Base class. | |
| Public Types inherited from swift::misc::CEmpty | |
| using | base_type = CEmpty |
| Base class is alias of itself. | |
| Public Types inherited from swift::misc::mixin::Index< CAircraftParts > | |
| enum | ColumnIndex |
| Base class enums. More... | |
| Public Types inherited from swift::misc::ITimestampWithOffsetBased | |
| enum | ColumnIndex { IndexOffsetMs , IndexAdjustedMsWithOffset , IndexOffsetWithUnit } |
| Properties by index. More... | |
| Public Types inherited from swift::misc::ITimestampBased | |
| enum | ColumnIndex { IndexUtcTimestamp = CPropertyIndexRef::GlobalIndexITimestampBased , IndexUtcTimestampFormattedYmdhms , IndexUtcTimestampFormattedYmdhmsz , IndexUtcTimestampFormattedMdhms , IndexUtcTimestampFormattedMdhmsz , IndexUtcTimestampFormattedDhms , IndexUtcTimestampFormattedHms , IndexUtcTimestampFormattedHm , IndexMSecsSinceEpoch } |
| Properties by index. More... | |
Public Member Functions | |
| CAircraftParts ()=default | |
| Default constructor. | |
| CAircraftParts (int flapsPercent) | |
| Default constructor. | |
| CAircraftParts (const CAircraftLights &lights, bool gearDown, int flapsPercent, bool spoilersOut, const CAircraftEngineList &engines, bool onGround) | |
| Constructor. | |
| CAircraftParts (const CAircraftLights &lights, bool gearDown, int flapsPercent, bool spoilersOut, const CAircraftEngineList &engines, bool onGround, qint64 timestamp) | |
| Constructor. | |
| QVariant | propertyByIndex (CPropertyIndexRef index) const |
| Property by index. | |
| void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const CAircraftParts &compareValue) const |
| Compare for index. | |
| CAircraftLights | getLights () const |
| Get aircraft lights. | |
| CAircraftLights | getAdjustedLights () const |
| Lights adjusted depending on engines. | |
| CAircraftLights & | lights () |
| Reference to lights, meant for easy direct changes of the values. | |
| void | setLights (const CAircraftLights &lights) |
| Set aircraft lights. | |
| void | setAllLightsOn () |
| Set all lights on. | |
| void | setAllLightsOff () |
| Set all lights off. | |
| bool | isGearDown () const |
| Is gear down? | |
| bool | isFixedGearDown () const |
| Is fixed gear down? | |
| void | setGearDown (bool down) |
| Set gear down. | |
| int | getFlapsPercent () const |
| Get flaps position in percent. | |
| void | setFlapsPercent (int flapsPercent) |
| Set flaps position in percent. | |
| bool | isSpoilersOut () const |
| Are spoilers out? | |
| void | setSpoilersOut (bool out) |
| Set spoilers out. | |
| CAircraftEngineList | getEngines () const |
| Get engines. | |
| CAircraftEngineList & | engines () |
| Direct access to engines, meant for simple value modifications. | |
| CAircraftEngine | getEngine (int number) const |
| Engine with number. | |
| int | getEnginesCount () const |
| Number of engines. | |
| bool | isEngineOn (int number) const |
| Is engine with number 1..n on? | |
| bool | isAnyEngineOn () const |
| Any engine on? | |
| void | setEngines (const CAircraftEngineList &engines) |
| Set engines. | |
| void | setEngines (const CAircraftEngine &engine, int engineNumber) |
| Copy one engine multiple times (number) and set the number of engines to number. | |
| bool | isOnGround () const |
| Is aircraft on ground? | |
| void | setOnGround (bool onGround) |
| Set aircraft on ground. | |
| PartsDetails | getPartsDetails () const |
| Get parts details. | |
| const QString & | getPartsDetailsAsString () const |
| Parts details as string. | |
| void | setPartsDetails (PartsDetails details) |
| Set parts details. | |
| QString | convertToQString (bool i18n=false) const |
| Cast as QString. | |
| QJsonObject | toIncrementalJson () const |
| Incremental JSON object. | |
| QJsonObject | toFullJson () const |
| Full JSON Object. | |
| bool | isNull () const |
| NULL parts object? | |
| bool | equalValues (const CAircraftParts &other) const |
| Equal values, but not comparing timestamp etc. | |
| Public Member Functions inherited from swift::misc::mixin::MetaType< CAircraftParts > | |
| int | getMetaTypeId () const |
| Returns the Qt meta type ID of this object. | |
| 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. | |
| Public Member Functions inherited from swift::misc::mixin::DBusByMetaClass< CAircraftParts > | |
| 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. | |
| Public Member Functions inherited from swift::misc::mixin::DataStreamByMetaClass< CAircraftParts > | |
| void | marshalToDataStream (QDataStream &stream) const |
| Marshal a value to a QDataStream. | |
| void | unmarshalFromDataStream (QDataStream &stream) |
| Unmarshal a value from a QDataStream. | |
| Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< CAircraftParts > | |
| 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. | |
| Public Member Functions inherited from swift::misc::mixin::String< CAircraftParts > | |
| 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. | |
| Public Member Functions inherited from swift::misc::mixin::Index< CAircraftParts > | |
| CPropertyIndexList | apply (const CPropertyIndexVariantMap &indexMap, bool skipEqualValues=false) |
| Update by variant map. | |
| void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| QVariant | propertyByIndex (CPropertyIndexRef index) const |
| Property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const CAircraftParts &compareValue) const |
| Compare for index. | |
| bool | equalsPropertyByIndex (const QVariant &compareValue, CPropertyIndexRef index) const |
| Is given variant equal to value of property index? | |
| Public Member Functions inherited from swift::misc::mixin::Icon< CAircraftParts > | |
| CIcons::CIcons::StandardIconUnknown16 | toIcon () const |
| As icon, not implemented by all classes. | |
| Public Member Functions inherited from swift::misc::ITimestampWithOffsetBased | |
| void | setTimeOffsetMs (qint64 offset) |
| Milliseconds to add to timestamp for interpolation. | |
| qint64 | getTimeOffsetMs () const |
| Milliseconds to add to timestamp for interpolation. | |
| bool | hasNonZeroOffsetTime () const |
| Having a valid offset time. | |
| void | addMsecsToOffsetTime (qint64 msToAdd) |
| Adds a value to offset time. | |
| QString | getTimeOffsetWithUnit () const |
| Offset with unit. | |
| qint64 | getAdjustedMSecsSinceEpoch () const |
| Timestamp with offset added for interpolation. | |
| void | setAdjustedMSecsSinceEpoch (qint64 adjustedTimeMs) |
| Set timestamp with offset added for interpolation. | |
| qint64 | getAdjustedTimeDifferenceMs (qint64 compareTime) const |
| Time difference in ms (this -> compare). | |
| QString | getTimestampAndOffset (bool formatted) const |
| Timestamp and offset. | |
| QString | getFormattedTimestampAndOffset (bool includeRawTimestamp) const |
| Timestamp and offset. | |
| bool | isNewerThanAdjusted (const ITimestampWithOffsetBased &otherTimestampObj) const |
| Is this newer than other? | |
| bool | isNewerThanAdjusted (qint64 mSecsSinceEpoch) const |
| Is newer than epoch value? | |
| bool | isOlderThanAdjusted (const ITimestampWithOffsetBased &otherTimestampObj) const |
| Is this older than other? | |
| bool | isOlderThanAdjusted (qint64 mSecsSinceEpoch) const |
| Is this older than other? | |
| Public Member Functions inherited from swift::misc::ITimestampBased | |
| 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 CAircraftParts & | null () |
| NULL parts object. | |
| static const QString & | partsDetailsToString (PartsDetails details) |
| Convert to QString. | |
| static const QString & | attributeNameIsFullJson () |
| Attribute name. | |
| Static Public Member Functions inherited from swift::misc::mixin::MetaType< CAircraftParts > | |
| static void | registerMetadata () |
| Register metadata. | |
| Static Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< CAircraftParts > | |
| static DerivedObj | fromJson (const QJsonObject &json) |
| Get object from QJsonObject. | |
| static DerivedObj | fromJsonNoThrow (const QString &jsonString, bool acceptCacheJson, bool &success, QString &errMsg) |
| Get object from JSON string. | |
| Static Public Member Functions inherited from swift::misc::ITimestampBased | |
| 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 | attributesCountFullJson = 7 |
| Number of attributes for full JSON. | |
Additional Inherited Members | |
| Protected Member Functions inherited from swift::misc::CValueObject< CAircraftParts > | |
| CEmpty ()=default | |
| Inheriting constructors. | |
| CEmpty (const CEmpty &)=default | |
| Inheriting constructors. | |
| CValueObject ()=default | |
| Default constructor. | |
| CValueObject & | operator= (const CValueObject &)=default |
| Copy assignment operator. | |
| ~CValueObject ()=default | |
| Destructor. | |
| Protected Member Functions inherited from swift::misc::CEmpty | |
| 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. | |
| Protected Member Functions inherited from swift::misc::ITimestampWithOffsetBased | |
| ITimestampWithOffsetBased ()=default | |
| Constructor. | |
| ITimestampWithOffsetBased (qint64 msSincePoch) | |
| Constructor. | |
| ITimestampWithOffsetBased (const QDateTime ×tamp) | |
| Constructor. | |
| QVariant | propertyByIndex (swift::misc::CPropertyIndexRef index) const |
| Property by index. | |
| void | setPropertyByIndex (swift::misc::CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const ITimestampWithOffsetBased &compareValue) const |
| Compare for index. | |
| Protected Member Functions inherited from swift::misc::ITimestampBased | |
| ITimestampBased ()=default | |
| Constructor. | |
| ITimestampBased (qint64 msSincePoch) | |
| Constructor. | |
| ITimestampBased (const QDateTime ×tamp) | |
| Constructor. | |
| QVariant | propertyByIndex (CPropertyIndexRef index) const |
| Property by index. | |
| void | setPropertyByIndex (CPropertyIndexRef index, const QVariant &variant) |
| Set property by index. | |
| int | comparePropertyByIndex (CPropertyIndexRef index, const ITimestampBased &compareValue) const |
| Compare for index. | |
| void | updateMissingParts (const ITimestampBased &other) |
| Update missing parts. | |
| Static Protected Member Functions inherited from swift::misc::ITimestampWithOffsetBased | |
| static bool | canHandleIndex (CPropertyIndexRef index) |
| Can given index be handled. | |
| Protected Attributes inherited from swift::misc::ITimestampWithOffsetBased | |
| qint64 | m_timeOffsetMs = 0 |
| offset time in ms | |
| Protected Attributes inherited from swift::misc::ITimestampBased | |
| qint64 | m_timestampMSecsSinceEpoch = -1 |
| timestamp value | |
Value object encapsulating information of aircraft's parts.
Definition at line 25 of file aircraftparts.h.
Properties by index.
Definition at line 29 of file aircraftparts.h.
Parts Details.
Definition at line 41 of file aircraftparts.h.
| swift::misc::aviation::CAircraftParts::CAircraftParts | ( | int | flapsPercent | ) |
Default constructor.
Definition at line 19 of file aircraftparts.cpp.
| swift::misc::aviation::CAircraftParts::CAircraftParts | ( | const CAircraftLights & | lights, |
| bool | gearDown, | ||
| int | flapsPercent, | ||
| bool | spoilersOut, | ||
| const CAircraftEngineList & | engines, | ||
| bool | onGround ) |
Constructor.
Definition at line 21 of file aircraftparts.cpp.
| swift::misc::aviation::CAircraftParts::CAircraftParts | ( | const CAircraftLights & | lights, |
| bool | gearDown, | ||
| int | flapsPercent, | ||
| bool | spoilersOut, | ||
| const CAircraftEngineList & | engines, | ||
| bool | onGround, | ||
| qint64 | timestamp ) |
Constructor.
Definition at line 27 of file aircraftparts.cpp.
|
static |
Attribute name.
Definition at line 92 of file aircraftparts.cpp.
| int swift::misc::aviation::CAircraftParts::comparePropertyByIndex | ( | CPropertyIndexRef | index, |
| const CAircraftParts & | compareValue ) const |
Compare for index.
Definition at line 149 of file aircraftparts.cpp.
| QString swift::misc::aviation::CAircraftParts::convertToQString | ( | bool | i18n = false | ) | const |
Cast as QString.
Definition at line 35 of file aircraftparts.cpp.
|
inline |
Direct access to engines, meant for simple value modifications.
Definition at line 115 of file aircraftparts.h.
| bool swift::misc::aviation::CAircraftParts::equalValues | ( | const CAircraftParts & | other | ) | const |
Equal values, but not comparing timestamp etc.
Definition at line 63 of file aircraftparts.cpp.
| CAircraftLights swift::misc::aviation::CAircraftParts::getAdjustedLights | ( | ) | const |
Lights adjusted depending on engines.
Definition at line 175 of file aircraftparts.cpp.
| CAircraftEngine swift::misc::aviation::CAircraftParts::getEngine | ( | int | number | ) | const |
Engine with number.
Definition at line 190 of file aircraftparts.cpp.
|
inline |
Get engines.
Definition at line 112 of file aircraftparts.h.
|
inline |
Number of engines.
Definition at line 121 of file aircraftparts.h.
|
inline |
Get flaps position in percent.
Definition at line 100 of file aircraftparts.h.
|
inline |
Get aircraft lights.
Definition at line 72 of file aircraftparts.h.
|
inline |
Get parts details.
Definition at line 142 of file aircraftparts.h.
|
inline |
Parts details as string.
Definition at line 145 of file aircraftparts.h.
| bool swift::misc::aviation::CAircraftParts::isAnyEngineOn | ( | ) | const |
Any engine on?
Definition at line 194 of file aircraftparts.cpp.
| bool swift::misc::aviation::CAircraftParts::isEngineOn | ( | int | number | ) | const |
Is engine with number 1..n on?
Definition at line 192 of file aircraftparts.cpp.
| bool swift::misc::aviation::CAircraftParts::isFixedGearDown | ( | ) | const |
Is fixed gear down?
Definition at line 188 of file aircraftparts.cpp.
|
inline |
Is gear down?
Definition at line 90 of file aircraftparts.h.
| bool swift::misc::aviation::CAircraftParts::isNull | ( | ) | const |
NULL parts object?
Definition at line 61 of file aircraftparts.cpp.
|
inline |
Is aircraft on ground?
Definition at line 136 of file aircraftparts.h.
|
inline |
Are spoilers out?
Definition at line 106 of file aircraftparts.h.
|
inline |
Reference to lights, meant for easy direct changes of the values.
Definition at line 78 of file aircraftparts.h.
|
static |
NULL parts object.
Definition at line 70 of file aircraftparts.cpp.
|
static |
Convert to QString.
Definition at line 76 of file aircraftparts.cpp.
| QVariant swift::misc::aviation::CAircraftParts::propertyByIndex | ( | CPropertyIndexRef | index | ) | const |
Property by index.
Definition at line 98 of file aircraftparts.cpp.
| void swift::misc::aviation::CAircraftParts::setAllLightsOff | ( | ) |
Set all lights off.
Definition at line 186 of file aircraftparts.cpp.
| void swift::misc::aviation::CAircraftParts::setAllLightsOn | ( | ) |
Set all lights on.
Definition at line 184 of file aircraftparts.cpp.
| void swift::misc::aviation::CAircraftParts::setEngines | ( | const CAircraftEngine & | engine, |
| int | engineNumber ) |
Copy one engine multiple times (number) and set the number of engines to number.
Definition at line 196 of file aircraftparts.cpp.
|
inline |
Set engines.
Definition at line 130 of file aircraftparts.h.
|
inline |
Set flaps position in percent.
Definition at line 103 of file aircraftparts.h.
|
inline |
Set gear down.
Definition at line 97 of file aircraftparts.h.
|
inline |
Set aircraft lights.
Definition at line 81 of file aircraftparts.h.
|
inline |
Set aircraft on ground.
Definition at line 139 of file aircraftparts.h.
|
inline |
Set parts details.
Definition at line 148 of file aircraftparts.h.
| void swift::misc::aviation::CAircraftParts::setPropertyByIndex | ( | CPropertyIndexRef | index, |
| const QVariant & | variant ) |
Set property by index.
Definition at line 123 of file aircraftparts.cpp.
|
inline |
Set spoilers out.
Definition at line 109 of file aircraftparts.h.
| QJsonObject swift::misc::aviation::CAircraftParts::toFullJson | ( | ) | const |
Full JSON Object.
is_full_data to true Definition at line 53 of file aircraftparts.cpp.
| QJsonObject swift::misc::aviation::CAircraftParts::toIncrementalJson | ( | ) | const |
Incremental JSON object.
is_full_data to false Definition at line 45 of file aircraftparts.cpp.
|
staticconstexpr |
Number of attributes for full JSON.
Definition at line 177 of file aircraftparts.h.