CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
canload_p.h
Go to the documentation of this file.
1#ifndef CANLOAD_P_H
2#define CANLOAD_P_H
3
4#include "canload.h"
5#include <QObject>
6#include <QTimer>
7#include <memory>
8#include <propertyfields.h>
9
10class CanLoad;
11
12class CanLoadPrivate : public QObject {
13 Q_OBJECT
14 Q_DECLARE_PUBLIC(CanLoad)
15
16public:
19 QJsonObject getSettings();
20 void setSettings(const QJsonObject& json);
21
22private:
23 void initProps();
24
25public:
26 bool _simStarted{ false };
28 std::map<QString, QVariant> _props;
29 const QString _nameProperty = "name";
30 const QString _periodProperty = "period [ms]";
31 const QString _bitrateProperty = "bitrate [bps]";
32 uint32_t _period = 0;
33 uint32_t _bitrate = 0;
34 uint32_t _div = 0;
35 uint64_t _totalBits = 0;
36 QTimer _timer;
37
38private:
39 CanLoad* q_ptr;
40
41 // workaround for clang 3.5
43
44 // clang-format off
46 std::make_tuple(_nameProperty, QVariant::String, true, cf(nullptr)),
47 std::make_tuple(_bitrateProperty, QVariant::String, true, cf([] { return new PropertyFieldText(true); } )),
48 std::make_tuple(_periodProperty, QVariant::String, true, cf([] { return new PropertyFieldText(true); } ))
49 };
50 // clang-format on
51};
52
53#endif // CANLOAD_P_H
Context CanLoadCtx
Definition canload.h:13
Definition canload.h:15
Definition canload_p.h:12
uint32_t _div
Definition canload_p.h:34
uint32_t _period
Definition canload_p.h:32
uint64_t _totalBits
Definition canload_p.h:35
bool _simStarted
Definition canload_p.h:26
uint32_t _bitrate
Definition canload_p.h:33
void setSettings(const QJsonObject &json)
Definition canload_p.cpp:49
QJsonObject getSettings()
Definition canload_p.cpp:38
ComponentInterface::ComponentProperties getSupportedProperties() const
Definition canload_p.cpp:33
CanLoadCtx _ctx
Definition canload_p.h:27
const QString _periodProperty
Definition canload_p.h:30
const QString _nameProperty
Definition canload_p.h:29
const QString _bitrateProperty
Definition canload_p.h:31
QTimer _timer
Definition canload_p.h:36
std::map< QString, QVariant > _props
Definition canload_p.h:28
std::vector< ComponentProperty > ComponentProperties
Definition componentinterface.h:66
std::function< QWidget *(void)> CustomEditFieldCbk
Definition componentinterface.h:64
Definition context.h:13
Definition propertyfields.h:17