Enroute Flight Navigation
A navigation app for VFR pilots
Traffic::Warning Class Reference

Traffic warning. More...

#include <Warning.h>

Public Member Functions

 Warning ()=default
 Default constructor.
 
Q_INVOKABLE int alarmLevel () const
 Alarm level, as reported by FLARM.
 
Q_INVOKABLE int alarmType () const
 Alarm type, as reported by FLARM.
 
Q_INVOKABLE QString description () const
 Translated, human-readable alarm message.
 
Q_INVOKABLE Units::Distance hDist () const
 Horizontal distance to obstacle or aircraft.
 
Q_INVOKABLE bool operator== (const Traffic::Warning &rhs)
 Comparison.
 
Q_INVOKABLE Units::Angle relativeBearing () const
 Direction to obstacle or aircraft.
 
Q_INVOKABLE Units::Distance vDist () const
 Vertical distance to obstacle or aircraft.
 

Detailed Description

Traffic warning.

Objects of this class represent traffic warnings, as detected by FLARM and similar devices. The data fields correspond to the data fields sent out by FLARM devices with their PFLAU NMEA-sentences. Instances of this class will be generated by the Navigation::TrafficDataSource_* classes. Consumers of this class will never have to set or construct instances of the class themselves

Definition at line 40 of file Warning.h.

Member Function Documentation

◆ alarmLevel()

Q_INVOKABLE int Traffic::Warning::alarmLevel ( ) const
inlinenodiscard

Alarm level, as reported by FLARM.

This is an integer in the range -1, …, 3 with the following meaning.

  • -1 = invalid data
  • 0 = no alarm (also used for no-alarm traffic information)
  • 1 = alarm, 13-18 seconds to impact
  • 2 = alarm, 9-12 seconds to impact
  • 3 = alarm, 0-8 seconds to impact
Returns
alarm level

See the FLARM "Data Port Interface Control Document" for a further description.

Definition at line 69 of file Warning.h.

◆ alarmType()

Q_INVOKABLE int Traffic::Warning::alarmType ( ) const
inlinenodiscard

Alarm type, as reported by FLARM.

This is an integer from the set {-1, 2, 3, 4} with the following meaning.

  • -1 = invalid data
  • 2 = aircraft alarm
  • 3 = obstacle alarm
  • 4 = traffic advisory

Alert zone alarms are currently not supported.

Returns
alarm type

See the FLARM "Data Port Interface Control Document" for a further description.

Definition at line 90 of file Warning.h.

◆ description()

Q_INVOKABLE QString Traffic::Warning::description ( ) const
nodiscard

Translated, human-readable alarm message.

Returns
A string of the form "Traffic • 10 o'clock position • Distance 0.4 nm • 700 ft below."

◆ hDist()

Q_INVOKABLE Units::Distance Traffic::Warning::hDist ( ) const
inlinenodiscard

Horizontal distance to obstacle or aircraft.

Returns
Horizontal distance, might be NaN

Definition at line 106 of file Warning.h.

◆ operator==()

Q_INVOKABLE bool Traffic::Warning::operator== ( const Traffic::Warning & rhs)

Comparison.

Parameters
rhsRight hand side of the comparison
Returns
True if equal

◆ relativeBearing()

Q_INVOKABLE Units::Angle Traffic::Warning::relativeBearing ( ) const
inlinenodiscard

Direction to obstacle or aircraft.

Returns
Relative bearing, might be NaN

Definition at line 123 of file Warning.h.

◆ vDist()

Q_INVOKABLE Units::Distance Traffic::Warning::vDist ( ) const
inlinenodiscard

Vertical distance to obstacle or aircraft.

Returns
Vertical distance, might be NaN

Definition at line 132 of file Warning.h.


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