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

Value object encapsulating information about an ATC station. More...

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

Public Types

enum  ColumnIndex {
  IndexCallsign = CPropertyIndexRef::GlobalIndexCAtcStation , IndexCallsignString , IndexCallsignStringCrossCopuled , IndexController ,
  IndexFrequency , IndexPosition , IndexRange , IndexIsInRange ,
  IndexIsOnline , IndexIsAfvCrossCoupled , IndexLogoffTime , IndexLatitude ,
  IndexLongitude , IndexAtis , IndexMetar
}
 Properties by index.
 
- Public Types inherited from swift::misc::CValueObject< CAtcStation >
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::ICoordinateWithRelativePosition
enum  ColumnIndex { IndexRelativeDistance = CPropertyIndexRef::GlobalIndexICoordinateWithRelativePosition , IndexRelativeBearing }
 Properties by index.
 
- Public Types inherited from swift::misc::geo::ICoordinateGeodetic
enum  ColumnIndex {
  IndexLatitude = CPropertyIndexRef::GlobalIndexICoordinateGeodetic , IndexLongitude , IndexLatitudeAsString , IndexLongitudeAsString ,
  IndexGeodeticHeight , IndexGeodeticHeightAsString , IndexNormalVector
}
 Properties by index.
 

Public Member Functions

 CAtcStation ()
 Default constructor.
 
 CAtcStation (const QString &callsign)
 Simplified constructor.
 
 CAtcStation (const CCallsign &callsign, const network::CUser &controller, const physical_quantities::CFrequency &frequency, const geo::CCoordinateGeodetic &pos, const physical_quantities::CLength &range, bool isOnline=false, const QDateTime &logoffTimeUtc=QDateTime(), const CInformationMessage &atis=CInformationMessage(CInformationMessage::ATIS), const CInformationMessage &metar=CInformationMessage(CInformationMessage::METAR))
 ATC station constructor.
 
bool hasLogoffTimeUtc () const
 Has expected logoff time?
 
bool hasAtis () const
 Has ATIS?
 
bool hasMetar () const
 Has METAR?
 
const CCallsigngetCallsign () const
 Get callsign.
 
bool hasCallsign () const
 Has callsign?
 
QString getCallsignAsString () const
 Get callsign as string.
 
QString getCallsignAsStringCrossCoupled () const
 Get callsign.
 
QString getCallsignSuffix () const
 Callsign suffix (e.g. TWR)
 
int getSuffixSortOrder () const
 Callsign suffix sort order.
 
void setCallsign (const CCallsign &callsign)
 Set callsign.
 
const swift::misc::network::CUsergetController () const
 Get controller.
 
QString getControllerRealName () const
 Get controller name.
 
QString getCallsignAndControllerRealName () const
 Callsign and controller's name if available.
 
QString getControllerId () const
 Get controller name.
 
void setController (const network::CUser &controller)
 Set controller.
 
void setControllerRealName (const QString &controllerName)
 Set controller's name.
 
void setControllerId (const QString &controllerId)
 Set controller's id.
 
bool hasRealName () const
 Has valid realname?
 
bool hasId () const
 Has valid id?
 
bool hasValidFrequency () const
 Valid COM frequency.
 
const physical_quantities::CFrequencygetFrequency () const
 Get frequency.
 
void setFrequency (const swift::misc::physical_quantities::CFrequency &frequency)
 Set frequency.
 
const geo::CCoordinateGeodeticgetPosition () const
 Get the position of the center of the controller's area of visibility.
 
void setPosition (const swift::misc::geo::CCoordinateGeodetic &position)
 Set position.
 
const physical_quantities::CLengthgetRange () const
 Get the radius of the controller's area of visibility.
 
void setRange (const physical_quantities::CLength &range)
 Set range.
 
bool isInRange () const
 In range? If range and distance to own aircraft are not available false.
 
bool isOnline () const
 Is station online?
 
bool setOnline (bool online)
 Set online.
 
bool isAfvCrossCoupled () const
 Is AFV cross coupled?
 
void setAfvCrossCoupled (bool coupled)
 Set AFV cross coupled.
 
const QDateTime & getLogoffTimeUtc () const
 Return the expected logoff time (UTC). This data comes from the controller through its ATIS line.
 
bool isComUnitTunedToFrequency (const aviation::CComSystem &comUnit) const
 Is Com unit tuned to this stations frequency.
 
bool isAtcStationFrequency (const physical_quantities::CFrequency &frequency) const
 Is passed frequency the frequency of this station.
 
const CInformationMessagegetAtis () const
 Get ATIS.
 
void setAtis (const CInformationMessage &atis)
 Set ATIS.
 
