|
DBC Framework
DBC parsing and CAN signal decoding framework
|
#include <dbc_tree_model.h>
Inheritance diagram for DbcTreeModel:Public Types | |
| enum | Column { Name , CanId , PayloadLength , StartBit , BitLength , ByteOrder , Signed , Unit , Comment , ColumnCount } |
| Display columns for frame and signal metadata. More... | |
| enum | Role { NodeTypeRole = Qt::UserRole + 1 , CanIdRole , PayloadLengthRole , StartBitRole , BitLengthRole , LittleEndianRole , SignedRole , UnitRole , CommentRole , ValueDescriptionsRole , ExtendedRole } |
| Typed metadata roles in addition to Qt display roles. More... | |
Public Member Functions | |
| DbcTreeModel (QObject *parent=nullptr) | |
| Create an empty read-only model. | |
| void | SetTree (std::unique_ptr< TreeNode > root) |
| Replace the tree and invalidate indexes; reject roots with a parent or non-root type. | |
| QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
| Return a child index; only column zero can have children. | |
| QModelIndex | parent (const QModelIndex &child) const override |
| Return the parent in column zero, or an invalid index for frames. | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Return the child count, capped at the Qt integer limit. | |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| Return the fixed metadata column count for this model. | |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| Return display text or typed metadata for an index. | |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| Return horizontal display column titles. | |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| Allow selecting and enabling valid indexes without editing. | |
Read-only model. Owns an immutable tree; all indexes expire on SetTree(). Use QPersistentModelIndex to observe reset invalidation. Call on the model thread.
Definition at line 11 of file dbc_tree_model.h.
| enum DbcTreeModel::Column |
Display columns for frame and signal metadata.
Definition at line 14 of file dbc_tree_model.h.
| enum DbcTreeModel::Role |
Typed metadata roles in addition to Qt display roles.
Definition at line 26 of file dbc_tree_model.h.
|
explicit |
Create an empty read-only model.
Definition at line 25 of file dbc_tree_model.cpp.
| void DbcTreeModel::SetTree | ( | std::unique_ptr< TreeNode > | root | ) |
Replace the tree and invalidate indexes; reject roots with a parent or non-root type.
Definition at line 27 of file dbc_tree_model.cpp.
|
override |
Return a child index; only column zero can have children.
Definition at line 42 of file dbc_tree_model.cpp.
References TreeNode::GetChild().
|
override |
Return the parent in column zero, or an invalid index for frames.
Definition at line 53 of file dbc_tree_model.cpp.
References TreeNode::GetParent(), and TreeNode::GetRow().
|
override |
Return the child count, capped at the Qt integer limit.
Definition at line 61 of file dbc_tree_model.cpp.
References TreeNode::GetChildCount().
|
override |
Return the fixed metadata column count for this model.
Definition at line 70 of file dbc_tree_model.cpp.
|
override |
Return display text or typed metadata for an index.
Definition at line 74 of file dbc_tree_model.cpp.
References FrameInfo::canId, FrameInfo::comment, SignalInfo::comment, FrameInfo::dlc, TreeNode::GetFrame(), TreeNode::GetName(), TreeNode::GetSignal(), TreeNode::GetType(), FrameInfo::isExtended, SignalInfo::isLittleEndian, SignalInfo::isSigned, SignalInfo::length, SignalInfo::startBit, SignalInfo::unit, and SignalInfo::valueDescriptions.
|
override |
Return horizontal display column titles.
Definition at line 138 of file dbc_tree_model.cpp.
|
override |
Allow selecting and enabling valid indexes without editing.
Definition at line 145 of file dbc_tree_model.cpp.