1 | // Copyright (C) 2019 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef OPCUAWRITEITEM_P_H |
5 | #define OPCUAWRITEITEM_P_H |
6 | |
7 | #include <private/opcuastatus_p.h> |
8 | |
9 | #include <QObject> |
10 | #include <QDateTime> |
11 | #include <QtCore/qshareddata.h> |
12 | |
13 | #include <QtOpcUa/qopcuatype.h> |
14 | |
15 | #include <QtQml/qqml.h> |
16 | |
17 | // |
18 | // W A R N I N G |
19 | // ------------- |
20 | // |
21 | // This file is not part of the Qt API. It exists purely as an |
22 | // implementation detail. This header file may change from version to |
23 | // version without notice, or even be removed. |
24 | // |
25 | // We mean it. |
26 | // |
27 | |
28 | QT_BEGIN_NAMESPACE |
29 | |
30 | class OpcUaWriteItemData; |
31 | class OpcUaWriteItem |
32 | { |
33 | Q_GADGET |
34 | Q_PROPERTY(QString nodeId READ nodeId WRITE setNodeId) |
35 | Q_PROPERTY(QVariant ns READ namespaceIdentifier WRITE setNamespaceIdentifier) |
36 | Q_PROPERTY(QOpcUa::NodeAttribute attribute READ attribute WRITE setAttribute) |
37 | Q_PROPERTY(QString indexRange READ indexRange WRITE setIndexRange) |
38 | Q_PROPERTY(QVariant value READ value WRITE setValue) |
39 | Q_PROPERTY(QOpcUa::Types valueType READ valueType WRITE setValueType) |
40 | Q_PROPERTY(QDateTime sourceTimestamp READ sourceTimestamp WRITE setSourceTimestamp) |
41 | Q_PROPERTY(QDateTime serverTimestamp READ serverTimestamp WRITE setServerTimestamp) |
42 | Q_PROPERTY(OpcUaStatus::Status statusCode READ statusCode WRITE setStatusCode) |
43 | |
44 | public: |
45 | OpcUaWriteItem(); |
46 | OpcUaWriteItem(const OpcUaWriteItem &other); |
47 | OpcUaWriteItem &operator=(const OpcUaWriteItem &rhs); |
48 | ~OpcUaWriteItem(); |
49 | |
50 | const QString &nodeId() const; |
51 | void setNodeId(const QString &nodeId); |
52 | |
53 | const QVariant &namespaceIdentifier() const; |
54 | void setNamespaceIdentifier(const QVariant &namespaceIdentifier); |
55 | |
56 | QOpcUa::NodeAttribute attribute() const; |
57 | void setAttribute(QOpcUa::NodeAttribute attribute); |
58 | |
59 | const QString &indexRange() const; |
60 | void setIndexRange(const QString &indexRange); |
61 | |
62 | const QVariant &value() const; |
63 | void setValue(const QVariant &value); |
64 | |
65 | QOpcUa::Types valueType() const; |
66 | void setValueType(QOpcUa::Types type); |
67 | |
68 | const QDateTime &sourceTimestamp() const; |
69 | void setSourceTimestamp(const QDateTime &sourceTimestamp); |
70 | |
71 | const QDateTime &serverTimestamp() const; |
72 | void setServerTimestamp(const QDateTime &serverTimestamp); |
73 | |
74 | OpcUaStatus::Status statusCode() const; |
75 | bool hasStatusCode() const; |
76 | void setStatusCode(OpcUaStatus::Status statusCode); |
77 | |
78 | private: |
79 | QSharedDataPointer<OpcUaWriteItemData> data; |
80 | }; |
81 | |
82 | class OpcUaWriteItemFactory : public QObject |
83 | { |
84 | Q_OBJECT |
85 | QML_NAMED_ELEMENT(WriteItem) |
86 | QML_SINGLETON |
87 | QML_ADDED_IN_VERSION(5, 13) |
88 | |
89 | public: |
90 | Q_INVOKABLE OpcUaWriteItem create(); |
91 | }; |
92 | |
93 | QT_END_NAMESPACE |
94 | |
95 | #endif // OPCUAWRITEITEM_P_H |
96 |