void setAtisMessage (const QString &atis)
 Set ATIS Message.
 
const CInformationMessagegetMetar () const
 Get METAR.
 
const CInformationMessagegetInformationMessage (CInformationMessage::InformationType type) const
 Message per type.
 
void setMetar (const CInformationMessage &metar)
 Set METAR.
 
void setMetarMessage (const QString &metar)
 Set METAR Message.
 
bool setMessage (const CInformationMessage &message)
 Set given message.
 
void setLogoffTimeUtc (const QDateTime &logoffTimeUtc)
 Set expected logoff time (UTC)
 
virtual geo::CLatitude latitude () const
 Latitude. More...
 
virtual geo::CLongitude longitude () const
 Longitude. More...
 
const aviation::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...
 
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 CAtcStation &compareValue) const
 Compare for index. More...
 
QString convertToQString (bool i18n=false) const
 Cast as QString. More...
 
swift::misc::CIcons::IconIndex toIcon () const
 As icon, not implemented by all classes. More...
 
- 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::ICoordinateWithRelativePosition
const physical_quantities::CLengthgetRelativeDistance () const
 Get the distance.
 
void setRelativeDistance (const physical_quantities::CLength &distance)
 Set relative distance.
 
const physical_quantities::CAnglegetRelativeBearing () const
 Get the relative bearing.
 
void setRelativeBearing (const physical_quantities::CAngle &angle)
 Set bearing to own plane.
 
bool hasValidRelativeDistance () const
 Valid distance?
 
bool hasValidRelativeBearing () const
 Valid bearing?
 
physical_quantities::CLength calculcateAndUpdateRelativeDistance (const geo::ICoordinateGeodetic &position)
 Calculcate distance, set it, and return distance.
 
physical_quantities::CLength calculcateAndUpdateRelativeDistanceAndBearing (const geo::ICoordinateGeodetic &position)
 Calculcate distance and bearing to plane, set it, and return distance.
 
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 ICoordinateWithRelativePosition &compareValue) const
 Compare for index. More...
 
QString convertToQString (bool i18n=false) const
 Cast as QString. More...
 
- 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.
 
virtual bool isNull () const
 Is null, means vector x, y, z == 0. More...
 
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.
 

Additional Inherited Members

- 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.
 
- Protected Member Functions inherited from swift::misc::CValueObject< CAtcStation >
 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::geo::ICoordinateWithRelativePosition
 ICoordinateWithRelativePosition ()
 Constructor.
 
- Static Protected Member Functions inherited from swift::misc::geo::ICoordinateWithRelativePosition
static bool canHandleIndex (CPropertyIndexRef index)
 Can given index be handled?
 
- Static Protected Member Functions inherited from swift::misc::geo::ICoordinateGeodetic
static bool canHandleIndex (CPropertyIndexRef index)
 Can given index be handled?
 
- Protected Attributes inherited from swift::misc::geo::ICoordinateWithRelativePosition
physical_quantities::CAngle m_relativeBearing { 0, nullptr }
 temporary stored value
 
physical_quantities::CLength m_relativeDistance { 0, nullptr }
 temporary stored value
 

Detailed Description

Value object encapsulating information about an ATC station.

Definition at line 37 of file atcstation.h.

Member Function Documentation

◆ comparePropertyByIndex()

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

Compare for index.

Definition at line 245 of file atcstation.cpp.

◆ convertToQString()

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

Cast as QString.

Definition at line 78 of file atcstation.cpp.

◆ geodeticHeight()

const CAltitude & swift::misc::aviation::CAtcStation::geodeticHeight ( ) const
virtual

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 173 of file atcstation.cpp.

◆ latitude()

CLatitude swift::misc::aviation::CAtcStation::latitude ( ) const
virtual

Latitude.

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

Definition at line 169 of file atcstation.cpp.

◆ longitude()

CLongitude swift::misc::aviation::CAtcStation::longitude ( ) const
virtual

Longitude.

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

Definition at line 171 of file atcstation.cpp.

◆ normalVector()

QVector3D swift::misc::aviation::CAtcStation::normalVector ( ) const
virtual

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 175 of file atcstation.cpp.

◆ normalVectorDouble()

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

Normal vector with double precision.

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

Definition at line 177 of file atcstation.cpp.

◆ propertyByIndex()

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

Property by index.

Definition at line 179 of file atcstation.cpp.

◆ setPropertyByIndex()

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

Set property by index.

Definition at line 207 of file atcstation.cpp.

◆ toIcon()

swift::misc::CIcons::IconIndex swift::misc::aviation::CAtcStation::toIcon ( ) const
inline

As icon, not implemented by all classes.

Definition at line 232 of file atcstation.h.


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