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

Value object encapsulating information of an aircraft's situation. More...

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

Public Types

enum  ColumnIndex {
  IndexPosition = CPropertyIndexRef::GlobalIndexCAircraftSituation , IndexLatitude , IndexLongitude , IndexAltitude ,
  IndexHeading , IndexBank , IndexIsOnGroundInfo , IndexPitch ,
  IndexPBHInfo , IndexVelocity , IndexGroundSpeed , IndexGroundElevationPlane ,
  IndexGroundElevationInfo , IndexGroundElevationInfoTransferred , IndexGroundElevationInfoString , IndexGroundElevationPlusInfo ,
  IndexCallsign , IndexCG , IndexCanLikelySkipNearGroundInterpolation
}
 Properties by index.
 
enum  AltitudeCorrection {
  NoCorrection , Underflow , DraggedToGround , AGL ,
  NoElevation , UnknownCorrection
}
 How was altitude corrected? More...
 
enum  GndElevationInfo {
  NoElevationInfo , Test , SituationChange , Extrapolated ,
  Average , Interpolated , FromCache , FromProvider
}
 Where did we get elevation from? More...
 
- Public Types inherited from swift::misc::CValueObject< CAircraftSituation >
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::geo::ICoordinateGeodetic
enum  ColumnIndex {
  IndexLatitude = CPropertyIndexRef::GlobalIndexICoordinateGeodetic , IndexLongitude , IndexLatitudeAsString , IndexLongitudeAsString ,
  IndexGeodeticHeight , IndexGeodeticHeightAsString , IndexNormalVector
}
 Properties by index.
 
- 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

 CAircraftSituation ()
 Default constructor.
 
 CAircraftSituation (const CCallsign &correspondingCallsign)
 Constructor with callsign.
 
 CAircraftSituation (const geo::CCoordinateGeodetic &position, const CHeading &heading={}, const physical_quantities::CAngle &pitch={}, const physical_quantities::CAngle &bank={}, const physical_quantities::CSpeed &gs={}, const geo::CElevationPlane &groundElevation={})
 Comprehensive constructor.
 
 CAircraftSituation (const CCallsign &correspondingCallsign, const geo::CCoordinateGeodetic &position, const CHeading &heading={}, const physical_quantities::CAngle &pitch={}, const physical_quantities::CAngle &bank={}, const physical_quantities::CSpeed &gs={}, const geo::CElevationPlane &groundElevation={})
 Comprehensive constructor.
 
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 CAircraftSituation &compareValue) const
 Compare for index. More...
 
const geo::CCoordinateGeodeticgetPosition () const
 Get position.
 
bool isPositionNull () const
 Position null?
 
bool isPositionOrAltitudeNull () const
 Position or altitude null?
 
virtual bool isNull () const
 Null situation.
 
bool isOtherElevationInfoBetter (GndElevationInfo otherInfo, bool transferred) const
 Is given info better (more accurate)?
 
bool equalPbh (const CAircraftSituation &other) const
 Equal pitch, bank heading. More...
 
bool equalPbhAndVector (const CAircraftSituation &other) const
 Equal PBH and vector. More...
 
bool equalPbhVectorAltitude (const CAircraftSituation &other) const
 Equal PBH and vecto, plus altitude. More...
 
bool equalPbhVectorAltitudeElevation (const CAircraftSituation &other) const
 Equal PBH and vecto, plus altitude/elevation. More...
 
void setNull ()
 Set to null.
 
void setPosition (const geo::CCoordinateGeodetic &position)
 Set position.
 
virtual geo::CLatitude latitude () const
 Latitude. More...
 
virtual geo::CLongitude longitude () const
 Longitude. More...
 
bool isOnGround () const
 Is on ground?
 
bool isOnGroundFromParts () const
 On ground by parts?
 
bool isOnGroundFromNetwork () const
 On ground by network flag?
 
bool isOnGroundInfoAvailable () const
 On ground info available?
 
bool shouldGuessOnGround () const
 Should we guess on ground?
 
physical_quantities::CLength getGroundDistance (const physical_quantities::CLength &centerOfGravity) const
 Distance to ground, null if impossible to calculate.
 
bool hasGroundDetailsForGndInterpolation () const
 Do the ground details permit ground interpolation?
 
void setOnGroundDetails (COnGroundInfo::OnGroundDetails details)
 On ground details.
 
aviation::COnGroundInfo getOnGroundInfo () const
 On ground info.
 
