CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
cansignaldecoder.h
Go to the documentation of this file.
1#ifndef CANSIGNALDECODER_H
2#define CANSIGNALDECODER_H
3
4#include <QWidget>
5#include <QtCore/QScopedPointer>
7#include <context.h>
8#include <memory>
9
11class QWidget;
13class QCanBusFrame;
14enum class Direction;
15
16class CanSignalDecoder : public QObject, public ComponentInterface {
17 Q_OBJECT
18 Q_DECLARE_PRIVATE(CanSignalDecoder)
19
20public:
23
24 QWidget* mainWidget() override;
25 void setConfig(const QJsonObject& json) override;
26 void setConfig(const QWidget& qobject) override;
27 QJsonObject getConfig() const override;
28 std::shared_ptr<QWidget> getQConfig() const override;
29 void configChanged() override;
30 bool mainWidgetDocked() const override;
32
33signals:
34 void mainWidgetDockToggled(QWidget* widget) override;
35 void simBcastSnd(const QJsonObject &msg, const QVariant &param = QVariant()) override;
37 void sndSignal(const QString& name, const QVariant& val, const Direction& dir);
38
39public slots:
40 void stopSimulation() override;
41 void startSimulation() override;
42 void simBcastRcv(const QJsonObject &msg, const QVariant &param) override;
43 void rcvFrame(const QCanBusFrame& frame, Direction const direction, bool status);
44
45private:
46 QScopedPointer<CanSignalDecoderPrivate> d_ptr;
47};
48
49#endif //CANSIGNALDECODER_H
Context CanSignalDecoderCtx
Definition cansignaldecoder.h:12
Definition cansignaldecoder.h:16
void configChanged() override
Reconfigure component if necessary.
Definition cansignaldecoder.cpp:54
void simBcastSnd(const QJsonObject &msg, const QVariant &param=QVariant()) override
void rcvFrame(const QCanBusFrame &frame, Direction const direction, bool status)
Definition cansignaldecoder.cpp:90
bool mainWidgetDocked() const override
Main widget docking status.
Definition cansignaldecoder.cpp:56
void mainWidgetDockToggled(QWidget *widget) override
void stopSimulation() override
Definition cansignaldecoder.cpp:67
ComponentInterface::ComponentProperties getSupportedProperties() const override
Definition cansignaldecoder.cpp:62
void simBcastRcv(const QJsonObject &msg, const QVariant &param) override
Definition cansignaldecoder.cpp:83
QWidget * mainWidget() override
Gets components's main widget.
Definition cansignaldecoder.cpp:13
std::shared_ptr< QWidget > getQConfig() const override
Gets current component configuation.
Definition cansignaldecoder.cpp:40
void setConfig(const QJsonObject &json) override
Sets configuration for component.
Definition cansignaldecoder.cpp:19
QJsonObject getConfig() const override
Gets current component configuation.
Definition cansignaldecoder.cpp:35
void sndSignal(const QString &name, const QVariant &val, const Direction &dir)
void startSimulation() override
Definition cansignaldecoder.cpp:74
~CanSignalDecoder()
Definition cansignaldecoder.cpp:11
CanSignalDecoder()
Definition cansignaldecoder.cpp:6
Definition cansignaldecoder_p.h:11
Direction
The enum class describing frame direction.
Definition datadirection.h:7
Interface to be implemented by every component.
Definition componentinterface.h:15
std::vector< ComponentProperty > ComponentProperties
Definition componentinterface.h:66
Definition context.h:13