swift
Public Types | Public Member Functions | Static Public Member Functions | List of all members
swift::misc::aviation::CAircraftSituationChange Class Reference

Value object about changes in situations. More...

Inheritance diagram for swift::misc::aviation::CAircraftSituationChange:
[legend]

Public Types

enum  ColumnIndex {
  IndexCallsign = CPropertyIndexRef::GlobalIndexCAircraftSituationChange , IndexIsNull , IndexSituationsCount , IndexConstAscending ,
  IndexConstDescending , IndexConstOnGround , IndexConstNotOnGround , IndexJustTakingOff ,
  IndexJustTouchingDown , IndexRotatingUp , IndexContainsPushBack , IndexAltitudeMean ,
  IndexAltitudeStdDev , IndexElevationMean , IndexElevationStdDev
}
 Properties by index.
 
enum  GuessedSceneryDeviation { NoDeviationInfo , AllOnGround , WasOnGround , SmallAGLDeviationNearGround }
 Hint about the guessed scenery deviation. More...
 
- Public Types inherited from swift::misc::CValueObject< CAircraftSituationChange >
using base_type = CEmpty
 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< Derived >
enum  ColumnIndex { IndexPixmap = 10 , IndexIcon , IndexString }
 Base class enums.
 
- Public Types inherited from swift::misc::ITimestampWithOffsetBased
enum  ColumnIndex { IndexOffsetMs , IndexAdjustedMsWithOffset , IndexOffsetWithUnit }
 Properties by index.
 
- Public Types inherited from swift::misc::ITimestampBased
enum  ColumnIndex {
  IndexUtcTimestamp = CPropertyIndexRef::GlobalIndexITimestampBased , IndexUtcTimestampFormattedYmdhms , IndexUtcTimestampFormattedYmdhmsz , IndexUtcTimestampFormattedMdhms ,
  IndexUtcTimestampFormattedMdhmsz , IndexUtcTimestampFormattedDhms , IndexUtcTimestampFormattedHms , IndexUtcTimestampFormattedHm ,
  IndexMSecsSinceEpoch
}
 Properties by index.
 

Public Member Functions

 CAircraftSituationChange ()=default
 Default constructor.
 
 CAircraftSituationChange (const CAircraftSituationList &situations, const physical_quantities::CLength &cg, bool isVtol, bool alreadySortedLatestFirst=false, bool calcStdDeviations=false)
 Ctor with n situations. More...
 
const CCallsigngetCallsign () const
 Get callsign.
 
bool isNull () const
 Null?
 
int getSituationsCount () const
 Basend on n situations.
 
bool isConstAscending () const
 Constantly ascending? More...
 
bool isConstDescending () const
 Constantly descending? More...
 
bool isConstOnGround () const
 Are all situations on ground? More...
 
bool wasConstOnGround () const
 Was on ground (without latest situation)?
 
bool isConstNotOnGround () const
 Are all situations not on ground? More...
 
bool wasConstNotOnGround () const
 Was not on ground (without latest situation)?
 
bool isConstAccelerating () const
 Constantly accelerating? More...
 
bool isConstDecelarating () const
 Constantly decelarating? More...
 
bool isJustTakingOff () const
 Is just taking off? More...
 
bool isJustTouchingDown () const
 Is just touching down? More...
 
bool isRotatingUp () const
 Is rotating up? More...
 
bool containsPushBack () const
 Contains any push back? More...
 
CAltitudePair getElevationStdDevAndMean () const
 Elevation standard deviation and mean.
 
bool guessOnGround (CAircraftSituation &situation, const simulation::CAircraftModel &model) const
 Guess on ground flag.
 
const physical_quantities::CLengthgetGuessedSceneryDeviation () const
 Scnenery deviation (if it can be calculated, otherwise physical_quantities::CLength::null) More...
 
physical_quantities::CLength getGuessedSceneryDeviationCG () const
 Get scenery deviation under consideration of CG.
 
