QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
FactGroup Class Reference

Used to group Facts together into an object hierarachy. More...

#include <FactGroup.h>

+ Inheritance diagram for FactGroup:
+ Collaboration diagram for FactGroup:

Signals

void factNamesChanged ()
 
void factGroupNamesChanged ()
 
void telemetryAvailableChanged (bool telemetryAvailable)
 

Public Member Functions

 FactGroup (int updateRateMsecs, const QString &metaDataFile, QObject *parent=nullptr, bool ignoreCamelCase=false)
 < false: No telemetry for these values has been received
 
 FactGroup (int updateRateMsecs, QObject *parent=nullptr, bool ignoreCamelCase=false)
 
virtual ~FactGroup ()
 
Q_INVOKABLE bool factExists (const QString &name) const
 @ return true: if the fact exists in the group
 
Q_INVOKABLE FactgetFact (const QString &name) const
 
Q_INVOKABLE FactGroupgetFactGroup (const QString &name) const
 
Q_INVOKABLE void setLiveUpdates (bool liveUpdates)
 Turning on live updates will allow value changes to flow through as they are received.
 
QStringList factNames () const
 
QStringList factGroupNames () const
 
bool telemetryAvailable () const
 
const QMap< QString, FactGroup * > & factGroups () const
 
virtual void handleMessage (Vehicle *, const mavlink_message_t &)
 Allows a FactGroup to parse incoming messages and fill in values.
 

Protected Slots

virtual void _updateAllValues ()
 

Protected Member Functions

void _addFact (Fact *fact, const QString &name)
 
void _addFact (Fact *fact)
 
void _addFactGroup (FactGroup *factGroup, const QString &name)
 
void _addFactGroup (FactGroup *factGroup)
 
void _loadFromJsonArray (const QJsonArray &jsonArray)
 
void _setTelemetryAvailable (bool telemetryAvailable)
 

Protected Attributes

const int _updateRateMSecs = 0
 Update rate for Fact::valueChanged signals, 0: immediate update.
 
QMap< QString, Fact * > _nameToFactMap
 
QMap< QString, FactGroup * > _nameToFactGroupMap
 
QMap< QString, FactMetaData * > _nameToFactMetaDataMap
 
QStringList _factNames
 

Detailed Description

Used to group Facts together into an object hierarachy.

Definition at line 15 of file FactGroup.h.

Constructor & Destructor Documentation

◆ FactGroup() [1/2]

FactGroup::FactGroup ( int  updateRateMsecs,
const QString &  metaDataFile,
QObject *  parent = nullptr,
bool  ignoreCamelCase = false 
)
explicit

< false: No telemetry for these values has been received

Definition at line 9 of file FactGroup.cc.

References FactMetaData::createMapFromJsonFile().

◆ FactGroup() [2/2]

FactGroup::FactGroup ( int  updateRateMsecs,
QObject *  parent = nullptr,
bool  ignoreCamelCase = false 
)
explicit

Definition at line 19 of file FactGroup.cc.

◆ ~FactGroup()

FactGroup::~FactGroup ( )
virtual

Definition at line 28 of file FactGroup.cc.

Member Function Documentation

◆ _addFact() [1/2]

void FactGroup::_addFact ( Fact fact)
inlineprotected

Definition at line 61 of file FactGroup.h.

References _addFact(), and Fact::name().

Referenced by _addFact().

◆ _addFact() [2/2]

◆ _addFactGroup() [1/2]

void FactGroup::_addFactGroup ( FactGroup factGroup)
inlineprotected

Definition at line 63 of file FactGroup.h.

References _addFactGroup().

Referenced by _addFactGroup().

◆ _addFactGroup() [2/2]

void FactGroup::_addFactGroup ( FactGroup factGroup,
const QString &  name 
)
protected

◆ _loadFromJsonArray()

void FactGroup::_loadFromJsonArray ( const QJsonArray &  jsonArray)
protected

Definition at line 33 of file FactGroup.cc.

References _nameToFactMetaDataMap, and FactMetaData::createMapFromJsonArray().

◆ _setTelemetryAvailable()

◆ _updateAllValues

void FactGroup::_updateAllValues ( )
protectedvirtualslot