void setOnGroundInfo (const aviation::COnGroundInfo &info)
 Set the on ground info.
 
const CAltitudegeodeticHeight () const
 Height, ellipsoidal or geodetic height (used in GPS) More...
 
virtual QVector3D normalVector () const
 Normal vector. More...
 
virtual std::array< double, 3 > normalVectorDouble () const
 Normal vector with double precision. More...
 
const CAltitudegetGroundElevation () const
 Elevation of the ground directly beneath.
 
const geo::CElevationPlanegetGroundElevationPlane () const
 Elevation of the ground directly beneath.
 
GndElevationInfo getGroundElevationInfo () const
 How did we get gnd.elevation?
 
QString getGroundElevationInfoAsString () const
 How did we get gnd.elevation?
 
QString getGroundElevationAndInfo () const
 Ground elevation plus info.
 
bool isGroundElevationInfoTransferred () const
 Is the elv.info transferred?
 
void setGroundElevationInfo (GndElevationInfo details)
 How we did get gnd.elevation.
 
bool canTransferGroundElevation (const CAircraftSituation &transferToSituation, const physical_quantities::CLength &radius=geo::CElevationPlane::singlePointRadius()) const
 Can the elevation be transferred to another situation?
 
bool transferGroundElevationFromMe (CAircraftSituation &transferToSituation, const physical_quantities::CLength &radius=geo::CElevationPlane::singlePointRadius()) const
 Transfer from "this" situation to otherSituation. More...
 
bool transferGroundElevationToMe (const CAircraftSituation &fromSituation, const physical_quantities::CLength &radius, bool transferred)
 Transfer ground elevation from given situation (to me)
 
bool transferGroundElevationToMe (const CAircraftSituation &fromSituation, bool transferred)
 Transfer ground elevation from given situation (to me)
 
bool interpolateElevation (const aviation::CAircraftSituation &oldSituation, const aviation::CAircraftSituation &newSituation)
 Interpolate "this" elevation from the two adjacent positions. More...
 
bool hasGroundElevation () const
 Is ground elevation value available.
 
bool hasInboundGroundDetails () const
 Has inbound ground details.
 
bool setGroundElevation (const aviation::CAltitude &altitude, GndElevationInfo info, bool transferred=false)
 Elevation of the ground directly beneath at the given situation.
 
bool setGroundElevation (const geo::CElevationPlane &elevationPlane, GndElevationInfo info, bool transferred=false)
 Elevation of the ground directly beneath.
 
bool setGroundElevationChecked (const geo::CElevationPlane &elevationPlane, GndElevationInfo info, bool transferred=false)
 Set elevation of the ground directly beneath, but checked. More...
 
void resetGroundElevation ()
 Reset ground elevation.
 
physical_quantities::CLength getHeightAboveGround () const
 Height above ground.
 
const CHeadinggetHeading () const
 Get heading.
 
void setHeading (const CHeading &heading)
 Set heading.
 
const CAltitudegetAltitude () const
 Get altitude.
 
physical_quantities::CLengthUnit getAltitudeUnit () const
 Get altitude unit.
 
physical_quantities::CLengthUnit getAltitudeOrDefaultUnit () const
 Get altitude unit.
 
void setAltitude (const CAltitude &altitude)
 Set altitude.
 
CAltitude addAltitudeOffset (const physical_quantities::CLength &offset)
 Add offset to altitude.
 
CAircraftSituation withAltitudeOffset (const physical_quantities::CLength &offset) const
 Situation with altitude offset.
 
const CAltitudegetPressureAltitude () const
 Get pressure altitude.
 
void setPressureAltitude (const CAltitude &altitude)
 Set pressure altitude.
 
const physical_quantities::CAnglegetPitch () const
 Get pitch.
 
void setPitch (const physical_quantities::CAngle &pitch)
 Set pitch.
 
const physical_quantities::CAnglegetBank () const
 Get bank (angle)
 
void setBank (const physical_quantities::CAngle &bank)
 Set bank (angle)
 
void setZeroPBH ()
 Set PBH values to 0 (zero)
 
void setZeroPBHandGs ()
 Set PBH and GS values to 0 (zero)
 
QString getPBHInfo () const
 Get PBH info (all together)
 
void setVelocity (const CAircraftVelocity &velocity)
 Set 6DOF velocity.
 
const CAircraftVelocitygetVelocity () const
 Get 6DOF velocity.
 
bool hasVelocity () const
 Is velocity non-zero?
 
const physical_quantities::CSpeedgetGroundSpeed () const
 Get ground speed.
 