GuessedSceneryDeviation getSceneryDeviationHint () const
 Scenery deviation hint.
 
const QString & getSceneryDeviationHintAsString () const
 Scenery deviation hint hint as string.
 
bool hasSceneryDeviation () const
 Scenery deviation available?
 
bool hasElevationDevWithinAllowedRange () const
 Elevation within CAircraftSituation::allowedAltitudeDeviation range.
 
bool hasAltitudeDevWithinAllowedRange () const
 Altitude within CAircraftSituation::allowedAltitudeDeviation range.
 
QString convertToQString (bool i18n=false) const
 Cast as QString. More...
 
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 CAircraftSituationChange &compareValue) const
 Compare for index. More...
 
bool calculateStdDeviations (const CAircraftSituationList &situations, const physical_quantities::CLength &cg)
 Calculate the standard deviiations.
 
- Public Member Functions inherited from swift::misc::mixin::MetaType< Derived >
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.
 
- Public Member Functions inherited from swift::misc::mixin::DBusByMetaClass< Derived, Tags >
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< Derived >
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< Derived >
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.
 
- Public Member Functions inherited from swift::misc::mixin::String< Derived >
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< Derived >
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?
 
- Public Member Functions inherited from swift::misc::mixin::Icon< Derived, IconIndex >
CIcons::IconIndex 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 &timestamp)
 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 CAircraftSituationChangenull ()
 NULL object.
 
static const QString & guessedSceneryDeviationToString (GuessedSceneryDeviation hint)
 The enum as string.
 
static void registerMetadata ()
 Register metadata.
 
- Static Public Member Functions inherited from swift::misc::mixin::MetaType< Derived >
static void registerMetadata ()
 Register metadata.
 
- Static Public Member Functions inherited from swift::misc::mixin::JsonByMetaClass< Derived >
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 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.
 

Additional Inherited Members

- Protected Member Functions inherited from swift::misc::CValueObject< CAircraftSituationChange >
 CValueObject ()=default
 Default constructor.
 
 CValueObject (const CValueObject &)=default
 Copy constructor.
 
CValueObjectoperator= (const CValueObject &)=default
 Copy assignment operator.
 
 ~CValueObject ()=default
 Destructor.
 
 CEmpty ()=default
 Inheriting constructors.
 
 CEmpty (const CEmpty &)=default
 Inheriting constructors.
 
- Protected Member Functions inherited from swift::misc::CEmpty
 CEmpty ()=default
 Protected default constructor.
 
 CEmpty (const CEmpty &)=default
 Protected copy constructor.
 
CEmptyoperator= (const CEmpty &)=default
 Protected copy assignment operator.
 
 ~CEmpty ()=default
 Non-virtual protected destructor.
 
- Protected Member Functions inherited from swift::misc::ITimestampWithOffsetBased
 ITimestampWithOffsetBased ()
 Constructor.
 
 ITimestampWithOffsetBased (qint64 msSincePoch)
 Constructor.
 
 ITimestampWithOffsetBased (const QDateTime &timestamp)
 Constructor.
 
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 ITimestampWithOffsetBased &compareValue) const
 Compare for index. More...
 
- Protected Member Functions inherited from swift::misc::ITimestampBased
 ITimestampBased ()
 Constructor.
 
 ITimestampBased (qint64 msSincePoch)
 Constructor.
 
 ITimestampBased (const QDateTime &timestamp)
 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 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
 

Detailed Description

Value object about changes in situations.

Definition at line 33 of file aircraftsituationchange.h.

Member Enumeration Documentation

◆ GuessedSceneryDeviation

Hint about the guessed scenery deviation.

Enumerator
AllOnGround 

based on all situations on ground

WasOnGround 

was on ground except last situation

SmallAGLDeviationNearGround 

"Almost const AGL" near Ground

Definition at line 59 of file aircraftsituationchange.h.

Constructor & Destructor Documentation

◆ CAircraftSituationChange()

