Enroute Flight Navigation
A navigation app for VFR pilots
|
Abstract base class for traffic factors. More...
#include <TrafficFactor_Abstract.h>
Public Member Functions | |
TrafficFactor_Abstract (QObject *parent=nullptr) | |
Default constructor. | |
void | copyFrom (const TrafficFactor_Abstract &other) |
Copy data from other object. | |
auto | hasHigherPriorityThan (const TrafficFactor_Abstract &rhs) const -> bool |
Estimates if this traffic object has higher priority than other traffic object. | |
void | startLiveTime () |
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. | |
auto | animate () const -> bool |
Getter method for property with the same name. | |
auto | callSign () const -> QString |
Getter method for property with the same name. | |
auto | color () const -> QString |
Getter method for property with the same name. | |
auto | description () const -> QString |
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. | |
auto | ID () const -> QString |
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< bool > | bindableRelevantString () |
Getter method for property with the same name. | |
Traffic::AircraftType | type () const |
Getter method for property with the same name. | |
QBindable< Traffic::AircraftType > | 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 | setAnimate (bool newAnimate) |
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 (Traffic::AircraftType newType) |
Setter function for property with the same name. | |
void | setVDist (Units::Distance newVDist) |
Setter function for property with the same name. |
Static Public Attributes | |
static constexpr auto | lifeTime = 10s |
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. |
Properties | |
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. | |
AircraftType | 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. |
Abstract base class for traffic factors.
This is an abstract base class for traffic factors, as reported by traffic data receivers (e.g. FLARM devices).
Since the real-world traffic situation changes continuously, instances of this class have a limited lifetime. The length of the lifetime is specified in the constant "lifeTime". You can (re)start an object's lifetime startLiveTime(). Once the lift-time of an object is expired, the property "valid" will alway contain the word "false", regardless of the object's other properties.
Definition at line 45 of file TrafficFactor_Abstract.h.
|
explicit |
Default constructor.
parent | The standard QObject parent pointer |
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 226 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 238 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 232 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 286 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 307 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 319 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 331 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 343 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 355 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 367 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 247 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 256 of file TrafficFactor_Abstract.h.
|
inline |
Copy data from other object.
This method copies all properties from the other object, with two notable exceptions.
other | Instance whose properties are copied |
Definition at line 74 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 271 of file TrafficFactor_Abstract.h.
|
nodiscard |
Estimates if this traffic object has higher priority than other traffic object.
The following criteria are applied in order.
rhs | Right hand side of the comparison |
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 280 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 292 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 301 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 313 of file TrafficFactor_Abstract.h.
|
inline |
Setter function for property with the same name.
newAlarmLevel | Property alarmLevel |
Definition at line 378 of file TrafficFactor_Abstract.h.
|
inline |
Setter function for property with the same name.
newAnimate | Property animate |
Definition at line 392 of file TrafficFactor_Abstract.h.
|
inline |
Setter function for property with the same name.
newCallSign | Property callSign |
Definition at line 404 of file TrafficFactor_Abstract.h.
|
inline |
Setter function for property with the same name.
newHDist | Property hDist |
Definition at line 416 of file TrafficFactor_Abstract.h.
|
inline |
Setter function for property with the same name.
newID | Property ID |
Definition at line 422 of file TrafficFactor_Abstract.h.
|
inline |
Setter function for property with the same name.
newType | Property type |
Definition at line 434 of file TrafficFactor_Abstract.h.
|
inline |
Setter function for property with the same name.
newVDist | Property vDist |
Definition at line 440 of file TrafficFactor_Abstract.h.
void Traffic::TrafficFactor_Abstract::startLiveTime | ( | ) |
Starts or extends the lifetime of this object.
Traffic information is valantile, and is considered valid only for "lifeTime" seconds. This method starts or extends the object's life time.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 325 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 337 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 349 of file TrafficFactor_Abstract.h.
|
inlinenodiscard |
Getter method for property with the same name.
Definition at line 361 of file TrafficFactor_Abstract.h.
|
staticconstexpr |
Maximal horizontal distance for relevant traffic.
Traffic whose horizontal distance to the own aircraft is larger than this number will be considered irrelevant.
Definition at line 459 of file TrafficFactor_Abstract.h.
|
staticconstexpr |
Maximal vertical distance for relevant traffic.
Traffic whose vertical distance to the own aircraft is larger than this number will be considered irrelevant.
Definition at line 452 of file TrafficFactor_Abstract.h.
|
readwrite |
Alarm Level.
This is the alarm level associated with the traffic object. The alarm level is an integer in the range 0 (no alarm), …, 3 (maximal alarm). The values are not computed by this class, but reported by the traffic receiver that reports the traffic. The precise meaning depends on the type of traffic receiver used.
FLARM
Other
Definition at line 132 of file TrafficFactor_Abstract.h.
|
readwrite |
Indicates if changes in properties should be animated in the GUI.
This boolen properts is used to indicate if changes in properties should be animated in the GUI. This property is typically set to "true" before gradual changes are applied, such as the position change of an aircraft. It is typically set to "false" before data of a new aircraft set.
Definition at line 141 of file TrafficFactor_Abstract.h.
|
readwrite |
Call sign.
If known, this property holds the call sign of the traffic. Otherwise, it contains an empty string
Definition at line 147 of file TrafficFactor_Abstract.h.
|
read |
Suggested color for GUI representation of the traffic.
This propery suggests a color, depending on the alarmLevel.
Definition at line 157 of file TrafficFactor_Abstract.h.
|
read |
Description of the traffic, for use in GUI.
This method holds a human-readable, translated description of the traffic. This is a rich-text string of the form "Glider<br>+15 0m" or "Airship<br>Position unknown<br>-45 ft".
Definition at line 165 of file TrafficFactor_Abstract.h.
|
readwrite |
Horizontal distance from own position to the traffic, at the time of report.
If known, this property holds the horizontal distance from the own position to the traffic, at the time of report. Otherwise, it contains an invalid distance.
Definition at line 173 of file TrafficFactor_Abstract.h.
|
readwrite |
Identifier string of the traffic.
This property holds an identifier string for the traffic, as assigned by the FLARM device that reported the traffic. This can be the FLARM ID, or an empty string if no meaningful ID can be assigned.
Definition at line 181 of file TrafficFactor_Abstract.h.
|
read |
Indicates relevant traffic.
This property holds 'true' if the traffic is valid, and closer than maxVerticalDistance and maxHorizontalDistance specified below.
Definition at line 188 of file TrafficFactor_Abstract.h.
|
read |
Type of aircraft, as reported by the traffic receiver.
This property holds a translated, human-readable string.
Definition at line 200 of file TrafficFactor_Abstract.h.
|
read |
Validity.
A traffic object is considered valid if the data is meaningful and if the lifetime is not expired. Only valid traffic objects should be shown in the GUI.
Definition at line 207 of file TrafficFactor_Abstract.h.
|
readwrite |
Vertical distance from own position to the traffic, at the time of report.
If known, this property holds the vertical distance from the own position to the traffic, at the time of report. Otherwise, it contains NaN.
Definition at line 215 of file TrafficFactor_Abstract.h.