|
QGroundControl
Ground Control Station for MAVLink Drones
|
Dynamically manages FactGroupWithIds based on incoming messages. More...
#include <FactGroupListModel.h>
Inheritance diagram for FactGroupListModel:
Collaboration diagram for FactGroupListModel:Public Member Functions | |
| FactGroupListModel (const char *factGroupNamePrefix, QObject *parent=nullptr) | |
| void | handleMessageForFactGroupCreation (Vehicle *vehicle, const mavlink_message_t &message) |
| Allows for creation/updating of dynamic FactGroups based on incoming messages. | |
Public Member Functions inherited from QmlObjectListModel | |
| QmlObjectListModel (QObject *parent=nullptr) | |
| int | count () const override final |
| bool | isEmpty () const override final |
| void | setDirty (bool dirty) override final |
| void | clear () override final |
| QObject * | removeOne (const QObject *object) override final |
| bool | contains (const QObject *object) override final |
| void | clearAndDeleteContents () override final |
| Clears the list and calls deleteLater on each entry. | |
| QObject * | get (int index) |
| QObject * | operator[] (int index) |
| const QObject * | operator[] (int index) const |
| void | append (QObject *object) |
| Caller maintains responsibility for object ownership and deletion. | |
| void | append (QList< QObject * > objects) |
| Caller maintains responsibility for object ownership and deletion. | |
| QObjectList | swapObjectList (const QObjectList &newlist) |
| QObject * | removeAt (int index) |
| void | insert (int index, QObject *object) |
| void | insert (int index, QList< QObject * > objects) |
| int | indexOf (const QObject *object) |
| void | move (int from, int to) |
| template<class T > | |
| T | value (int index) const |
| QList< QObject * > * | objectList () |
Public Member Functions inherited from ObjectListModelBase | |
| ObjectListModelBase (QObject *parent=nullptr) | |
| ~ObjectListModelBase () override | |
| QModelIndex | index (int row, int column=0, const QModelIndex &parent=QModelIndex()) const override |
| QModelIndex | parent (const QModelIndex &child) const override |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| bool | hasChildren (const QModelIndex &parent=QModelIndex()) const override |
Public Member Functions inherited from ObjectItemModelBase | |
| ObjectItemModelBase (QObject *parent=nullptr) | |
| ~ObjectItemModelBase () override | |
| int count READ count NOTIFY | countChanged (bool dirty READ dirty WRITE setDirty NOTIFY dirtyChanged) bool dirty() const |
| void | beginResetModel () |
| Depth-counted beginResetModel — only the outermost call has effect. | |
| void | endResetModel () |
| Depth-counted endResetModel — only the outermost call has effect. | |
Protected Member Functions | |
| virtual bool | _shouldHandleMessage (const mavlink_message_t &message, QList< uint32_t > &ids) const =0 |
| virtual FactGroupWithId * | _createFactGroupWithId (uint32_t id)=0 |
| FactGroupWithId * | _findOrAddFactGroupById (Vehicle *vehicle, uint32_t id) |
| QString | _factGroupNameWithId (uint32_t id) const |
Protected Member Functions inherited from QmlObjectListModel | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| bool | insertRows (int position, int rows, const QModelIndex &index=QModelIndex()) override |
| bool | removeRows (int position, int rows, const QModelIndex &index=QModelIndex()) override |
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
Protected Member Functions inherited from ObjectItemModelBase | |
| QHash< int, QByteArray > | roleNames () const override |
| void | _signalCountChangedIfNotNested () |
Protected Attributes | |
| const char * | _factGroupNamePrefix |
Protected Attributes inherited from ObjectListModelBase | |
| bool | _skipDirtyFirstItem = false |
Protected Attributes inherited from ObjectItemModelBase | |
| bool | _dirty = false |
| uint | _resetModelNestingCount = 0 |
Additional Inherited Members | |
Signals inherited from ObjectItemModelBase | |
| void | countChanged (int count) |
| void | dirtyChanged (bool dirty) |
Protected Slots inherited from ObjectItemModelBase | |
| void | _childDirtyChanged (bool dirty) |
Static Protected Attributes inherited from ObjectItemModelBase | |
| static constexpr int | ObjectRole = Qt::UserRole |
| static constexpr int | TextRole = Qt::UserRole + 1 |
Dynamically manages FactGroupWithIds based on incoming messages.
Definition at line 10 of file FactGroupListModel.h.
|
explicit |
Definition at line 4 of file FactGroupListModel.cc.
|
protectedpure virtual |
Implemented in BatteryFactGroupListModel, and EscStatusFactGroupListModel.
Referenced by _findOrAddFactGroupById().
Definition at line 22 of file FactGroupListModel.cc.
References _factGroupNamePrefix, and ObjectListModelBase::index().
Referenced by _findOrAddFactGroupById().
|
protected |
Definition at line 27 of file FactGroupListModel.cc.
References FactGroup::_addFactGroup(), _createFactGroupWithId(), _factGroupNameWithId(), QmlObjectListModel::count(), ObjectListModelBase::index(), and QmlObjectListModel::insert().
Referenced by handleMessageForFactGroupCreation().
|
protectedpure virtual |
Implemented in BatteryFactGroupListModel, and EscStatusFactGroupListModel.
Referenced by handleMessageForFactGroupCreation().
| void FactGroupListModel::handleMessageForFactGroupCreation | ( | Vehicle * | vehicle, |
| const mavlink_message_t & | message | ||
| ) |
Allows for creation/updating of dynamic FactGroups based on incoming messages.
Definition at line 11 of file FactGroupListModel.cc.
References _findOrAddFactGroupById(), _shouldHandleMessage(), and ObjectListModelBase::index().
Definition at line 29 of file FactGroupListModel.h.
Referenced by _factGroupNameWithId().