CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
canrawlogger_p.h
Go to the documentation of this file.
1#ifndef CANRAWLOGGER_P_H
2#define CANRAWLOGGER_P_H
3
4#include "canrawlogger.h"
5#include <QElapsedTimer>
6#include <QFile>
7#include <QtCore/QObject>
8#include <memory>
9#include <propertyfields.h>
10
11class CanRawLogger;
12
13class CanRawLoggerPrivate : public QObject {
14 Q_OBJECT
15 Q_DECLARE_PUBLIC(CanRawLogger)
16
17public:
20 QJsonObject getSettings();
21 void setSettings(const QJsonObject& json);
22 void logFrame(const QCanBusFrame& frame, const QString& dir);
23
24private:
25 void initProps();
26
27public:
28 bool _simStarted{ false };
30 std::map<QString, QVariant> _props;
31 QString _filename;
32 QFile _file;
33 QElapsedTimer _timer;
34
35private:
36 CanRawLogger* q_ptr;
37 const QString _nameProperty = "name";
38 const QString _dirProperty = "directory";
39
40 // workaround for clang 3.5
42
43 // clang-format off
45 std::make_tuple(_nameProperty, QVariant::String, true, cf(nullptr)),
46 std::make_tuple(_dirProperty, QVariant::String, true, cf([] { return new PropertyFieldPath(true); } ))
47 };
48 // clang-format on
49};
50
51#endif // CANRAWLOGGER_P_H
Context CanRawLoggerCtx
Definition canrawlogger.h:13
Definition canrawlogger.h:15
Definition canrawlogger_p.h:13
void setSettings(const QJsonObject &json)
Definition canrawlogger_p.cpp:37
ComponentInterface::ComponentProperties getSupportedProperties() const
Definition canrawlogger_p.cpp:21
CanRawLoggerCtx _ctx
Definition canrawlogger_p.h:29
bool _simStarted
Definition canrawlogger_p.h:28
QFile _file
Definition canrawlogger_p.h:32
std::map< QString, QVariant > _props
Definition canrawlogger_p.h:30
QJsonObject getSettings()
Definition canrawlogger_p.cpp:26
void logFrame(const QCanBusFrame &frame, const QString &dir)
Definition canrawlogger_p.cpp:46
QString _filename
Definition canrawlogger_p.h:31
QElapsedTimer _timer
Definition canrawlogger_p.h:33
std::vector< ComponentProperty > ComponentProperties
Definition componentinterface.h:66
std::function< QWidget *(void)> CustomEditFieldCbk
Definition componentinterface.h:64
Definition context.h:13
Definition propertyfields.h:49