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
31QT_BEGIN_NAMESPACE
32
33class Q_OPCUA_EXPORT QOpcUaNodeImpl : public QObject
34{
35 Q_OBJECT
36public:
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,
53 QOpcUa::TimestampsToReturn timestampsToReturn) = 0;
54 virtual QOpcUaHistoryReadResponse *readHistoryEvents(const QDateTime &startTime, const QDateTime &endTime,
55 const QOpcUaMonitoringParameters::EventFilter &filter, quint32 numValues) = 0;
56
57 virtual bool resolveBrowsePath(const QList<QOpcUaRelativePathElement> &path) = 0;
58
59 quint64 handle() const;
60 void setHandle(quint64 handle);
61
62 bool registered() const;
63 void setRegistered(bool registered);
64
65Q_SIGNALS:
66 void attributesRead(QList<QOpcUaReadResult> attr, QOpcUa::UaStatusCode serviceResult);
67 void attributeWritten(QOpcUa::NodeAttribute attr, QVariant value, QOpcUa::UaStatusCode statusCode);
68 void browseFinished(QList<QOpcUaReferenceDescription> children, QOpcUa::UaStatusCode statusCode);
69
70 void dataChangeOccurred(QOpcUa::NodeAttribute attr, QOpcUaReadResult value);
71 void eventOccurred(QVariantList eventFields);
72 void monitoringEnableDisable(QOpcUa::NodeAttribute attr, bool subscribe, QOpcUaMonitoringParameters status);
73 void monitoringStatusChanged(QOpcUa::NodeAttribute attr, QOpcUaMonitoringParameters::Parameters items,
74 QOpcUaMonitoringParameters param);
75 void methodCallFinished(QString methodNodeId, QVariant result, QOpcUa::UaStatusCode statusCode);
76 void resolveBrowsePathFinished(QList<QOpcUaBrowsePathTarget> targets,
77 QList<QOpcUaRelativePathElement> path, QOpcUa::UaStatusCode status);
78 void readHistoryRawFinished(QList<QOpcUaHistoryData> results, QOpcUa::UaStatusCode serviceResult);
79
80private:
81 quint64 m_handle;
82 bool m_registered;
83};
84
85QT_END_NAMESPACE
86
87#endif // QOPCUANODEIMPL_P_H
88

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of qtopcua/src/opcua/client/qopcuanodeimpl_p.h