void setGroundSpeed (const physical_quantities::CSpeed &groundspeed)
 Set ground speed.
 
bool isMoving () const
 Is moving? Means ground speed > epsilon.
 
bool canLikelySkipNearGroundInterpolation () const
 Situation looks like an aircraft not near ground.
 
physical_quantities::CLength getDistancePerTime (std::chrono::milliseconds, const physical_quantities::CLength &min=physical_quantities::CLength::null()) const
 Distance per milliseconds.
 
physical_quantities::CLength getDistancePerTime250ms (const physical_quantities::CLength &min=physical_quantities::CLength::null()) const
 Distance per milliseconds (250ms)
 
const CCallsigngetCallsign () const
 Corresponding callsign.
 
bool hasCallsign () const
 Has corresponding callsign.
 
void setCallsign (const CCallsign &callsign)
 Corresponding callsign.
 
const physical_quantities::CLengthgetCG () const
 Get CG if any.
 
void setCG (const physical_quantities::CLength &cg)
 Set CG.
 
bool hasCG () const
 Has CG set?
 
void setInterimFlag (bool flag)
 Set flag indicating this is an interim position update.
 
bool adjustGroundFlag (const CAircraftParts &parts, bool alwaysSetDetails, double timeDeviationFactor=0.1, qint64 *differenceMs=nullptr)
 Transfer ground flag from parts. More...
 
bool adjustGroundFlag (const CAircraftPartsList &partsList, bool alwaysSetDetails, double timeDeviationFactor=0.1, qint64 *differenceMs=nullptr)
 Transfer ground flag from parts list. More...
 
bool isInterim () const
 Get flag indicating this is an interim position update.
 
CAircraftLights guessLights () const
 Guessed lights.
 
CAltitude getCorrectedAltitude (bool enableDragToGround=true, AltitudeCorrection *correction=nullptr) const
 Get altitude under consideration of ground elevation and ground flag. More...
 
CAltitude getCorrectedAltitude (const physical_quantities::CLength &centerOfGravity, bool enableDragToGround=true, AltitudeCorrection *correction=nullptr) const
 Get altitude under consideration of ground elevation and ground flag. More...
 
AltitudeCorrection correctAltitude (bool enableDragToGround=true)
 Set the corrected altitude from CAircraftSituation::getCorrectedAltitude.
 
AltitudeCorrection correctAltitude (const physical_quantities::CLength &centerOfGravity=physical_quantities::CLength::null(), bool enableDragToGround=true)
 Set the corrected altitude from CAircraftSituation::getCorrectedAltitude.
 
- 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::geo::ICoordinateGeodetic
 ICoordinateGeodetic ()=default
 Ctor.
 
virtual ~ICoordinateGeodetic ()
 Destructor.
 
 ICoordinateGeodetic (const ICoordinateGeodetic &)=default
 Copy constructor.
 
