|
Enroute Flight Navigation
A navigation app for VFR pilots
|
Traffic factor whose distance is known, but not its bearing. More...
#include <TrafficFactor_DistanceOnly.h>
Public Member Functions | |
| TrafficFactor_DistanceOnly (QObject *parent=nullptr) | |
| Default constructor. | |
| bool | updateFrom (const TrafficFactorData_DistanceOnly &data) |
| Offer a data record to this object, for the same traffic factor. | |
| void | replaceBy (const TrafficFactorData_DistanceOnly &data) |
| Replace this object by a different traffic factor. | |
| QGeoCoordinate | coordinate () const |
| Getter method for property with the same name. | |
| QBindable< QGeoCoordinate > | bindableCoordinate () const |
| Getter method for property with the same name. | |
| void | setCoordinate (const QGeoCoordinate &newCoordinate) |
| Setter function for property with the same name. | |
| Units::Distance | range () const |
| Getter method for property with the same name. | |
| QBindable< Units::Distance > | bindableRange () |
| Getter method for property with the same name. | |
| Public Member Functions inherited from Traffic::TrafficFactor_Abstract | |
| TrafficFactor_Abstract (QObject *parent=nullptr) | |
| Default constructor. | |
| bool | hasHigherPriorityThan (const TrafficFactor_Abstract &rhs) const |
| Estimates if this traffic object has higher priority than other traffic object. | |
| void | startLifetime () |
| Starts or extends the lifetime of this object. | |
| int | alarmLevel () const |
| Getter method for property with the same name. | |
| QBindable< int > | bindableAlarmLevel () |
| Getter method for property with the same name. | |
| bool | animate () const |
| Getter method for property with the same name. | |
| QBindable< bool > | bindableAnimate () |
| Getter method for property with the same name. | |
| QString | callSign () const |
| Getter method for property with the same name. | |
| QBindable< QString > | bindableCallSign () const |
| Getter method for property with the same name. | |
| QString | color () const |
| Getter method for property with the same name. | |
| QBindable< QString > | bindableColor () const |
| Getter method for property with the same name. | |
| QString | description () const |
| Getter method for property with the same name. | |
| QBindable< QString > | bindableDescription () const |
| Getter method for property with the same name. | |
| Units::Distance | hDist () const |
| Getter method for property with the same name. | |
| QBindable< Units::Distance > | bindableHDist () |
| Getter method for property with the same name. | |
| QString | ID () const |
| Getter method for property with the same name. | |
| QBindable< QString > | bindableID () const |
| Getter method for property with the same name. | |
| bool | relevant () const |
| Getter method for property with the same name. | |
| QBindable< bool > | bindableRelevant () |
| Getter method for property with the same name. | |
| QString | relevantString () const |
| Getter method for property with the same name. | |
| QBindable< QString > | bindableRelevantString () |
| Getter method for property with the same name. | |
| TrafficFactor_Abstract::Type | type () const |
| Getter method for property with the same name. | |
| QBindable< TrafficFactor_Abstract::Type > | bindableType () |
| Getter method for property with the same name. | |
| QString | typeString () const |
| Getter method for property with the same name. | |
| QBindable< QString > | bindableTypeString () |
| Getter method for property with the same name. | |
| bool | valid () const |
| Getter method for property with the same name. | |
| QBindable< bool > | bindableValid () |
| Getter method for property with the same name. | |
| Units::Distance | vDist () const |
| Getter method for property with the same name. | |
| QBindable< Units::Distance > | bindableVDist () |
| Getter method for property with the same name. | |
| void | setAlarmLevel (int newAlarmLevel) |
| Setter function for property with the same name. | |
| void | setCallSign (const QString &newCallSign) |
| Setter function for property with the same name. | |
| void | setHDist (Units::Distance newHDist) |
| Setter function for property with the same name. | |
| void | setID (const QString &newID) |
| Setter function for property with the same name. | |
| void | setType (TrafficFactor_Abstract::Type newType) |
| Setter function for property with the same name. | |
| void | setVDist (Units::Distance newVDist) |
| Setter function for property with the same name. | |
Properties | |
| QGeoCoordinate | coordinate |
| Center coordinate of the range ring. | |
| Units::Distance | range |
| Range to the traffic — the radius of the range ring. | |
| Properties inherited from Traffic::TrafficFactor_Abstract | |
| int | alarmLevel |
| Alarm Level. | |
| bool | animate |
| Indicates if changes in properties should be animated in the GUI. | |
| QString | callSign |
| Call sign. | |
| QString | color |
| Suggested color for GUI representation of the traffic. | |
| QString | description |
| Description of the traffic, for use in GUI. | |
| Units::Distance | hDist |
| Horizontal distance from own position to the traffic, at the time of report. | |
| QString | ID |
| Identifier string of the traffic. | |
| bool | relevant |
| Indicates relevant traffic. | |
| QString | relevantString |
| Translated string containing the 'relevant' property. | |
| Type | type |
| Type of aircraft, as reported by the traffic receiver. | |
| QString | typeString |
| Type of aircraft, as reported by the traffic receiver. | |
| bool | valid |
| Validity. | |
| Units::Distance | vDist |
| Vertical distance from own position to the traffic, at the time of report. | |
Additional Inherited Members | |
| Public Types inherited from Traffic::TrafficFactor_Abstract | |
| enum | Type : quint8 { unknown , Aircraft , Airship , Balloon , Copter , Drone , Glider , HangGlider , Jet , Paraglider , Skydiver , StaticObstacle , TowPlane } |
| Aircraft type. More... | |
| Static Public Member Functions inherited from Traffic::TrafficFactor_Abstract | |
| static bool | isRelevant (Units::Distance hDist, Units::Distance vDist) |
| Relevance criterion shared by the "relevant" property and priority logic. | |
| Static Public Attributes inherited from Traffic::TrafficFactor_Abstract | |
| static constexpr auto | lifetime = 45s |
| Length of lifetime for objects of this class. | |
| static constexpr Units::Distance | maxVerticalDistance = Units::Distance::fromM(1500.0) |
| Maximal vertical distance for relevant traffic. | |
| static constexpr Units::Distance | maxHorizontalDistance = Units::Distance::fromNM(20.0) |
| Maximal horizontal distance for relevant traffic. | |
| Protected Member Functions inherited from Traffic::TrafficFactor_Abstract | |
| void | updateFrom (const TrafficFactorData &data) |
| Update this object with newer data for the same traffic factor. | |
| void | replaceBy (const TrafficFactorData &data) |
| Replace this object by a different traffic factor. | |
| bool | isSameFactorAs (const TrafficFactorData &data) const |
| Check whether a data record refers to the same factor as *this. | |
| Static Protected Attributes inherited from Traffic::TrafficFactor_Abstract | |
| static constexpr qsizetype | idMatchLength = 6 |
| Number of characters in ICAO HEX IDs. | |
Traffic factor whose distance is known, but not its bearing.
Objects of this class represent traffic factors for which only the distance to the traffic is known, not its bearing. This is typically the case for aircraft seen through a Mode-S transponder, which reports altitude and range but no position.
Geometrically, such a factor is described by a horizontal range ring: the traffic is somewhere on a circle of radius range(), centered at coordinate() — the ownship position at the time of report — and offset vertically by vDist(). Compared to TrafficFactor_Abstract, this class therefore adds the property coordinate (the center of the ring); the radius is exposed as range().
Note that a finite range() is required for the factor to be valid (see the binding of the "valid" property), so a distance-only factor can only be shown when both the range and the ownship position are known.
Definition at line 50 of file TrafficFactor_DistanceOnly.h.
|
explicit |
Default constructor.
| parent | The standard QObject parent pointer |
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 142 of file TrafficFactor_DistanceOnly.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 178 of file TrafficFactor_DistanceOnly.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 136 of file TrafficFactor_DistanceOnly.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 172 of file TrafficFactor_DistanceOnly.h.
|
inline |
Replace this object by a different traffic factor.
This method is for the case where this is repurposed to represent a *different position-less factor, namely the one described by data — typically after updateFrom() has declined the record. The coordinate is taken over and the remaining properties are replaced through TrafficFactor_Abstract::replaceBy().
| data | Data record whose contents replace the data of *this |
Definition at line 112 of file TrafficFactor_DistanceOnly.h.
|
inline |
Setter function for property with the same name.
| newCoordinate | Property coordinate |
Definition at line 148 of file TrafficFactor_DistanceOnly.h.
|
inlinenodiscard |
Offer a data record to this object, for the same traffic factor.
This method checks whether data describes the same traffic factor as *this, by comparing identifiers. The intended use is that the caller offers a freshly received record and falls back to replaceBy() if it is declined.
| data | Data record offered to *this |
Definition at line 88 of file TrafficFactor_DistanceOnly.h.
|
readwrite |
Center coordinate of the range ring.
This property contains the center of the range ring, that is, the ownship position at the time of report. The traffic is located somewhere on the circle of radius range() around this coordinate.
Definition at line 130 of file TrafficFactor_DistanceOnly.h.
|
read |
Range to the traffic — the radius of the range ring.
This property holds the horizontal distance from the ownship to the traffic, i.e. the radius of the range ring described in the class documentation. It is the defining datum of a distance-only factor: it is reported by the traffic receiver and set, together with the other data, through replaceBy() (which forwards to TrafficFactor_Abstract::replaceBy() and thus to setHDist()). A finite range is required for the factor to be valid.
range() is the first-class, well-named view of the distance for this class. It is backed by the inherited hDist property and always holds the same value; hDist is retained because the base class TrafficFactor_Abstract uses it for the "valid" property and for priority comparisons.
Definition at line 166 of file TrafficFactor_DistanceOnly.h.