CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
canloadmodel.h
Go to the documentation of this file.
1#ifndef CANLOADMODEL_H
2#define CANLOADMODEL_H
3
4#include "canload.h"
5#include "canloadpainter.h"
6#include "componentmodel.h"
7#include <QtCore/QObject>
8
9using QtNodes::NodeData;
10using QtNodes::NodeDataType;
11using QtNodes::PortIndex;
12using QtNodes::PortType;
13
14enum class Direction;
15
16class CanLoadModel : public ComponentModel<CanLoad, CanLoadModel> {
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 void currentLoad(uint8_t load);
30
31signals:
32 void frameIn(const QCanBusFrame& frame);
34
35private:
36 std::unique_ptr<CanLoadPainter> _painter;
37 uint8_t _currentLoad = 0;
38};
39
40#endif // CANLOADMODEL_H
Definition canloadmodel.h:16
void setInData(std::shared_ptr< NodeData > nodeData, PortIndex port) override
Definition canloadmodel.cpp:59
void currentLoad(uint8_t load)
Definition canloadmodel.cpp:70
void frameIn(const QCanBusFrame &frame)
void requestRedraw()
unsigned int nPorts(PortType portType) const override
Definition canloadmodel.cpp:39
NodeDataType dataType(PortType portType, PortIndex portIndex) const override
Definition canloadmodel.cpp:44
std::shared_ptr< NodeData > outData(PortIndex port) override
Definition canloadmodel.cpp:54
QtNodes::NodePainterDelegate * painterDelegate() const override
Definition canloadmodel.cpp:34
CanLoadModel()
Definition canloadmodel.cpp:22
Definition componentmodel.h:37
Direction
The enum class describing frame direction.
Definition datadirection.h:7