ICoordinateGeodeticoperator= (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.
 
- 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 QString & altitudeCorrectionToString (AltitudeCorrection correction)
 Enum to string.
 
static bool isCorrectedAltitude (AltitudeCorrection correction)
 Means corrected altitude?
 
static const QString & gndElevationInfoToString (GndElevationInfo details)
 Enum to string.
 
static const physical_quantities::CLengthdeltaNearGround ()
 Delta distance, near to ground.
 
static const CAircraftSituationnull ()
 Null situation.
 
static const physical_quantities::CLengthdefaultCG ()
 A default CG if not other value is available.
 
static geo::CElevationPlane interpolatedElevation (const CAircraftSituation &situation, const CAircraftSituation &oldSituation, const CAircraftSituation &newSituation, const physical_quantities::CLength &distance=physical_quantities::CLength::null())
 Interpolate between the 2 situations for situation. More...
 
static const physical_quantities::CLengthallowedAltitudeDeviation ()
 Within this range deviation is so small we consider values "almost constant".
 
static void registerMetadata ()
 Register metadata.
 
Ground flag comparisons
static bool isGfEqualOnGround (double oldGroundFactor, double newGroundFactor)
 Both on ground.
 
static bool isGfEqualAirborne (double oldGroundFactor, double newGroundFactor)
 Both not on ground.
 
static bool isGfStarting (double oldGroundFactor, double newGroundFactor)
 Aircraft is starting.
 
static bool isGfLanding (double oldGroundFactor, double newGroundFactor)
 Aircraft is landing.
 
- 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::geo::ICoordinateGeodetic
static bool isValidVector (const std::array< double, 3 > &v)
 Check values.
 
- 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 double MaxDeltaElevationFt = 25.0
 Threshold until we interpolate elevations.
 

Additional Inherited Members

- Protected Member Functions inherited from swift::misc::CValueObject< CAircraftSituation >
 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::geo::ICoordinateGeodetic
static bool canHandleIndex (CPropertyIndexRef index)
 Can given index be handled?
 
- 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 encapsulating information of an aircraft's situation.

Definition at line 50 of file aircraftsituation.h.

Member Enumeration Documentation

◆ AltitudeCorrection

How was altitude corrected?

Enumerator
Underflow 

aircraft too low

DraggedToGround 

other scenery too high, but on ground

NoElevation 

no correction as there is no elevation

Definition at line 81 of file aircraftsituation.h.

◆ GndElevationInfo

Where did we get elevation from?

Enumerator
Test 

unit test

SituationChange 

from swift::misc::aviation::CAircraftSituationChange

Extrapolated 

extrapolated ("guessing")

Average 

average value of "nearby" situation CAircraftSituationList::averageElevationOfNonMovingAircraft

Interpolated 

interpolated between 2 elevations

FromCache 

from cache

FromProvider 

from swift::misc::simulation::ISimulationEnvironmentProvider

Definition at line 92 of file aircraftsituation.h.

Member Function Documentation

◆ adjustGroundFlag() [1/2]

bool swift::misc::aviation::CAircraftSituation::adjustGroundFlag ( const CAircraftParts parts,
bool  alwaysSetDetails,
double  timeDeviationFactor = 0.1,
qint64 *  differenceMs = nullptr 
)

Transfer ground flag from parts.

Parameters
partscontaining the gnd flag
alwaysSetDetailsmark as CAircraftSituation::InFromParts regardless of parts
timeDeviationFactor0..1 (of offset time) small deviations from time are accepted
differenceMsreturns time difference

Definition at line 862 of file aircraftsituation.cpp.

◆ adjustGroundFlag() [2/2]

bool swift::misc::aviation::CAircraftSituation::adjustGroundFlag ( const CAircraftPartsList partsList,
bool  alwaysSetDetails,
double  timeDeviationFactor = 0.1,
qint64 *  differenceMs = nullptr 
)

Transfer ground flag from parts list.

Parameters
partsListcontaining the gnd flag
alwaysSetDetailsmark as CAircraftSituation::InFromParts regardless of parts
timeDeviationFactor0..1 (of offset time) small deviations from time are accepted
differenceMsreturns time difference

Definition at line 882 of file aircraftsituation.cpp.

◆ comparePropertyByIndex()

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

Compare for index.

Definition at line 338 of file aircraftsituation.cpp.

◆ convertToQString()

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

Cast as QString.

Definition at line 117 of file aircraftsituation.cpp.

◆ equalPbh()

bool swift::misc::aviation::CAircraftSituation::equalPbh ( const CAircraftSituation other) const

Equal pitch, bank heading.

See also
geo::ICoordinateGeodetic::equalNormalVectorDouble

Definition at line 411 of file aircraftsituation.cpp.

◆ equalPbhAndVector()

bool swift::misc::aviation::CAircraftSituation::equalPbhAndVector ( const CAircraftSituation other) const

Equal PBH and vector.

See also
geo::ICoordinateGeodetic::equalNormalVectorDouble

Definition at line 417 of file aircraftsituation.cpp.

◆ equalPbhVectorAltitude()

bool swift::misc::aviation::CAircraftSituation::equalPbhVectorAltitude ( const CAircraftSituation other) const

Equal PBH and vecto, plus altitude.

See also
geo::ICoordinateGeodetic::equalNormalVectorDouble

Definition at line 422 of file aircraftsituation.cpp.

◆ equalPbhVectorAltitudeElevation()

bool swift::misc::aviation::CAircraftSituation::equalPbhVectorAltitudeElevation ( const CAircraftSituation other) const

Equal PBH and vecto, plus altitude/elevation.

See also
geo::ICoordinateGeodetic::equalNormalVectorDouble

Definition at line 429 of file aircraftsituation.cpp.

◆ geodeticHeight()

const CAltitude& swift::misc::aviation::CAircraftSituation::geodeticHeight ( ) const
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.

See also
see http://www.gmat.unsw.edu.au/snap/gps/clynch_pdfs/coordcvt.pdf page 5
http://www.esri.com/news/arcuser/0703/geoid1of3.html

Implements swift::misc::geo::ICoordinateGeodetic.

Definition at line 210 of file aircraftsituation.h.

◆ getCorrectedAltitude() [1/2]

CAltitude swift::misc::aviation::CAircraftSituation::getCorrectedAltitude ( bool  enableDragToGround = true,
CAircraftSituation::AltitudeCorrection correction = nullptr 
) const

Get altitude under consideration of ground elevation and ground flag.

Remarks
with dragToGround it will also compensate overflows, otherwise only underflow

Definition at line 677 of file aircraftsituation.cpp.

◆ getCorrectedAltitude() [2/2]

CAltitude swift::misc::aviation::CAircraftSituation::getCorrectedAltitude ( const physical_quantities::CLength centerOfGravity,
bool  enableDragToGround = true,
AltitudeCorrection correction = nullptr 
) const

Get altitude under consideration of ground elevation and ground flag.

Remarks
with dragToGround it will also compensate overflows, otherwise only underflow

Definition at line 683 of file aircraftsituation.cpp.

◆ interpolatedElevation()

CElevationPlane swift::misc::aviation::CAircraftSituation::interpolatedElevation ( const CAircraftSituation situation,
const CAircraftSituation oldSituation,
const CAircraftSituation newSituation,
const physical_quantities::CLength distance = physical_quantities::CLength::null() 
)
static

Interpolate between the 2 situations for situation.

Remarks
NULL if there are no two elevations or threshold MaxDeltaElevationFt is exceeded

Definition at line 212 of file aircraftsituation.cpp.

◆ interpolateElevation()

bool swift::misc::aviation::CAircraftSituation::interpolateElevation ( const aviation::CAircraftSituation oldSituation,
const aviation::CAircraftSituation newSituation 
)

Interpolate "this" elevation from the two adjacent positions.

Remarks
"transfer" can be used, if the positions are known, "preset" if they are still unknown
See also
CAircraftSituation::transferGroundElevation
CAircraftSituation::presetGroundElevation

Definition at line 554 of file aircraftsituation.cpp.

◆ latitude()

virtual geo::CLatitude swift::misc::aviation::CAircraftSituation::latitude ( ) const
inlinevirtual

Latitude.

Implements swift::misc::geo::ICoordinateGeodetic.

Definition at line 174 of file aircraftsituation.h.

◆ longitude()

virtual geo::CLongitude swift::misc::aviation::CAircraftSituation::longitude ( ) const
inlinevirtual

Longitude.

Implements swift::misc::geo::ICoordinateGeodetic.

Definition at line 177 of file aircraftsituation.h.

◆ normalVector()

virtual QVector3D swift::misc::aviation::CAircraftSituation::normalVector ( ) const
inlinevirtual

Normal vector.

Note
QVector3D uses floats, so don't use if double precision is needed
See also
https://en.wikipedia.org/wiki/N-vector
http://www.movable-type.co.uk/scripts/latlong-vectors.html

Implements swift::misc::geo::ICoordinateGeodetic.

Definition at line 213 of file aircraftsituation.h.

◆ normalVectorDouble()

virtual std::array<double, 3> swift::misc::aviation::CAircraftSituation::normalVectorDouble ( ) const
inlinevirtual

Normal vector with double precision.

Implements swift::misc::geo::ICoordinateGeodetic.

Definition at line 216 of file aircraftsituation.h.

◆ propertyByIndex()

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

Property by index.

Definition at line 267 of file aircraftsituation.cpp.

◆ setGroundElevationChecked()

bool swift::misc::aviation::CAircraftSituation::setGroundElevationChecked ( const geo::CElevationPlane elevationPlane,
GndElevationInfo  info,
bool  transferred = false 
)

Set elevation of the ground directly beneath, but checked.

Remarks
override if better

Definition at line 616 of file aircraftsituation.cpp.

◆ setPropertyByIndex()

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

Set property by index.

Definition at line 303 of file aircraftsituation.cpp.

◆ transferGroundElevationFromMe()

bool swift::misc::aviation::CAircraftSituation::transferGroundElevationFromMe ( CAircraftSituation transferToSituation,
const physical_quantities::CLength radius = geo::CElevationPlane::singlePointRadius() 
) const

Transfer from "this" situation to otherSituation.

Remarks
"transfer" can be used, if the positions are known, "preset" if they are still unknown
See also
CAircraftSituation::interpolateGroundElevation
CAircraftSituation::interpolateElevation

Definition at line 534 of file aircraftsituation.cpp.


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