CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
canload.h
Go to the documentation of this file.
1#ifndef CANLOAD_H
2#define CANLOAD_H
3
4#include <QWidget>
5#include <QtCore/QScopedPointer>
7#include <context.h>
8#include <memory>
9
10class CanLoadPrivate;
11class QWidget;
12class QCanBusFrame;
14
15class CanLoad : public QObject, public ComponentInterface {
16 Q_OBJECT
17 Q_DECLARE_PRIVATE(CanLoad)
18
19public:
20 CanLoad();
21 explicit CanLoad(CanLoadCtx&& ctx);
22 ~CanLoad();
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 currentLoad(uint8_t load);
36 void simBcastSnd(const QJsonObject &msg, const QVariant &param = QVariant()) override;
37
38public slots:
39 void stopSimulation() override;
40 void startSimulation() override;
41 void frameIn(const QCanBusFrame& frame);
42 void simBcastRcv(const QJsonObject &msg, const QVariant &param) override;
43
44private:
45 QScopedPointer<CanLoadPrivate> d_ptr;
46};
47
48#endif //CANLOAD_H
Context CanLoadCtx
Definition canload.h:13
Definition canload.h:15
QWidget * mainWidget() override
Gets components's main widget.
Definition canload.cpp:21
void simBcastRcv(const QJsonObject &msg, const QVariant &param) override
Definition canload.cpp:104
CanLoad()
Definition canload.cpp:7
~CanLoad()
Definition canload.cpp:17
bool mainWidgetDocked() const override
Main widget docking status.
Definition canload.cpp:60
void configChanged() override
Reconfigure component if necessary.
Definition canload.cpp:56
void currentLoad(uint8_t load)
ComponentInterface::ComponentProperties getSupportedProperties() const override
Definition canload.cpp:66
void simBcastSnd(const QJsonObject &msg, const QVariant &param=QVariant()) override
void stopSimulation() override
Definition canload.cpp:71
void setConfig(const QJsonObject &json) override
Sets configuration for component.
Definition canload.cpp:27
void mainWidgetDockToggled(QWidget *widget) override
QJsonObject getConfig() const override
Gets current component configuation.
Definition canload.cpp:44
std::shared_ptr< QWidget > getQConfig() const override
Gets current component configuation.
Definition canload.cpp:49
void frameIn(const QCanBusFrame &frame)
Definition canload.cpp:95
void startSimulation() override
Definition canload.cpp:82
Definition canload_p.h:12
Interface to be implemented by every component.
Definition componentinterface.h:15
std::vector< ComponentProperty > ComponentProperties
Definition componentinterface.h:66
Definition context.h:13