ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
nodelistobject.h
Go to the documentation of this file.
1
27
28#ifndef NODELISTOBJECT_H
29#define NODELISTOBJECT_H
30
31#include "entrylistmodel.h"
32
33#include <peak/node_map/peak_node_map.hpp>
34
35#include <QMutex>
36#include <QObject>
37
38class NodeListObject : public QObject
39{
40 Q_OBJECT
41 Q_PROPERTY(QString name READ name NOTIFY nameChanged)
42 Q_PROPERTY(QString displayName READ displayName NOTIFY displayNameChanged)
43 Q_PROPERTY(QString category READ category NOTIFY categoryChanged)
44 Q_PROPERTY(QString type READ type NOTIFY typeChanged)
45 Q_PROPERTY(QString tooltip READ tooltip NOTIFY tooltipChanged)
46 Q_PROPERTY(QString description READ description NOTIFY descriptionChanged)
47 Q_PROPERTY(QString visibility READ visibility NOTIFY visibilityChanged)
49 Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged)
50 Q_PROPERTY(QVariant min READ min NOTIFY minChanged)
51 Q_PROPERTY(QVariant max READ max NOTIFY maxChanged)
52 Q_PROPERTY(QVariant inc READ inc NOTIFY incChanged)
53 Q_PROPERTY(QString unit READ unit NOTIFY unitChanged)
54 Q_PROPERTY(bool available READ available NOTIFY availableChanged)
55 Q_PROPERTY(bool readable READ readable NOTIFY readableChanged)
56 Q_PROPERTY(bool writeable READ writeable NOTIFY writeableChanged)
57 Q_PROPERTY(QString accessStatus READ accessStatus NOTIFY accessStatusChanged)
58
59public:
60 explicit NodeListObject(std::shared_ptr<peak::core::nodes::Node> node);
61 bool operator==(const NodeListObject& other);
62 bool operator!=(const NodeListObject& other);
63
64 std::shared_ptr<peak::core::nodes::Node> node() const;
65 QString name() const;
66 QString displayName() const;
67 QString category() const;
68 QString type() const;
69 QString tooltip() const;
70 QString description() const;
71 QString visibility() const;
73 QVariant value() const;
74 QVariant min() const;
75 QVariant max() const;
76 QVariant inc() const;
77 QString unit() const;
78 bool available() const;
79 bool readable() const;
80 bool writeable() const;
81 QString accessStatus() const;
82
83 void setCategory(QString categoryName);
84 void setValue(const QVariant& newValue);
85 void setValueToMin();
86 void setValueToMax();
87
88 QVector<int> updateAll();
89 QVector<int> updateChangeables();
90
91 bool updateName();
92 bool updateDisplayName();
93 static bool updateCategory();
94 bool updateType();
95 bool updateTooltip();
96 bool updateDescription();
97 bool updateVisibility();
99 bool updateValue();
100 bool updateMin();
101 bool updateMax();
102 bool updateInc();
103 bool updateUnit();
104 bool updateAccessStatus();
105
106public slots:
107 void execute();
108
109signals:
127
128
129private:
130 std::shared_ptr<peak::core::nodes::Node> m_node;
131 QString m_name = "";
132 QString m_displayName = "";
133 QString m_category = "";
134 QString m_type = "";
135 QString m_tooltip = "";
136 QString m_description = "";
137 QString m_visibility = "";
138 std::shared_ptr<EntryListModel> m_entryListModel = nullptr;
139 QVariant m_value = 0;
140 QVariant m_min = 0;
141 QVariant m_max = 0;
142 QVariant m_inc = 0;
143 QString m_unit = "";
144 bool m_available = false;
145 bool m_readable = false;
146 bool m_writeable = false;
147 QString m_accessStatus = "NotAvailable";
148
149 mutable QMutex mutex;
150 mutable QMutex valueMutex;
151 mutable QMutex accessMutex;
152};
153
154
155#endif // NODELISTOBJECT_H
Definition entrylistmodel.h:42
QString m_displayName
Definition nodelistobject.h:132
void accessStatusChanged()
QString m_name
Definition nodelistobject.h:131
EntryListModel * entryListModel
Definition nodelistobject.h:48
void descriptionChanged()
bool m_available
Definition nodelistobject.h:144
bool updateName()
Definition nodelistobject.cpp:264
NodeListObject(std::shared_ptr< peak::core::nodes::Node > node)
Definition nodelistobject.cpp:38
QVariant value
Definition nodelistobject.h:49
static bool updateCategory()
Definition nodelistobject.cpp:302
void entryListModelChanged()
QString m_visibility
Definition nodelistobject.h:137
QString m_description
Definition nodelistobject.h:136
QVariant max
Definition nodelistobject.h:51
QVariant inc
Definition nodelistobject.h:52
bool updateTooltip()
Definition nodelistobject.cpp:356
void readableChanged()
QString visibility
Definition nodelistobject.h:47
QMutex accessMutex
Definition nodelistobject.h:151
bool updateDescription()
Definition nodelistobject.cpp:375
QString unit
Definition nodelistobject.h:53
void visibilityChanged()
QString m_type
Definition nodelistobject.h:134
bool updateVisibility()
Definition nodelistobject.cpp:394
bool updateInc()
Definition nodelistobject.cpp:610
QString tooltip
Definition nodelistobject.h:45
QString m_unit
Definition nodelistobject.h:143
void setValue(const QVariant &newValue)
Definition nodelistobject.cpp:806
QMutex mutex
Definition nodelistobject.h:149
void valueChanged()
void nameChanged()
bool updateDisplayName()
Definition nodelistobject.cpp:283
void setValueToMin()
Definition nodelistobject.cpp:868
QString m_accessStatus
Definition nodelistobject.h:147
QVector< int > updateChangeables()
Definition nodelistobject.cpp:123
QString description
Definition nodelistobject.h:46
void setCategory(QString categoryName)
Definition nodelistobject.cpp:155
QVariant m_min
Definition nodelistobject.h:140
bool updateMin()
Definition nodelistobject.cpp:524
void writeableChanged()
void displayNameChanged()
bool updateType()
Definition nodelistobject.cpp:307
bool updateUnit()
Definition nodelistobject.cpp:661
QVector< int > updateAll()
Definition nodelistobject.cpp:59
void tooltipChanged()
bool readable
Definition nodelistobject.h:55
bool m_readable
Definition nodelistobject.h:145
std::shared_ptr< EntryListModel > m_entryListModel
Definition nodelistobject.h:138
QVariant min
Definition nodelistobject.h:50
void categoryChanged()
QVariant m_inc
Definition nodelistobject.h:142
QMutex valueMutex
Definition nodelistobject.h:150
bool writeable
Definition nodelistobject.h:56
void availableChanged()
QString type
Definition nodelistobject.h:44
QString name
Definition nodelistobject.h:41
std::shared_ptr< peak::core::nodes::Node > m_node
Definition nodelistobject.h:130
QString m_tooltip
Definition nodelistobject.h:135
void unitChanged()
void setValueToMax()
Definition nodelistobject.cpp:874
QString category
Definition nodelistobject.h:43
QString accessStatus
Definition nodelistobject.h:57
bool updateMax()
Definition nodelistobject.cpp:567
bool updateValue()
Definition nodelistobject.cpp:469
bool updateEntryListModel()
Definition nodelistobject.cpp:430
void typeChanged()
bool m_writeable
Definition nodelistobject.h:146
QString m_category
Definition nodelistobject.h:133
std::shared_ptr< peak::core::nodes::Node > node() const
Definition nodelistobject.cpp:880
bool updateAccessStatus()
Definition nodelistobject.cpp:702
QString displayName
Definition nodelistobject.h:42
QVariant m_max
Definition nodelistobject.h:141
QVariant m_value
Definition nodelistobject.h:139
bool available
Definition nodelistobject.h:54
void execute()
Definition nodelistobject.cpp:786
The EntryListModel is a prototype for camera property nodes of type "Enumeration" to hold the differe...