swift::misc::aviation::CAircraftSituationChange::CAircraftSituationChange ( const CAircraftSituationList situations,
const physical_quantities::CLength cg,
bool  isVtol,
bool  alreadySortedLatestFirst = false,
bool  calcStdDeviations = false 
)

Ctor with n situations.

Remarks
the timestamps of the latest situation will be used

Definition at line 38 of file aircraftsituationchange.cpp.

Member Function Documentation

◆ comparePropertyByIndex()

int swift::misc::aviation::CAircraftSituationChange::comparePropertyByIndex ( CPropertyIndexRef  index,
const CAircraftSituationChange compareValue 
) const

Compare for index.

Definition at line 322 of file aircraftsituationchange.cpp.

◆ containsPushBack()

bool swift::misc::aviation::CAircraftSituationChange::containsPushBack ( ) const
inline

Contains any push back?

Remarks
only valid for non VTOL aircraft

Definition at line 119 of file aircraftsituationchange.h.

◆ convertToQString()

QString swift::misc::aviation::CAircraftSituationChange::convertToQString ( bool  i18n = false) const

Cast as QString.

Definition at line 231 of file aircraftsituationchange.cpp.

◆ getGuessedSceneryDeviation()

const physical_quantities::CLength& swift::misc::aviation::CAircraftSituationChange::getGuessedSceneryDeviation ( ) const
inline

Scnenery deviation (if it can be calculated, otherwise physical_quantities::CLength::null)

Remarks
This is without CG, so substract CG to get deviation

Definition at line 129 of file aircraftsituationchange.h.

◆ isConstAccelerating()

bool swift::misc::aviation::CAircraftSituationChange::isConstAccelerating ( ) const
inline

Constantly accelerating?

Definition at line 104 of file aircraftsituationchange.h.

◆ isConstAscending()

bool swift::misc::aviation::CAircraftSituationChange::isConstAscending ( ) const
inline

Constantly ascending?

Definition at line 86 of file aircraftsituationchange.h.

◆ isConstDecelarating()

bool swift::misc::aviation::CAircraftSituationChange::isConstDecelarating ( ) const
inline

Constantly decelarating?

Definition at line 107 of file aircraftsituationchange.h.

◆ isConstDescending()

bool swift::misc::aviation::CAircraftSituationChange::isConstDescending ( ) const
inline

Constantly descending?

Definition at line 89 of file aircraftsituationchange.h.

◆ isConstNotOnGround()

bool swift::misc::aviation::CAircraftSituationChange::isConstNotOnGround ( ) const
inline

Are all situations not on ground?

Definition at line 98 of file aircraftsituationchange.h.

◆ isConstOnGround()

bool swift::misc::aviation::CAircraftSituationChange::isConstOnGround ( ) const
inline

Are all situations on ground?

Definition at line 92 of file aircraftsituationchange.h.

◆ isJustTakingOff()

bool swift::misc::aviation::CAircraftSituationChange::isJustTakingOff ( ) const
inline

Is just taking off?

Definition at line 110 of file aircraftsituationchange.h.

◆ isJustTouchingDown()

bool swift::misc::aviation::CAircraftSituationChange::isJustTouchingDown ( ) const
inline

Is just touching down?

Definition at line 113 of file aircraftsituationchange.h.

◆ isRotatingUp()

bool swift::misc::aviation::CAircraftSituationChange::isRotatingUp ( ) const
inline

Is rotating up?

Definition at line 116 of file aircraftsituationchange.h.

◆ propertyByIndex()

QVariant swift::misc::aviation::CAircraftSituationChange::propertyByIndex ( CPropertyIndexRef  index) const

Property by index.

Definition at line 257 of file aircraftsituationchange.cpp.

◆ setPropertyByIndex()

void swift::misc::aviation::CAircraftSituationChange::setPropertyByIndex ( CPropertyIndexRef  index,
const QVariant &  variant 
)

Set property by index.

Definition at line 287 of file aircraftsituationchange.cpp.


The documentation for this class was generated from the following files: