CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
cansignalsender.h
Go to the documentation of this file.
1#ifndef CANSIGNALSENDER_H
2#define CANSIGNALSENDER_H
3
4#include <QWidget>
5#include <QtCore/QScopedPointer>
7#include <context.h>
8#include <memory>
9
11class QWidget;
14
15class CanSignalSender : public QObject, public ComponentInterface {
16 Q_OBJECT
17 Q_DECLARE_PRIVATE(CanSignalSender)
18
19public:
21 explicit CanSignalSender(CanSignalSenderCtx&& ctx);
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 sendSignal(const QString& name, const QVariant& val);
38
39public slots:
40 void stopSimulation() override;
41 void startSimulation() override;
42 void simBcastRcv(const QJsonObject &msg, const QVariant &param) override;
43
44private:
45 QScopedPointer<CanSignalSenderPrivate> d_ptr;
46};
47
48#endif //CANSIGNALSENDER_H
Context< CanSignalSenderGuiInt > CanSignalSenderCtx
Definition cansignalsender.h:13
Definition cansignalsender.h:15
void setConfig(const QJsonObject &json) override
Sets configuration for component.
Definition cansignalsender.cpp:28
std::shared_ptr< QWidget > getQConfig() const override
Gets current component configuation.
Definition cansignalsender.cpp:49
ComponentInterface::ComponentProperties getSupportedProperties() const override
Definition cansignalsender.cpp:70
bool mainWidgetDocked() const override
Main widget docking status.
Definition cansignalsender.cpp:65
~CanSignalSender()
Definition cansignalsender.cpp:19
void startSimulation() override
Definition cansignalsender.cpp:82
CanSignalSender()
Definition cansignalsender.cpp:9
void stopSimulation() override
Definition cansignalsender.cpp:75
void mainWidgetDockToggled(QWidget *widget) override
void configChanged() override
Reconfigure component if necessary.
Definition cansignalsender.cpp:63
void requestRedraw()
void simBcastSnd(const QJsonObject &msg, const QVariant &param=QVariant()) override
void simBcastRcv(const QJsonObject &msg, const QVariant &param) override
Definition cansignalsender.cpp:89
QJsonObject getConfig() const override
Gets current component configuation.
Definition cansignalsender.cpp:44
QWidget * mainWidget() override
Gets components's main widget.
Definition cansignalsender.cpp:21
void sendSignal(const QString &name, const QVariant &val)
Definition cansignalsender_p.h:16
Definition cansignalsenderguiint.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