CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
canrawdata.h
Go to the documentation of this file.
1#ifndef __CANRAWDATA_H
2#define __CANRAWDATA_H
3
4#include <nodes/NodeData>
5#include <nodes/NodeDataModel>
6
7#include <QCanBusFrame>
8#include "datadirection.h"
9
13class CanRawData : public QtNodes::NodeData {
14public:
16 CanRawData(QCanBusFrame const& frame, Direction const direction = Direction::TX, bool status = true)
17 : _frame(frame)
18 , _direction(direction)
19 , _status(status)
20 {
21 }
26 QtNodes::NodeDataType type() const override
27 {
28 return QtNodes::NodeDataType{ "rawframe", "RAW" };
29 }
30
34 QCanBusFrame frame() const
35 {
36 return _frame;
37 };
38
43 {
44 return _direction;
45 };
46
50 bool status() const
51 {
52 return _status;
53 };
54
55private:
56 QCanBusFrame _frame;
57 Direction _direction;
58 bool _status; // used only for frameSent, ignored for frameReceived
59};
60
61#endif /* !__CANRAWDATA_H */
The class describing data model used as output for CanDevice node.
Definition canrawdata.h:13
Direction direction() const
Used to get direction.
Definition canrawdata.h:42
CanRawData()
Definition canrawdata.h:15
QCanBusFrame frame() const
Used to get frame.
Definition canrawdata.h:34
bool status() const
Used to get status.
Definition canrawdata.h:50
QtNodes::NodeDataType type() const override
Used to get data type id and displayed text for ports.
Definition canrawdata.h:26
CanRawData(QCanBusFrame const &frame, Direction const direction=Direction::TX, bool status=true)
Definition canrawdata.h:16
Direction
The enum class describing frame direction.
Definition datadirection.h:7