Definition at line 145 of file FactGroup.cc.

References _nameToFactMap.

◆ factExists()

bool FactGroup::factExists ( const QString &  name) const

@ return true: if the fact exists in the group

Definition at line 49 of file FactGroup.cc.

References _nameToFactMap, factExists(), and getFactGroup().

Referenced by factExists(), and VehicleCameraControl::mode().

◆ factGroupNames()

QStringList FactGroup::factGroupNames ( ) const
inline

Definition at line 44 of file FactGroup.h.

References _nameToFactGroupMap.

Referenced by InstrumentValueData::factGroupNames().

◆ factGroupNamesChanged

void FactGroup::factGroupNamesChanged ( )
signal

Referenced by _addFactGroup().

◆ factGroups()

const QMap< QString, FactGroup * > & FactGroup::factGroups ( ) const
inline

Definition at line 46 of file FactGroup.h.

References _nameToFactGroupMap.

◆ factNames()

QStringList FactGroup::factNames ( ) const
inline

Definition at line 43 of file FactGroup.h.

References _factNames.

Referenced by InstrumentValueData::factValueNames(), and Vehicle::Vehicle().

◆ factNamesChanged

void FactGroup::factNamesChanged ( )
signal

Referenced by _addFact().

◆ getFact()

Fact * FactGroup::getFact ( const QString &  name) const
Returns
Fact for specified name, NULL if not found Note: Requesting a fact which doesn't exists is considered an internal error and will spit out a qWarning

Definition at line 72 of file FactGroup.cc.

References _nameToFactMap, getFact(), and getFactGroup().

Referenced by VehicleCameraControl::aperture(), VehicleCameraControl::ev(), VehicleCameraControl::exposureMode(), getFact(), VehicleCameraControl::iso(), VehicleCameraControl::mode(), VehicleCameraControl::shutterSpeed(), Vehicle::Vehicle(), and VehicleCameraControl::wb().

◆ getFactGroup()

FactGroup * FactGroup::getFactGroup ( const QString &  name) const
Returns
FactGroup for specified name, NULL if not found Note: Requesting a fact group which doesn't exists is considered an internal error and will spit out a qWarning

Definition at line 102 of file FactGroup.cc.

References _nameToFactGroupMap.

Referenced by factExists(), InstrumentValueData::factValueNames(), and getFact().

◆ handleMessage()

◆ setLiveUpdates()

void FactGroup::setLiveUpdates ( bool  liveUpdates)

Turning on live updates will allow value changes to flow through as they are received.

Definition at line 152 of file FactGroup.cc.

References _nameToFactMap.

Referenced by Vehicle::setPIDTuningTelemetryMode().

◆ telemetryAvailable()

bool FactGroup::telemetryAvailable ( ) const
inline

Definition at line 45 of file FactGroup.h.

Referenced by _setTelemetryAvailable().

◆ telemetryAvailableChanged

void FactGroup::telemetryAvailableChanged ( bool  telemetryAvailable)
signal

Referenced by _setTelemetryAvailable().

Member Data Documentation

◆ _factNames

QStringList FactGroup::_factNames
protected

Definition at line 72 of file FactGroup.h.

Referenced by _addFact(), and factNames().

◆ _nameToFactGroupMap

QMap<QString, FactGroup*> FactGroup::_nameToFactGroupMap
protected

Definition at line 70 of file FactGroup.h.

Referenced by _addFactGroup(), factGroupNames(), factGroups(), and getFactGroup().

◆ _nameToFactMap

QMap<QString, Fact*> FactGroup::_nameToFactMap
protected

Definition at line 69 of file FactGroup.h.

Referenced by _addFact(), _updateAllValues(), factExists(), getFact(), and setLiveUpdates().

◆ _nameToFactMetaDataMap

QMap<QString, FactMetaData*> FactGroup::_nameToFactMetaDataMap
protected

Definition at line 71 of file FactGroup.h.

Referenced by _addFact(), and _loadFromJsonArray().

◆ _updateRateMSecs

const int FactGroup::_updateRateMSecs = 0
protected

Update rate for Fact::valueChanged signals, 0: immediate update.

Definition at line 67 of file FactGroup.h.

Referenced by _addFact().


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