CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
cansignaldata_p.h
Go to the documentation of this file.
1#ifndef CANSIGNALDATA_P_H
2#define CANSIGNALDATA_P_H
3
4#include "cansignaldata.h"
6#include "searchmodel.h"
7#include <QStandardItemModel>
8#include <QtCore/QObject>
9#include <memory>
10#include <propertyfields.h>
11
12class CanSignalData;
13
14class CanSignalDataPrivate : public QObject {
15 Q_OBJECT
16 Q_DECLARE_PUBLIC(CanSignalData)
17
18public:
21 QJsonObject getSettings();
22 void setSettings(const QJsonObject& json);
23 void loadDbc(const std::string& filename);
24 std::pair<CANmessage, std::vector<CANsignal>>* findInDb(uint32_t id);
25 void sendCANdbUpdated();
26
27private:
28 void initProps();
29 std::string loadFile(const std::string& filename);
30 using msgSettings_t = std::map<uint32_t, std::pair<QString, QString>>;
31 msgSettings_t getMsgSettings();
32 void setMsgSettings(const msgSettings_t& msgSettings);
33
34public:
35 bool _simStarted{ false };
38 bool _docked{ true };
39 bool _msgView{ true };
40 std::map<QString, QVariant> _props;
41 QStringList _columnsSig;
42 QStringList _columnsMsg;
43 QStandardItemModel _tvModelSig;
45 QStandardItemModel _tvModelMsg;
47 CANmessages_t _messages;
48
49private:
50 CanSignalData* q_ptr;
51 const QString _fileProperty = "file";
52 const QString _nameProperty = "name";
53 const QString _colorProperty = "color";
54 // workaround for clang 3.5
56
57 // clang-format off
59 std::make_tuple(_nameProperty, QVariant::String, true, cf(nullptr)),
60 std::make_tuple(_fileProperty, QVariant::String, true, cf([] { return new PropertyFieldPath; } )),
61 std::make_tuple(_colorProperty, QVariant::String, true, cf([] { return new PropertyFieldColor; } ))
62 };
63 // clang-format on
64
65 std::string _currentDbcFile;
66 msgSettings_t _msgSettings;
67};
68
69#endif // CANSIGNALDATA_P_H
Context< CanSignalDataGuiInt > CanSignalDataCtx
Definition cansignaldata.h:14
Definition cansignaldata.h:18
Definition cansignaldata_p.h:14
SearchModel _tvModelSigFilter
Definition cansignaldata_p.h:44
QStandardItemModel _tvModelSig
Definition cansignaldata_p.h:43
void loadDbc(const std::string &filename)
Definition cansignaldata_p.cpp:216
SearchModel _tvModelMsgFilter
Definition cansignaldata_p.h:46
CanSignalDataCtx _ctx
Definition cansignaldata_p.h:36
bool _docked
Definition cansignaldata_p.h:38
void setSettings(const QJsonObject &json)
Definition cansignaldata_p.cpp:152
std::pair< CANmessage, std::vector< CANsignal > > * findInDb(uint32_t id)
Definition cansignaldata_p.cpp:302
std::map< QString, QVariant > _props
Definition cansignaldata_p.h:40
QStandardItemModel _tvModelMsg
Definition cansignaldata_p.h:45
void sendCANdbUpdated()
Definition cansignaldata_p.cpp:314
CanSignalDataGuiInt & _ui
Definition cansignaldata_p.h:37
CANmessages_t _messages
Definition cansignaldata_p.h:47
QStringList _columnsMsg
Definition cansignaldata_p.h:42
ComponentInterface::ComponentProperties getSupportedProperties() const
Definition cansignaldata_p.cpp:77
bool _msgView
Definition cansignaldata_p.h:39
bool _simStarted
Definition cansignaldata_p.h:35
QStringList _columnsSig
Definition cansignaldata_p.h:41
QJsonObject getSettings()
Definition cansignaldata_p.cpp:128
Definition searchmodel.h:6
Definition cansignaldataguiimpl.h:56
Definition cansignaldataguiint.h:11
std::vector< ComponentProperty > ComponentProperties
Definition componentinterface.h:66
std::function< QWidget *(void)> CustomEditFieldCbk
Definition componentinterface.h:64
Definition propertyfields.h:141
Definition propertyfields.h:49