CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
canrawplayer.h
Go to the documentation of this file.
1#ifndef CANRAWPLAYER_H
2#define CANRAWPLAYER_H
3
4#include <QWidget>
5#include <QtCore/QScopedPointer>
7#include <context.h>
8#include <memory>
9
11class QCanBusFrame;
12class QWidget;
14
15class CanRawPlayer : public QObject, public ComponentInterface {
16 Q_OBJECT
17 Q_DECLARE_PRIVATE(CanRawPlayer)
18
19public:
21 explicit CanRawPlayer(CanRawPlayerCtx&& 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 sendFrame(const QCanBusFrame& frame);
35 void mainWidgetDockToggled(QWidget* widget) override;
36 void simBcastSnd(const QJsonObject &msg, const QVariant &param = QVariant()) override;
37
38public slots:
39 void stopSimulation() override;
40 void startSimulation() override;
41 void simBcastRcv(const QJsonObject &msg, const QVariant &param) override;
42
43private:
44 QScopedPointer<CanRawPlayerPrivate> d_ptr;
45};
46
47#endif //CANRAWPLAYER_H
Context CanRawPlayerCtx
Definition canrawplayer.h:13
Definition canrawplayer.h:15
void sendFrame(const QCanBusFrame &frame)
void setConfig(const QJsonObject &json) override
Sets configuration for component.
Definition canrawplayer.cpp:26
void stopSimulation() override
Definition canrawplayer.cpp:76
void mainWidgetDockToggled(QWidget *widget) override
void configChanged() override
Reconfigure component if necessary.
Definition canrawplayer.cpp:52
std::shared_ptr< QWidget > getQConfig() const override
Gets current component configuation.
Definition canrawplayer.cpp:45
CanRawPlayer()
Definition canrawplayer.cpp:8
QJsonObject getConfig() const override
Gets current component configuation.
Definition canrawplayer.cpp:40
void simBcastRcv(const QJsonObject &msg, const QVariant &param) override
Definition canrawplayer.cpp:92
void startSimulation() override
Definition canrawplayer.cpp:84
ComponentInterface::ComponentProperties getSupportedProperties() const override
Definition canrawplayer.cpp:71
QWidget * mainWidget() override
Gets components's main widget.
Definition canrawplayer.cpp:20
bool mainWidgetDocked() const override
Main widget docking status.
Definition canrawplayer.cpp:65
void simBcastSnd(const QJsonObject &msg, const QVariant &param=QVariant()) override
~CanRawPlayer()
Definition canrawplayer.cpp:18
Definition canrawplayer_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