CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
cansignalviewer_p.h
Go to the documentation of this file.
1#ifndef CANSIGNALVIEWER_P_H
2#define CANSIGNALVIEWER_P_H
3
4#include "cansignalviewer.h"
6#include <QElapsedTimer>
7#include <memory>
8#include <sortmodel.h>
9
10class CanSignalViewer;
11
12class CanSignalViewerPrivate : public QObject {
13 Q_OBJECT
14 Q_DECLARE_PUBLIC(CanSignalViewer)
15
16public:
20 QJsonObject getSettings();
21 void setSettings(const QJsonObject& json);
22 void addSignal(const QString& name, const QVariant& val, const Direction& dir);
23
24private:
25 void initProps();
26
27public:
28 bool _simStarted{ false };
31 bool _docked{ true };
32 std::map<QString, QVariant> _props;
33 QStringList _columnsOrder;
34 QStandardItemModel _tvModel;
35 QStandardItemModel _tvModelUnique;
38
39private slots:
40 void clear();
41 void sort(const int clickedIndex);
42 void setFilter(bool enabled);
43
44private:
45 int _rowID{ 0 };
46 int _prevIndex{ 0 };
47 int _sortIndex{ 0 };
48 Qt::SortOrder _currentSortOrder{ Qt::AscendingOrder };
49 std::map<QString,
50 std::tuple<QStandardItem*, QStandardItem*, QStandardItem*, QStandardItem*, QStandardItem*, QStandardItem*>>
51 _uniqueTxMap;
52 std::map<QString,
53 std::tuple<QStandardItem*, QStandardItem*, QStandardItem*, QStandardItem*, QStandardItem*, QStandardItem*>>
54 _uniqueRxMap;
55 QElapsedTimer _timer;
56
57 CanSignalViewer* q_ptr;
58 const QString _nameProperty = "name";
59
60 // workaround for clang 3.5
62
63 // clang-format off
65 std::make_tuple(_nameProperty, QVariant::String, true, cf(nullptr))
66 };
67 // clang-format on
68};
69
70#endif // CANSIGNALVIEWER_P_H
Context< CanSignalViewerGuiInt > CanSignalViewerCtx
Definition cansignalviewer.h:13
Definition cansignalviewer.h:16
Definition cansignalviewer_p.h:12
bool _simStarted
Definition cansignalviewer_p.h:28
QStandardItemModel _tvModel
Definition cansignalviewer_p.h:34
CanSignalViewerCtx _ctx
Definition cansignalviewer_p.h:29
SortModel _tvModelUniqueSort
Definition cansignalviewer_p.h:37
bool _docked
Definition cansignalviewer_p.h:31
CanSignalViewerGuiInt & _ui
Definition cansignalviewer_p.h:30
void addSignal(const QString &name, const QVariant &val, const Direction &dir)
Definition cansignalviewer_p.cpp:124
SortModel _tvModelSort
Definition cansignalviewer_p.h:36
QStringList _columnsOrder
Definition cansignalviewer_p.h:33
QStandardItemModel _tvModelUnique
Definition cansignalviewer_p.h:35
void setSettings(const QJsonObject &json)
Definition cansignalviewer_p.cpp:72
QJsonObject getSettings()
Definition cansignalviewer_p.cpp:61
std::map< QString, QVariant > _props
Definition cansignalviewer_p.h:32
ComponentInterface::ComponentProperties getSupportedProperties() const
Definition cansignalviewer_p.cpp:56
Definition sortmodel.h:6
Direction
The enum class describing frame direction.
Definition datadirection.h:7
Definition cansignalviewerguiimpl.h:12
Definition cansignalviewerguiint.h:10
std::vector< ComponentProperty > ComponentProperties
Definition componentinterface.h:66
std::function< QWidget *(void)> CustomEditFieldCbk
Definition componentinterface.h:64