1 | // Copyright (C) 2019 basysKom GmbH, opensource@basyskom.com |
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 QOPCUANODEIMPL_P_H |
5 | #define QOPCUANODEIMPL_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <QtOpcUa/qopcuaglobal.h> |
19 | #include <QtOpcUa/qopcuabrowsepathtarget.h> |
20 | #include <QtOpcUa/qopcuamonitoringparameters.h> |
21 | #include <QtOpcUa/qopcuanode.h> |
22 | #include <QtOpcUa/qopcuareaditem.h> |
23 | #include <QtOpcUa/qopcuareadresult.h> |
24 | #include <QtOpcUa/qopcuarelativepathelement.h> |
25 | #include <QtOpcUa/qopcuatype.h> |
26 | #include <QtOpcUa/qopcuahistoryreadrawrequest.h> |
27 | |
28 | #include <QtCore/qvariant.h> |
29 | #include <QtCore/private/qglobal_p.h> |
30 | |
31 | QT_BEGIN_NAMESPACE |
32 | |
33 | class Q_OPCUA_EXPORT QOpcUaNodeImpl : public QObject |
34 | { |
35 | Q_OBJECT |
36 | public: |
37 | QOpcUaNodeImpl(); |
38 | virtual ~QOpcUaNodeImpl(); |
39 | |
40 | virtual bool readAttributes(QOpcUa::NodeAttributes attr, const QString &indexRange) = 0; |
41 | virtual bool enableMonitoring(QOpcUa::NodeAttributes attr, const QOpcUaMonitoringParameters &settings) = 0; |
42 | virtual bool disableMonitoring(QOpcUa::NodeAttributes attr) = 0; |
43 | virtual bool browse(const QOpcUaBrowseRequest &request) = 0; |
44 | virtual QString nodeId() const = 0; |
45 | |
46 | virtual bool writeAttribute(QOpcUa::NodeAttribute attribute, const QVariant &value, QOpcUa::Types type, const QString &indexRange) = 0; |
47 | virtual bool writeAttributes(const QOpcUaNode::AttributeMap &toWrite, QOpcUa::Types valueAttributeType) = 0; |
48 | virtual bool modifyMonitoring(QOpcUa::NodeAttribute attr, QOpcUaMonitoringParameters::Parameter item, |
49 | const QVariant &value) = 0; |
50 | |
51 | virtual bool callMethod(const QString &methodNodeId, const QList<QOpcUa::TypedVariant> &args) = 0; |
52 | virtual QOpcUaHistoryReadResponse *readHistoryRaw(const QDateTime &startTime, const QDateTime &endTime, quint32 numValues, bool returnBounds) = 0; |
53 | |
54 | virtual bool resolveBrowsePath(const QList<QOpcUaRelativePathElement> &path) = 0; |
55 | |
56 | quint64 handle() const; |
57 | void setHandle(quint64 handle); |
58 | |
59 | bool registered() const; |
60 | void setRegistered(bool registered); |
61 | |
62 | Q_SIGNALS: |
63 | void attributesRead(QList<QOpcUaReadResult> attr, QOpcUa::UaStatusCode serviceResult); |
64 | void attributeWritten(QOpcUa::NodeAttribute attr, QVariant value, QOpcUa::UaStatusCode statusCode); |
65 | void browseFinished(QList<QOpcUaReferenceDescription> children, QOpcUa::UaStatusCode statusCode); |
66 | |
67 | void dataChangeOccurred(QOpcUa::NodeAttribute attr, QOpcUaReadResult value); |
68 | void eventOccurred(QVariantList eventFields); |
69 | void monitoringEnableDisable(QOpcUa::NodeAttribute attr, bool subscribe, QOpcUaMonitoringParameters status); |
70 | void monitoringStatusChanged(QOpcUa::NodeAttribute attr, QOpcUaMonitoringParameters::Parameters items, |
71 | QOpcUaMonitoringParameters param); |
72 | void methodCallFinished(QString methodNodeId, QVariant result, QOpcUa::UaStatusCode statusCode); |
73 | void resolveBrowsePathFinished(QList<QOpcUaBrowsePathTarget> targets, |
74 | QList<QOpcUaRelativePathElement> path, QOpcUa::UaStatusCode status); |
75 | void readHistoryRawFinished(QList<QOpcUaHistoryData> results, QOpcUa::UaStatusCode serviceResult); |
76 | |
77 | private: |
78 | quint64 m_handle; |
79 | bool m_registered; |
80 | }; |
81 | |
82 | QT_END_NAMESPACE |
83 | |
84 | #endif // QOPCUANODEIMPL_P_H |
85 | |