CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
cansignaldata.h
Go to the documentation of this file.
1#ifndef CANSIGNALDATA_H
2#define CANSIGNALDATA_H
3
4#include <QtCore/QObject>
5#include <QtCore/QScopedPointer>
6#include <cantypes.hpp>
8#include <context.h>
9#include <memory>
10
12class QWidget;
15
16Q_DECLARE_METATYPE(CANmessages_t);
17
18class CanSignalData : public QObject, public ComponentInterface {
19 Q_OBJECT
20 Q_DECLARE_PRIVATE(CanSignalData)
21
22public:
24 explicit CanSignalData(CanSignalDataCtx&& ctx);
26
27 QWidget* mainWidget() override;
28 void setConfig(const QJsonObject& json) override;
29 void setConfig(const QWidget& qobject) override;
30 QJsonObject getConfig() const override;
31 std::shared_ptr<QWidget> getQConfig() const override;
32 void configChanged() override;
33 bool mainWidgetDocked() const override;
35
36signals:
37 void mainWidgetDockToggled(QWidget* widget) override;
38 void simBcastSnd(const QJsonObject &msg, const QVariant &param = QVariant()) override;
39
40public slots:
41 void stopSimulation() override;
42 void startSimulation() override;
43 void simBcastRcv(const QJsonObject &msg, const QVariant &param) override;
44
45private:
46 QScopedPointer<CanSignalDataPrivate> d_ptr;
47};
48
49#endif // CANSIGNALDATA_H
Context< CanSignalDataGuiInt > CanSignalDataCtx
Definition cansignaldata.h:14
Q_DECLARE_METATYPE(CANmessages_t)
Definition cansignaldata.h:18
ComponentInterface::ComponentProperties getSupportedProperties() const override
Definition cansignaldata.cpp:64
QJsonObject getConfig() const override
Gets current component configuation.
Definition cansignaldata.cpp:38
std::shared_ptr< QWidget > getQConfig() const override
Gets current component configuation.
Definition cansignaldata.cpp:43
void simBcastSnd(const QJsonObject &msg, const QVariant &param=QVariant()) override
void simBcastRcv(const QJsonObject &msg, const QVariant &param) override
Definition cansignaldata.cpp:83
CanSignalData()
Definition cansignaldata.cpp:7
void mainWidgetDockToggled(QWidget *widget) override
void configChanged() override
Reconfigure component if necessary.
Definition cansignaldata.cpp:50
void setConfig(const QJsonObject &json) override
Sets configuration for component.
Definition cansignaldata.cpp:26
QWidget * mainWidget() override
Gets components's main widget.
Definition cansignaldata.cpp:19
void stopSimulation() override
Definition cansignaldata.cpp:69
bool mainWidgetDocked() const override
Main widget docking status.
Definition cansignaldata.cpp:59
void startSimulation() override
Definition cansignaldata.cpp:76
~CanSignalData()
Definition cansignaldata.cpp:17
Definition cansignaldata_p.h:14
Definition cansignaldataguiint.h:11
Interface to be implemented by every component.
Definition componentinterface.h:15
std::vector< ComponentProperty > ComponentProperties
Definition componentinterface.h:66
Definition context.h:13