CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
cansignalmodel.h
Go to the documentation of this file.
1#ifndef CANSIGNALMODEL_H
2#define CANSIGNALMODEL_H
3
4#include <QVariant>
5#include <nodes/NodeData>
6#include <nodes/NodeDataModel>
7
8#include "datadirection.h"
9
10class CanSignalModel : public QtNodes::NodeData {
11public:
13 CanSignalModel(const QString& sigName, const QVariant& value, const Direction& dir = Direction::TX)
14 : _sigName(sigName)
15 , _value(value)
16 , _dir(dir)
17 {
18 }
19
20 QtNodes::NodeDataType type() const override
21 {
22 return QtNodes::NodeDataType{ "signal", "SIG" };
23 }
24
25 QVariant value() const
26 {
27 return _value;
28 }
29
30 QString name() const
31 {
32 return _sigName;
33 }
34
36 {
37 return _dir;
38 }
39
40private:
41 QString _sigName;
42 QVariant _value;
43 Direction _dir;
44};
45
46#endif // CANSIGNALMODEL_H
Definition cansignalmodel.h:10
QVariant value() const
Definition cansignalmodel.h:25
QtNodes::NodeDataType type() const override
Definition cansignalmodel.h:20
QString name() const
Definition cansignalmodel.h:30
Direction direction() const
Definition cansignalmodel.h:35
CanSignalModel()
Definition cansignalmodel.h:12
CanSignalModel(const QString &sigName, const QVariant &value, const Direction &dir=Direction::TX)
Definition cansignalmodel.h:13
Direction
The enum class describing frame direction.
Definition datadirection.h:7