CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
cansignalviewer.h
Go to the documentation of this file.
1#ifndef CANSIGNALVIEWER_H
2#define CANSIGNALVIEWER_H
3
4#include <QWidget>
5#include <QtCore/QScopedPointer>
7#include <context.h>
8#include <memory>
9
11class QWidget;
14enum class Direction;
15
16class CanSignalViewer : public QObject, public ComponentInterface {
17 Q_OBJECT
18 Q_DECLARE_PRIVATE(CanSignalViewer)
19
20public:
22 explicit CanSignalViewer(CanSignalViewerCtx&& ctx);
24
25 QWidget* mainWidget() override;
26 void setConfig(const QJsonObject& json) override;
27 void setConfig(const QWidget& qobject) override;
28 QJsonObject getConfig() const override;
29 std::shared_ptr<QWidget> getQConfig() const override;
30 void configChanged() override;
31 bool mainWidgetDocked() const override;
33
34signals:
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 void rcvSignal(const QString& name, const QVariant& val, const Direction& dir);
43
44private:
45 QScopedPointer<CanSignalViewerPrivate> d_ptr;
46};
47
48#endif //CANSIGNALVIEWER_H
Context< CanSignalViewerGuiInt > CanSignalViewerCtx
Definition cansignalviewer.h:13
Definition cansignalviewer.h:16
void startSimulation() override
Definition cansignalviewer.cpp:70
CanSignalViewer()
Definition cansignalviewer.cpp:6
std::shared_ptr< QWidget > getQConfig() const override
Gets current component configuation.
Definition cansignalviewer.cpp:44
bool mainWidgetDocked() const override
Main widget docking status.
Definition cansignalviewer.cpp:53
void rcvSignal(const QString &name, const QVariant &val, const Direction &dir)
Definition cansignalviewer.cpp:85
void simBcastSnd(const QJsonObject &msg, const QVariant &param=QVariant()) override
QJsonObject getConfig() const override
Gets current component configuation.
Definition cansignalviewer.cpp:39
void mainWidgetDockToggled(QWidget *widget) override
void configChanged() override
Reconfigure component if necessary.
Definition cansignalviewer.cpp:51
ComponentInterface::ComponentProperties getSupportedProperties() const override
Definition cansignalviewer.cpp:58
QWidget * mainWidget() override
Gets components's main widget.
Definition cansignalviewer.cpp:18
~CanSignalViewer()
Definition cansignalviewer.cpp:16
void setConfig(const QJsonObject &json) override
Sets configuration for component.
Definition cansignalviewer.cpp:25
void stopSimulation() override
Definition cansignalviewer.cpp:63
void simBcastRcv(const QJsonObject &msg, const QVariant &param) override
Definition cansignalviewer.cpp:79
Definition cansignalviewer_p.h:12
Direction
The enum class describing frame direction.
Definition datadirection.h:7
Definition cansignalviewerguiint.h:10
Interface to be implemented by every component.
Definition componentinterface.h:15
std::vector< ComponentProperty > ComponentProperties
Definition componentinterface.h:66
Definition context.h:13