CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
cansignalencoder.h
Go to the documentation of this file.
1#ifndef CANSIGNALENCODER_H
2#define CANSIGNALENCODER_H
3
4#include <QWidget>
5#include <QtCore/QScopedPointer>
7#include <context.h>
8#include <memory>
9
10class QCanBusFrame;
12class QWidget;
13struct CanSignalEncoderGuiInt;
15
16class CanSignalEncoder : public QObject, public ComponentInterface {
17 Q_OBJECT
18 Q_DECLARE_PRIVATE(CanSignalEncoder)
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 sndFrame(const QCanBusFrame& frame);
38
39public slots:
40 void stopSimulation() override;
41 void startSimulation() override;
42 void simBcastRcv(const QJsonObject& msg, const QVariant& param) override;
43 void rcvSignal(const QString& name, const QVariant& val);
44
45private:
46 QScopedPointer<CanSignalEncoderPrivate> d_ptr;
47};
48
49#endif // CANSIGNALENCODER_H
Context CanSignalEncoderCtx
Definition cansignalencoder.h:14
Definition cansignalencoder.h:16
void setConfig(const QJsonObject &json) override
Sets configuration for component.
Definition cansignalencoder.cpp:18
QWidget * mainWidget() override
Gets components's main widget.
Definition cansignalencoder.cpp:12
void mainWidgetDockToggled(QWidget *widget) override
~CanSignalEncoder()
Definition cansignalencoder.cpp:10
void simBcastRcv(const QJsonObject &msg, const QVariant &param) override
Definition cansignalencoder.cpp:90
bool mainWidgetDocked() const override
Main widget docking status.
Definition cansignalencoder.cpp:55
void startSimulation() override
Definition cansignalencoder.cpp:77
void stopSimulation() override
Definition cansignalencoder.cpp:66
void simBcastSnd(const QJsonObject &msg, const QVariant &param=QVariant()) override
ComponentInterface::ComponentProperties getSupportedProperties() const override
Definition cansignalencoder.cpp:61
std::shared_ptr< QWidget > getQConfig() const override
Gets current component configuation.
Definition cansignalencoder.cpp:39
CanSignalEncoder()
Definition cansignalencoder.cpp:5
void configChanged() override
Reconfigure component if necessary.
Definition cansignalencoder.cpp:53
void sndFrame(const QCanBusFrame &frame)
QJsonObject getConfig() const override
Gets current component configuation.
Definition cansignalencoder.cpp:34
void rcvSignal(const QString &name, const QVariant &val)
Definition cansignalencoder.cpp:97
Definition cansignalencoder_p.h:13
Interface to be implemented by every component.
Definition componentinterface.h:15
std::vector< ComponentProperty > ComponentProperties
Definition componentinterface.h:66
Definition context.h:13