CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
CanRawViewModel Class Reference

The class provides node graphical representation of CanRawView. More...

#include <canrawviewmodel.h>

Inheritance diagram for CanRawViewModel:
Collaboration diagram for CanRawViewModel:

Signals

void frameReceived (const QCanBusFrame &frame)
 Emits singal on CAN frame receival.
 
void frameSent (bool status, const QCanBusFrame &frame)
 Emits signal on CAN fram transmission.
 
void requestRedraw ()
 
- Signals inherited from ComponentModelInterface
void startSimulation ()
 
void stopSimulation ()
 
void handleDock (QWidget *widget)
 
void simBcastSnd (const QJsonObject &msg, const QVariant &param)
 

Public Member Functions

 CanRawViewModel ()
 
virtual ~CanRawViewModel ()=default
 
unsigned int nPorts (PortType portType) const override
 Used to get number of ports of each type used by model.
 
NodeDataType dataType (PortType portType, PortIndex portIndex) const override
 Used to get data type of each port.
 
std::shared_ptr< NodeData > outData (PortIndex port) override
 Sets output data for propagation, not used in this class.
 
void setInData (std::shared_ptr< NodeData > nodeData, PortIndex port) override
 Handles data on input port, send frames to CanRawView.
 
QtNodes::NodePainterDelegate * painterDelegate () const override
 Used to provide custom painter to nodeeditor.
 
- Public Member Functions inherited from ComponentModel< CanRawView, CanRawViewModel >
 ComponentModel ()=default
 
 ComponentModel (const QString &name)
 
virtual ~ComponentModel ()
 
virtual void initModel (QtNodes::Node &node, int nodeCnt, bool darkMode) override
 
virtual QString caption () const override
 Used to get node caption.
 
virtual void setCaption (const QString &caption) override
 Sets model caption and updates widget title.
 
virtual QString name () const override
 Used to identify model by data model name.
 
virtual std::unique_ptr< QtNodes::NodeDataModel > clone () const override
 Creates new node of the same type.
 
virtual QJsonObject save () const override
 Possibility to save node properties.
 
virtual void restore (QJsonObject const &json) override
 Used to restore node configurations.
 
virtual QWidget * embeddedWidget () override
 Used to get widget embedded in Node.
 
virtual bool resizable () const override
 Used to get information if node is resizable.
 
virtual ComponentInterfacegetComponent () override
 Component getter.
 
virtual bool restored () override
 
virtual void setColorMode (bool darkMode) override
 
virtual bool hasSeparateThread () const override
 
void simBcastRcv (const QJsonObject &msg, const QVariant &param) override
 
void simBcastSndSlot (const QJsonObject &msg, const QVariant &param) override
 
- Public Member Functions inherited from ComponentModelInterface
virtual ~ComponentModelInterface ()=default
 

Additional Inherited Members

- Protected Attributes inherited from ComponentModel< CanRawView, CanRawViewModel >
CanRawView _component
 
QLabel * _label
 
QString _caption
 
QString _name
 
bool _resizable
 
bool _restored
 
bool _darkMode
 
QtNodes::NodeStyle _nodeStyle
 
std::unique_ptr< QThread > _thread
 
QUuid _id
 

Detailed Description

The class provides node graphical representation of CanRawView.

Constructor & Destructor Documentation

◆ CanRawViewModel()

CanRawViewModel::CanRawViewModel ( )

◆ ~CanRawViewModel()

virtual CanRawViewModel::~CanRawViewModel ( )
virtualdefault

Member Function Documentation

◆ dataType()

NodeDataType CanRawViewModel::dataType ( PortType  portType,
PortIndex  portIndex 
) const
override

Used to get data type of each port.

Parameters
typeof port @patam port id
Returns
CanDeviceDataOIn type if portType is out

◆ frameReceived

void CanRawViewModel::frameReceived ( const QCanBusFrame &  frame)
signal

Emits singal on CAN frame receival.

Parameters
frameReceived frame

◆ frameSent

void CanRawViewModel::frameSent ( bool  status,
const QCanBusFrame &  frame 
)
signal

Emits signal on CAN fram transmission.

Parameters
statustrue if frame has be sent successfuly
frameTransmitted frame

◆ nPorts()

unsigned int CanRawViewModel::nPorts ( PortType  portType) const
override

Used to get number of ports of each type used by model.

Parameters
typeof port
Returns
1 if port in, 0 if any other type

◆ outData()

std::shared_ptr< NodeData > CanRawViewModel::outData ( PortIndex  port)
override

Sets output data for propagation, not used in this class.

Parameters
portid
Returns

◆ painterDelegate()

QtNodes::NodePainterDelegate * CanRawViewModel::painterDelegate ( ) const
override

Used to provide custom painter to nodeeditor.

Returns
NodePainterDelegate used to perform custom node painting

◆ requestRedraw

void CanRawViewModel::requestRedraw ( )
signal

◆ setInData()

void CanRawViewModel::setInData ( std::shared_ptr< NodeData >  nodeData,
PortIndex  port 
)
override

Handles data on input port, send frames to CanRawView.

Parameters
dataon port
portid

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