CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
cansignalviewermodel.h
Go to the documentation of this file.
1#ifndef CANSIGNALVIEWERMODEL_H
2#define CANSIGNALVIEWERMODEL_H
3
4#include "componentmodel.h"
5#include "nodepainter.h"
6#include <QtCore/QObject>
7#include <cansignalviewer.h>
8
9using QtNodes::NodeData;
10using QtNodes::NodeDataType;
11using QtNodes::PortIndex;
12using QtNodes::PortType;
13
14enum class Direction;
15
16class CanSignalViewerModel : public ComponentModel<CanSignalViewer, CanSignalViewerModel> {
17 Q_OBJECT
18
19public:
21
22 unsigned int nPorts(PortType portType) const override;
23 NodeDataType dataType(PortType portType, PortIndex portIndex) const override;
24 std::shared_ptr<NodeData> outData(PortIndex port) override;
25 void setInData(std::shared_ptr<NodeData> nodeData, PortIndex port) override;
26 QtNodes::NodePainterDelegate* painterDelegate() const override;
27
28public slots:
29
30signals:
32 void sndSignal(const QString& name, const QVariant& val, const Direction& dir);
33
34private:
35 std::unique_ptr<NodePainter> _painter;
36};
37
38#endif // CANSIGNALVIEWERMODEL_H
Definition cansignalviewermodel.h:16
std::shared_ptr< NodeData > outData(PortIndex port) override
Definition cansignalviewermodel.cpp:55
void sndSignal(const QString &name, const QVariant &val, const Direction &dir)
CanSignalViewerModel()
Definition cansignalviewermodel.cpp:24
QtNodes::NodePainterDelegate * painterDelegate() const override
Definition cansignalviewermodel.cpp:35
unsigned int nPorts(PortType portType) const override
Definition cansignalviewermodel.cpp:40
void setInData(std::shared_ptr< NodeData > nodeData, PortIndex port) override
Definition cansignalviewermodel.cpp:60
NodeDataType dataType(PortType portType, PortIndex portIndex) const override
Definition cansignalviewermodel.cpp:45
Definition componentmodel.h:37
virtual QString name() const override
Used to identify model by data model name.
Definition componentmodel.h:115
Direction
The enum class describing frame direction.
Definition datadirection.h:7