summaryrefslogtreecommitdiffstats
path: root/src/opcua/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/opcua/client')
-rw-r--r--src/opcua/client/client.pri23
-rw-r--r--src/opcua/client/qopcuabackend_p.h6
-rw-r--r--src/opcua/client/qopcuaclient.cpp17
-rw-r--r--src/opcua/client/qopcuaclient.h3
-rw-r--r--src/opcua/client/qopcuaclient_p.h1
-rw-r--r--src/opcua/client/qopcuaclientimpl.cpp25
-rw-r--r--src/opcua/client/qopcuaclientimpl_p.h8
-rw-r--r--src/opcua/client/qopcuamonitoredevent.cpp91
-rw-r--r--src/opcua/client/qopcuamonitoredevent.h72
-rw-r--r--src/opcua/client/qopcuamonitoredevent_p.h78
-rw-r--r--src/opcua/client/qopcuamonitoredeventprivate.cpp62
-rw-r--r--src/opcua/client/qopcuamonitoredvalue.cpp86
-rw-r--r--src/opcua/client/qopcuamonitoredvalue.h70
-rw-r--r--src/opcua/client/qopcuamonitoredvalue_p.h78
-rw-r--r--src/opcua/client/qopcuamonitoredvalueprivate.cpp64
-rw-r--r--src/opcua/client/qopcuamonitoringparameters.cpp390
-rw-r--r--src/opcua/client/qopcuamonitoringparameters.h165
-rw-r--r--src/opcua/client/qopcuamonitoringparameters_p.h (renamed from src/opcua/client/qopcuasubscription_p.h)56
-rw-r--r--src/opcua/client/qopcuanode.cpp115
-rw-r--r--src/opcua/client/qopcuanode.h14
-rw-r--r--src/opcua/client/qopcuanode_p.h59
-rw-r--r--src/opcua/client/qopcuanodeimpl_p.h12
-rw-r--r--src/opcua/client/qopcuasubscription.cpp107
-rw-r--r--src/opcua/client/qopcuasubscription.h71
-rw-r--r--src/opcua/client/qopcuasubscriptionimpl.cpp49
-rw-r--r--src/opcua/client/qopcuasubscriptionimpl_p.h73
-rw-r--r--src/opcua/client/qopcuasubscriptionprivate.cpp53
-rw-r--r--src/opcua/client/qopcuavaluesubscription.cpp77
-rw-r--r--src/opcua/client/qopcuavaluesubscription.h67
29 files changed, 824 insertions, 1168 deletions
diff --git a/src/opcua/client/client.pri b/src/opcua/client/client.pri
index c91ffdf..9be8a86 100644
--- a/src/opcua/client/client.pri
+++ b/src/opcua/client/client.pri
@@ -2,35 +2,24 @@
PUBLIC_HEADERS += \
client/qopcuaclient.h \
- client/qopcuasubscription.h \
client/qopcuanode.h \
- client/qopcuatype.h \
- client/qopcuamonitoredevent.h \
- client/qopcuamonitoredvalue.h
+ client/qopcuatype.h
SOURCES += \
client/qopcuaclient.cpp \
- client/qopcuasubscription.cpp \
client/qopcuanode.cpp \
client/qopcuatype.cpp \
- client/qopcuamonitoredevent.cpp \
- client/qopcuamonitoredvalue.cpp \
client/qopcuaclientimpl.cpp \
client/qopcuanodeimpl.cpp \
client/qopcuaclientprivate.cpp \
- client/qopcuamonitoredeventprivate.cpp \
- client/qopcuasubscriptionprivate.cpp \
- client/qopcuamonitoredvalueprivate.cpp \
- client/qopcuasubscriptionimpl.cpp \
- client/qopcuabackend.cpp
+ client/qopcuabackend.cpp \
+ client/qopcuamonitoringparameters.cpp
HEADERS += \
client/qopcuaclient_p.h \
client/qopcuaclientimpl_p.h \
client/qopcuanode_p.h \
client/qopcuanodeimpl_p.h \
- client/qopcuamonitoredevent_p.h \
- client/qopcuamonitoredvalue_p.h \
- client/qopcuasubscription_p.h \
- client/qopcuasubscriptionimpl_p.h \
- client/qopcuabackend_p.h
+ client/qopcuabackend_p.h \
+ client/qopcuamonitoringparameters.h \
+ client/qopcuamonitoringparameters_p.h
diff --git a/src/opcua/client/qopcuabackend_p.h b/src/opcua/client/qopcuabackend_p.h
index da4cf9c..28cbd28 100644
--- a/src/opcua/client/qopcuabackend_p.h
+++ b/src/opcua/client/qopcuabackend_p.h
@@ -58,6 +58,7 @@
QT_BEGIN_NAMESPACE
class QOpcUaNodeImpl;
+class QOpcUaMonitoringParameters;
class Q_OPCUA_EXPORT QOpcUaBackend : public QObject
{
@@ -80,6 +81,11 @@ Q_SIGNALS:
void attributesRead(uintptr_t handle, QVector<QOpcUaReadResult> attributes, QOpcUa::UaStatusCode serviceResult);
void attributeWritten(uintptr_t hande, QOpcUaNode::NodeAttribute attribute, QVariant value, QOpcUa::UaStatusCode statusCode);
+ void attributeUpdated(uintptr_t handle, QOpcUaNode::NodeAttribute attr, QVariant value);
+ void monitoringEnableDisable(uintptr_t handle, QOpcUaNode::NodeAttribute attr, bool subscribe, QOpcUaMonitoringParameters status);
+ void monitoringStatusChanged(uintptr_t handle, QOpcUaNode::NodeAttribute attr, QOpcUaMonitoringParameters::Parameters items,
+ QOpcUaMonitoringParameters param);
+
private:
Q_DISABLE_COPY(QOpcUaBackend)
};
diff --git a/src/opcua/client/qopcuaclient.cpp b/src/opcua/client/qopcuaclient.cpp
index 86fd7f9..4306af7 100644
--- a/src/opcua/client/qopcuaclient.cpp
+++ b/src/opcua/client/qopcuaclient.cpp
@@ -241,21 +241,4 @@ QString QOpcUaClient::backend() const
return d_func()->m_impl->backend();
}
-/*!
- Creates a subscription with \a interval milliseconds publishing period
- on the server and returns a QOpcUaSubscription object for it. The
- subscription may be used to monitor nodes for events or value changes.
- The caller becomes the owner of the newly created subscription object.
-
- For this method to work the client needs to be connected to the server.
- A null pointer is returned on error.
-*/
-QOpcUaSubscription *QOpcUaClient::createSubscription(quint32 interval)
-{
- if (state() != QOpcUaClient::Connected)
- return nullptr;
-
- return d_func()->m_impl->createSubscription(interval);
-}
-
QT_END_NAMESPACE
diff --git a/src/opcua/client/qopcuaclient.h b/src/opcua/client/qopcuaclient.h
index 604c5f4..15c9ee2 100644
--- a/src/opcua/client/qopcuaclient.h
+++ b/src/opcua/client/qopcuaclient.h
@@ -39,7 +39,6 @@
#include <QtOpcUa/qopcuaglobal.h>
#include <QtOpcUa/qopcuanode.h>
-#include <QtOpcUa/qopcuasubscription.h>
#include <QtCore/qobject.h>
#include <QtCore/qurl.h>
@@ -82,8 +81,6 @@ public:
Q_INVOKABLE void disconnectFromEndpoint();
QOpcUaNode *node(const QString &nodeId);
- QOpcUaSubscription *createSubscription(quint32 interval);
-
QUrl url() const;
ClientState state() const;
diff --git a/src/opcua/client/qopcuaclient_p.h b/src/opcua/client/qopcuaclient_p.h
index a5511fd..8e9d447 100644
--- a/src/opcua/client/qopcuaclient_p.h
+++ b/src/opcua/client/qopcuaclient_p.h
@@ -50,7 +50,6 @@
#include <QtOpcUa/qopcuaclient.h>
#include <QtOpcUa/qopcuaglobal.h>
-#include <QtOpcUa/qopcuavaluesubscription.h>
#include <private/qopcuaclientimpl_p.h>
#include <QtCore/qobject.h>
diff --git a/src/opcua/client/qopcuaclientimpl.cpp b/src/opcua/client/qopcuaclientimpl.cpp
index f44a928..e3e414d 100644
--- a/src/opcua/client/qopcuaclientimpl.cpp
+++ b/src/opcua/client/qopcuaclientimpl.cpp
@@ -36,6 +36,7 @@
#include <private/qopcuabackend_p.h>
#include <private/qopcuaclientimpl_p.h>
+#include <QtOpcUa/qopcuamonitoringparameters.h>
QT_BEGIN_NAMESPACE
@@ -61,6 +62,9 @@ void QOpcUaClientImpl::connectBackendWithClient(QOpcUaBackend *backend)
connect(backend, &QOpcUaBackend::attributesRead, this, &QOpcUaClientImpl::handleAttributesRead);
connect(backend, &QOpcUaBackend::stateAndOrErrorChanged, this, &QOpcUaClientImpl::stateAndOrErrorChanged);
connect(backend, &QOpcUaBackend::attributeWritten, this, &QOpcUaClientImpl::handleAttributeWritten);
+ connect(backend, &QOpcUaBackend::attributeUpdated, this, &QOpcUaClientImpl::handleAttributeUpdated);
+ connect(backend, &QOpcUaBackend::monitoringEnableDisable, this, &QOpcUaClientImpl::handleMonitoringEnableDisable);
+ connect(backend, &QOpcUaBackend::monitoringStatusChanged, this, &QOpcUaClientImpl::handleMonitoringStatusChanged);
}
void QOpcUaClientImpl::handleAttributesRead(uintptr_t handle, QVector<QOpcUaReadResult> attr, QOpcUa::UaStatusCode serviceResult)
@@ -77,4 +81,25 @@ void QOpcUaClientImpl::handleAttributeWritten(uintptr_t handle, QOpcUaNode::Node
emit (*it)->attributeWritten(attr, value, statusCode);
}
+void QOpcUaClientImpl::handleAttributeUpdated(uintptr_t handle, QOpcUaNode::NodeAttribute attr, const QVariant &value)
+{
+ auto it = m_handles.constFind(handle);
+ if (it != m_handles.constEnd() && !it->isNull())
+ emit (*it)->attributeUpdated(attr, value);
+}
+
+void QOpcUaClientImpl::handleMonitoringEnableDisable(uintptr_t handle, QOpcUaNode::NodeAttribute attr, bool subscribe, QOpcUaMonitoringParameters status)
+{
+ auto it = m_handles.constFind(handle);
+ if (it != m_handles.constEnd() && !it->isNull())
+ emit (*it)->monitoringEnableDisable(attr, subscribe, status);
+}
+
+void QOpcUaClientImpl::handleMonitoringStatusChanged(uintptr_t handle, QOpcUaNode::NodeAttribute attr, QOpcUaMonitoringParameters::Parameters items, QOpcUaMonitoringParameters param)
+{
+ auto it = m_handles.constFind(handle);
+ if (it != m_handles.constEnd() && !it->isNull())
+ emit (*it)->monitoringStatusChanged(attr, items, param);
+}
+
QT_END_NAMESPACE
diff --git a/src/opcua/client/qopcuaclientimpl_p.h b/src/opcua/client/qopcuaclientimpl_p.h
index 7ddbf95..07d3f9c 100644
--- a/src/opcua/client/qopcuaclientimpl_p.h
+++ b/src/opcua/client/qopcuaclientimpl_p.h
@@ -60,8 +60,8 @@ QT_BEGIN_NAMESPACE
class QOpcUaNode;
class QOpcUaClient;
-class QOpcUaSubscription;
class QOpcUaBackend;
+class QOpcUaMonitoringParameters;
class Q_OPCUA_EXPORT QOpcUaClientImpl : public QObject
{
@@ -83,13 +83,15 @@ public:
void connectBackendWithClient(QOpcUaBackend *backend);
- virtual QOpcUaSubscription *createSubscription(quint32 interval) = 0;
-
QOpcUaClient *m_client;
private Q_SLOTS:
void handleAttributesRead(uintptr_t handle, QVector<QOpcUaReadResult> attr, QOpcUa::UaStatusCode serviceResult);
void handleAttributeWritten(uintptr_t handle, QOpcUaNode::NodeAttribute attr, const QVariant &value, QOpcUa::UaStatusCode statusCode);
+ void handleAttributeUpdated(uintptr_t handle, QOpcUaNode::NodeAttribute attr, const QVariant &value);
+ void handleMonitoringEnableDisable(uintptr_t handle, QOpcUaNode::NodeAttribute attr, bool subscribe, QOpcUaMonitoringParameters status);
+ void handleMonitoringStatusChanged(uintptr_t handle, QOpcUaNode::NodeAttribute attr, QOpcUaMonitoringParameters::Parameters items,
+ QOpcUaMonitoringParameters param);
signals:
void connected();
diff --git a/src/opcua/client/qopcuamonitoredevent.cpp b/src/opcua/client/qopcuamonitoredevent.cpp
deleted file mode 100644
index 40a7399..0000000
--- a/src/opcua/client/qopcuamonitoredevent.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qopcuamonitoredevent.h"
-#include "qopcuasubscription.h"
-#include <private/qopcuamonitoredevent_p.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- * \internal
- */
-QOpcUaMonitoredEvent::QOpcUaMonitoredEvent(QOpcUaNode *node, QOpcUaSubscription *subscription, QObject *parent)
- : QObject(*new QOpcUaMonitoredEventPrivate(node, subscription), parent)
-{}
-
-/*!
- Destroys this event monitor instance. This will automatically
- remove it from its subscription.
- */
-QOpcUaMonitoredEvent::~QOpcUaMonitoredEvent()
-{
- d_func()->m_subscription->removeEvent(this);
-}
-
-/*!
- Returns the node which belongs to this event monitor instance.
-*/
-QOpcUaNode &QOpcUaMonitoredEvent::node()
-{
- return *d_func()->m_node;
-}
-
-/*!
- \class QOpcUaMonitoredEvent
- \inmodule QtOpcUa
-
- \brief Represents a source for events corresponding to a node on a OPC UA server.
-
- \chapter QOpcUaMonitoredEvent
- Every QOpcUaMonitoredEvent emits signals when the corresponding event on
- the server is triggered. They are backed by QOpcUaSubscriptions.
-
- The objects are owned by the user and must be deleted when they are no longer needed.
- Deletion causes the monitored items to be unsubscribed from the server.
-*/
-
-/*!
- \fn void QOpcUaMonitoredEvent::newEvent(QVector<QVariant> val) const
- This signal is emitted when a new event is received by a data change
- subscription.
- The QVector \a val currently contains three QVariants holding the values of the
- first three event fields.
- \warning When using the FreeOPCUA backend, no signal is emitted as the
- internal implementation of events does not call the callback method.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/opcua/client/qopcuamonitoredevent.h b/src/opcua/client/qopcuamonitoredevent.h
deleted file mode 100644
index 6bc345b..0000000
--- a/src/opcua/client/qopcuamonitoredevent.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QOPCUAMONITOREDEVENT_H
-#define QOPCUAMONITOREDEVENT_H
-
-#include <QtOpcUa/qopcuaglobal.h>
-#include <QtOpcUa/qopcuanode.h>
-
-#include <QtCore/qobject.h>
-#include <QtCore/qvariant.h>
-#include <QtCore/qvector.h>
-
-QT_BEGIN_NAMESPACE
-
-class QOpcUaMonitoredEventPrivate;
-class QOpcUaMonitoredEventImpl;
-class QOpcUaSubscription;
-
-class Q_OPCUA_EXPORT QOpcUaMonitoredEvent : public QObject
-{
- Q_OBJECT
-
-public:
- Q_DECLARE_PRIVATE(QOpcUaMonitoredEvent)
-
- QOpcUaMonitoredEvent(QOpcUaNode *node, QOpcUaSubscription *subscription, QObject *parent = nullptr);
- ~QOpcUaMonitoredEvent() override;
- QOpcUaNode &node();
-
-Q_SIGNALS:
- void newEvent(QVector<QVariant> value) const;
-private:
- Q_DISABLE_COPY(QOpcUaMonitoredEvent)
-};
-
-QT_END_NAMESPACE
-
-#endif // QOPCUAMONITOREDEVENT_H
diff --git a/src/opcua/client/qopcuamonitoredevent_p.h b/src/opcua/client/qopcuamonitoredevent_p.h
deleted file mode 100644
index 1f300ac..0000000
--- a/src/opcua/client/qopcuamonitoredevent_p.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QOPCUAMONITOREDEVENT_P_H
-#define QOPCUAMONITOREDEVENT_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtOpcUa/qopcuaglobal.h>
-#include <QtOpcUa/qopcuamonitoredevent.h>
-#include <QtOpcUa/qopcuanode.h>
-
-#include <private/qobject_p.h>
-#include <QtCore/qvariant.h>
-#include <QtCore/qvector.h>
-
-QT_BEGIN_NAMESPACE
-
-class QOpcUaSubscriptionImpl;
-class QOpcUaSubscription;
-
-class Q_OPCUA_EXPORT QOpcUaMonitoredEventPrivate : public QObjectPrivate
-{
- Q_DECLARE_PUBLIC(QOpcUaMonitoredEvent)
-public:
- QOpcUaMonitoredEventPrivate(QOpcUaNode *node, QOpcUaSubscription *subscription);
- ~QOpcUaMonitoredEventPrivate() override;
-
- bool triggerNewEvent(const QVector<QVariant> &val);
- QOpcUaNode *m_node;
- QOpcUaSubscription *m_subscription;
-};
-
-QT_END_NAMESPACE
-
-#endif // QOPCUAMONITOREDEVENT_P_H
diff --git a/src/opcua/client/qopcuamonitoredeventprivate.cpp b/src/opcua/client/qopcuamonitoredeventprivate.cpp
deleted file mode 100644
index d9c59a1..0000000
--- a/src/opcua/client/qopcuamonitoredeventprivate.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <private/qopcuamonitoredevent_p.h>
-#include <private/qopcuasubscriptionimpl_p.h>
-
-QT_BEGIN_NAMESPACE
-
-QOpcUaMonitoredEventPrivate::QOpcUaMonitoredEventPrivate(QOpcUaNode *node, QOpcUaSubscription *subscription)
- : m_node(node)
- , m_subscription(subscription)
-{
-}
-
-QOpcUaMonitoredEventPrivate::~QOpcUaMonitoredEventPrivate()
-{
-}
-
-bool QOpcUaMonitoredEventPrivate::triggerNewEvent(const QVector<QVariant> &val)
-{
- static const int meta = qRegisterMetaType<QVector<QVariant>>();
- Q_UNUSED(meta);
-
- // explicitly use invoke to force the signal to be emitted on the main thread
- // even if the plugin triggered this from a worker thread
- return QMetaObject::invokeMethod(q_func(), "newEvent", Qt::AutoConnection, Q_ARG(QVector<QVariant>, val));
-}
-
-QT_END_NAMESPACE
diff --git a/src/opcua/client/qopcuamonitoredvalue.cpp b/src/opcua/client/qopcuamonitoredvalue.cpp
deleted file mode 100644
index 802ad24..0000000
--- a/src/opcua/client/qopcuamonitoredvalue.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qopcuamonitoredvalue.h"
-#include "qopcuasubscription.h"
-#include <private/qopcuamonitoredvalue_p.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QOpcUaMonitoredValue
- \inmodule QtOpcUa
-
- \brief Represents a source for values corresponding to a node on a OPC UA server.
-
- \chapter QOpcUaMonitoredValue
- Every QOpcUaMonitoredValue emits signals when the corresponding value in
- nodes on the server change. They are backed by QOpcUaSubscriptions.
-
- The objects are owned by the user and must be deleted when they are no longer needed.
- Deletion causes the monitored items to be unsubscribed from the server.
-*/
-
-/*!
- \fn void QOpcUaMonitoredValue::valueChanged(QVariant val) const
-
- This signal is emitted when a new update for a data change subscription
- arrives. \a val contains the new value.
- */
-
-QOpcUaMonitoredValue::QOpcUaMonitoredValue(QOpcUaNode *node, QOpcUaSubscription *subscription, QObject *parent)
- : QObject(*new QOpcUaMonitoredValuePrivate(node, subscription), parent)
-{
-}
-
-QOpcUaMonitoredValue::~QOpcUaMonitoredValue()
-{
- Q_D(QOpcUaMonitoredValue);
- if (d->m_subscription)
- d->m_subscription->removeValue(this);
-}
-
-/*!
- \fn QOpcUaNode &QOpcUaMonitoredValue::node()
-
- Returns the node which belongs to this value monitor instance.
-*/
-QOpcUaNode &QOpcUaMonitoredValue::node()
-{
- return *d_func()->m_node;
-}
-
-QT_END_NAMESPACE
diff --git a/src/opcua/client/qopcuamonitoredvalue.h b/src/opcua/client/qopcuamonitoredvalue.h
deleted file mode 100644
index 1761a79..0000000
--- a/src/opcua/client/qopcuamonitoredvalue.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QOPCUAMONITOREDVALUE_H
-#define QOPCUAMONITOREDVALUE_H
-
-#include <QtOpcUa/qopcuaglobal.h>
-#include <QtOpcUa/qopcuanode.h>
-
-#include <QtCore/qvariant.h>
-
-QT_BEGIN_NAMESPACE
-
-class QOpcUaMonitoredValuePrivate;
-class QOpcUaMonitoredValueImpl;
-class QOpcUaSubscription;
-
-class Q_OPCUA_EXPORT QOpcUaMonitoredValue : public QObject
-{
- Q_OBJECT
-
-public:
- Q_DECLARE_PRIVATE(QOpcUaMonitoredValue)
-
- QOpcUaMonitoredValue(QOpcUaNode *node, QOpcUaSubscription *subscription, QObject *parent = nullptr);
- ~QOpcUaMonitoredValue() override;
- QOpcUaNode &node();
-
-Q_SIGNALS:
- void valueChanged(QVariant val) const;
-private:
- Q_DISABLE_COPY(QOpcUaMonitoredValue)
-};
-
-QT_END_NAMESPACE
-
-#endif // QOPCUAMONITOREDVALUE_H
diff --git a/src/opcua/client/qopcuamonitoredvalue_p.h b/src/opcua/client/qopcuamonitoredvalue_p.h
deleted file mode 100644
index 49bf31b..0000000
--- a/src/opcua/client/qopcuamonitoredvalue_p.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QOPCUAMONITOREDVALUE_P_H
-#define QOPCUAMONITOREDVALUE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtOpcUa/qopcuaglobal.h>
-#include <QtOpcUa/qopcuamonitoredvalue.h>
-#include <QtOpcUa/qopcuanode.h>
-
-#include <private/qobject_p.h>
-#include <QtCore/qvariant.h>
-
-QT_BEGIN_NAMESPACE
-
-class QOpcUaSubscriptionImpl;
-class QOpcUaSubscription;
-
-class Q_OPCUA_EXPORT QOpcUaMonitoredValuePrivate : public QObjectPrivate
-{
- Q_DECLARE_PUBLIC(QOpcUaMonitoredValue)
-public:
- QOpcUaMonitoredValuePrivate(QOpcUaNode *node, QOpcUaSubscription *subscription);
- ~QOpcUaMonitoredValuePrivate() override;
-
- void triggerValueChanged(const QVariant &val);
- QOpcUaNode *m_node;
- QOpcUaSubscription *m_subscription;
- QVariant m_currentValue;
-};
-
-QT_END_NAMESPACE
-
-#endif // QOPCUAMONITOREDVALUE_P_H
diff --git a/src/opcua/client/qopcuamonitoredvalueprivate.cpp b/src/opcua/client/qopcuamonitoredvalueprivate.cpp
deleted file mode 100644
index 8cd2297..0000000
--- a/src/opcua/client/qopcuamonitoredvalueprivate.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <private/qopcuamonitoredvalue_p.h>
-#include <private/qopcuasubscriptionimpl_p.h>
-
-QT_BEGIN_NAMESPACE
-
-QOpcUaMonitoredValuePrivate::QOpcUaMonitoredValuePrivate(QOpcUaNode *node, QOpcUaSubscription *subscription)
- : m_node(node)
- , m_subscription(subscription)
- // TODO: is it useful to initialize a monitored item with a potentially uninitialized value?
- , m_currentValue(node->attribute(QOpcUaNode::NodeAttribute::Value))
-{
-}
-
-QOpcUaMonitoredValuePrivate::~QOpcUaMonitoredValuePrivate()
-{
-}
-
-void QOpcUaMonitoredValuePrivate::triggerValueChanged(const QVariant &val)
-{
- // explicitly use invoke to force the signal to be emitted on the main thread
- // even if the plugin triggered this from a worker thread
- if (val != m_currentValue) {
- m_currentValue = val;
- QMetaObject::invokeMethod(q_func(), "valueChanged", Qt::AutoConnection, Q_ARG(QVariant, val));
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/opcua/client/qopcuamonitoringparameters.cpp b/src/opcua/client/qopcuamonitoringparameters.cpp
new file mode 100644
index 0000000..c20d2b8
--- /dev/null
+++ b/src/opcua/client/qopcuamonitoringparameters.cpp
@@ -0,0 +1,390 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 basysKom GmbH, opensource@basyskom.com
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtOpcUa module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qopcuamonitoringparameters.h"
+#include "private/qopcuamonitoringparameters_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \enum QOpcUaMonitoringParameters::MonitoringMode
+
+ This enum is used to set the monitoring mode for a monitored item.
+
+ \value Disabled Sampling is disabled and no notifications are being generated.
+ \value Sampling Sampling is enabled and notifications are generated and queued, but reporting is disabled.
+ \value Reporting Sampling is enabled, notifications are generated and queued, reporting is enabled.
+*/
+
+/*!
+ \enum QOpcUaMonitoringParameters::SubscriptionType
+
+ \value Shared Share subscription with other monitored items with the same interval
+ \value Exclusive Request a new subscription for this attribute
+*/
+
+/*!
+ \class QOpcUaMonitoringParameters
+
+ This struct contains parameters for the creation of the subscription and monitored items for
+ a enableMonitoring request.
+
+ The same struct is used as return value for monitoringStatus and contains
+ the revised values from the server.
+*/
+
+/*!
+ \enum QOpcUaMonitoringParameters::Parameter
+
+ Enumerates parameters that can be modified at runtime using \l modifyMonitoring().
+ Not all values are guaranteed to be supported by all plugins. Lack of support will be reported
+ in the \l monitoringStatusChanged signal.
+
+ \value PublishingEnabled
+ \value PublishingInterval
+ \value LifetimeCount
+ \value MaxKeepAliveCount
+ \value MaxNotificationsPerPublish
+ \value Priority
+ \value SamplingInterval
+ \value Filter
+ \value QueueSize
+ \value DiscardOldest
+ \value MonitoringMode
+*/
+
+/*!
+ \class QOpcUaMonitoringParameters::DataChangeFilter
+
+ This struct is used to set up filtering for a DataChange monitored item.
+ It is defined in OPC-UA part 4, 7.12.2.
+*/
+
+/*!
+ \variable QOpcUaMonitoringParameters::DataChangeFilter::trigger
+
+ The trigger for this filter.
+*/
+
+/*!
+ \variable QOpcUaMonitoringParameters::DataChangeFilter::deadbandType
+
+ The deadband type for this filter.
+*/
+
+/*!
+ \variable QOpcUaMonitoringParameters::DataChangeFilter::deadbandValue
+
+ The deadband value for this filter.
+*/
+
+/*!
+ \enum QOpcUaMonitoringParameters::DataChangeFilter::DataChangeTrigger
+
+ Enumerates the possible triggers for a \l DataChangeFilter.
+
+ \value Status Triggers if the status code for the value changes.
+ \value StatusValue Triggers if the status code or the value changes.
+ \value StatusValueTimestamp Triggers if the status code, the value or the source timestamp changes.
+*/
+
+/*!
+ \enum QOpcUaMonitoringParameters::DataChangeFilter::DeadbandType
+
+ Enumerates the possible deadband types for a \l DataChangeFilter.
+
+ \value None No deadband filtering.
+ \value Absolute A notification is generated if the absolute value of the difference between the last cached value
+ and the current value is greater than the deadband value.
+ \value Percent Only valid for AnalogItems with an EURange property. A notification is generated if the absolute value
+ of the difference between the last cached value and the current value is greater than value percent of the EURange.
+*/
+
+QOpcUaMonitoringParameters::QOpcUaMonitoringParameters()
+ : d_ptr(new QOpcUaMonitoringParametersPrivate())
+{}
+
+QOpcUaMonitoringParameters::~QOpcUaMonitoringParameters()
+{}
+
+/*!
+ This is the constructor which covers most use cases for the QtOpcUa user.
+ \a publishingInterval must be supplied, \a shared and \a subscriptionId are optional.
+*/
+QOpcUaMonitoringParameters::QOpcUaMonitoringParameters(double publishingInterval, QOpcUaMonitoringParameters::SubscriptionType shared, quint32 subscriptionId)
+ : d_ptr(new QOpcUaMonitoringParametersPrivate)
+{
+ d_ptr->publishingInterval = publishingInterval;
+ d_ptr->shared = shared;
+ d_ptr->subscriptionId = subscriptionId;
+
+}
+
+QOpcUaMonitoringParameters::QOpcUaMonitoringParameters(const QOpcUaMonitoringParameters &other)
+ : d_ptr(other.d_ptr)
+{}
+
+QOpcUaMonitoringParameters &QOpcUaMonitoringParameters::operator=(const QOpcUaMonitoringParameters &other)
+{
+ d_ptr = other.d_ptr;
+ return *this;
+}
+
+/*!
+ Returns the subscription type.
+*/
+QOpcUaMonitoringParameters::SubscriptionType QOpcUaMonitoringParameters::shared() const
+{
+ return d_ptr->shared;
+}
+
+/*!
+ Request \a shared as subscription type for the subscription.
+*/
+void QOpcUaMonitoringParameters::setShared(SubscriptionType shared)
+{
+ d_ptr->shared = shared;
+}
+
+/*!
+ Returns the status code of the monitored item creation.
+*/
+QOpcUa::UaStatusCode QOpcUaMonitoringParameters::statusCode() const
+{
+ return d_ptr->statusCode;
+}
+
+/*!
+ Set the status code to \a statusCode.
+*/
+void QOpcUaMonitoringParameters::setStatusCode(QOpcUa::UaStatusCode statusCode)
+{
+ d_ptr->statusCode = statusCode;
+}
+
+/*!
+ Returns the publishing mode for the subscription.
+*/
+bool QOpcUaMonitoringParameters::publishingEnabled() const
+{
+ return d_ptr->publishingEnabled;
+}
+
+/*!
+ Set \a publishingEnabled as publishing mode for the subscription.
+*/
+void QOpcUaMonitoringParameters::setPublishingEnabled(bool publishingEnabled)
+{
+ d_ptr->publishingEnabled = publishingEnabled;
+}
+
+/*!
+ Returns the priority of the subscription used for the monitored item.
+*/
+quint8 QOpcUaMonitoringParameters::priority() const
+{
+ return d_ptr->priority;
+}
+
+/*!
+ Set \a priority as priority for the subscription.
+*/
+void QOpcUaMonitoringParameters::setPriority(quint8 priority)
+{
+ d_ptr->priority = priority;
+}
+
+/*!
+ Returns the maximum notifications per publish value of the subscription.
+*/
+quint32 QOpcUaMonitoringParameters::maxNotificationsPerPublish() const
+{
+ return d_ptr->maxNotificationsPerPublish;
+}
+
+/*!
+ Request \a maxNotificationsPerPublish as maximum notifications per publish value for the subscription.
+*/
+void QOpcUaMonitoringParameters::setMaxNotificationsPerPublish(quint32 maxNotificationsPerPublish)
+{
+ d_ptr->maxNotificationsPerPublish = maxNotificationsPerPublish;
+}
+
+/*!
+ Returns the maximum keepalive count of the subscription.
+*/
+quint32 QOpcUaMonitoringParameters::maxKeepAliveCount() const
+{
+ return d_ptr->maxKeepAliveCount;
+}
+
+/*!
+ Request \a maxKeepAliveCount as maximum keepalive count for the subscription.
+*/
+void QOpcUaMonitoringParameters::setMaxKeepAliveCount(quint32 maxKeepAliveCount)
+{
+ d_ptr->maxKeepAliveCount = maxKeepAliveCount;
+}
+
+/*!
+ Returns the lifetime count of the subscription.
+*/
+quint32 QOpcUaMonitoringParameters::lifetimeCount() const
+{
+ return d_ptr->lifetimeCount;
+}
+
+/*!
+ Request \a lifetimeCount as lifetime count for the subscription.
+*/
+void QOpcUaMonitoringParameters::setLifetimeCount(quint32 lifetimeCount)
+{
+ d_ptr->lifetimeCount = lifetimeCount;
+}
+
+/*!
+ Returns the publishing interval of the subscription.
+*/
+double QOpcUaMonitoringParameters::publishingInterval() const
+{
+ return d_ptr->publishingInterval;
+}
+
+/*!
+ Request \a publishingInterval as publishing interval for the subscription.
+*/
+void QOpcUaMonitoringParameters::setPublishingInterval(double publishingInterval)
+{
+ d_ptr->publishingInterval = publishingInterval;
+}
+
+/*!
+ Returns the assigned subscription id.
+*/
+quint32 QOpcUaMonitoringParameters::subscriptionId() const
+{
+ return d_ptr->subscriptionId;
+}
+
+/*!
+ Request the monitored items to be created on a known subscription with subscriptionId \a value.
+*/
+void QOpcUaMonitoringParameters::setSubscriptionId(quint32 subscriptionId)
+{
+ d_ptr->subscriptionId = subscriptionId;
+}
+
+/*!
+ Returns the monitoring mode for the monitored item.
+*/
+QOpcUaMonitoringParameters::MonitoringMode QOpcUaMonitoringParameters::monitoringMode() const
+{
+ return d_ptr->monitoringMode;
+}
+
+/*!
+ Request \a monitoringMode as monitoring mode for the monitored item.
+*/
+void QOpcUaMonitoringParameters::setMonitoringMode(MonitoringMode monitoringMode)
+{
+ d_ptr->monitoringMode = monitoringMode;
+}
+
+/*!
+ Returns the discardOldest setting of the monitored item.
+*/
+bool QOpcUaMonitoringParameters::discardOldest() const
+{
+ return d_ptr->discardOldest;
+}
+
+/*!
+ Request \a discardOldest as discardOldest setting for the monitored item.
+*/
+void QOpcUaMonitoringParameters::setDiscardOldest(bool discardOldest)
+{
+ d_ptr->discardOldest = discardOldest;
+}
+
+/*!
+ Returns the queue size of the monitored item.
+*/
+quint32 QOpcUaMonitoringParameters::queueSize() const
+{
+ return d_ptr->queueSize;
+}
+
+/*!
+ Request \a queueSize as queue size for the monitored item.
+*/
+void QOpcUaMonitoringParameters::setQueueSize(quint32 queueSize)
+{
+ d_ptr->queueSize = queueSize;
+}
+
+/*!
+ Returns the filter result. Empty for DataChangeFilter.
+*/
+QVariant QOpcUaMonitoringParameters::filter() const
+{
+ return d_ptr->filter;
+}
+
+/*!
+ Request \a filter as filter for for the monitored item.
+*/
+void QOpcUaMonitoringParameters::setFilter(const QVariant &filter)
+{
+ d_ptr->filter = filter;
+}
+
+/*!
+ Returns the revised sampling interval of the monitored item.
+*/
+double QOpcUaMonitoringParameters::samplingInterval() const
+{
+ return d_ptr->samplingInterval;
+}
+
+/*!
+ Request \a samplingInterval as sampling interval for the monitored item.
+*/
+void QOpcUaMonitoringParameters::setSamplingInterval(double samplingInterval)
+{
+ d_ptr->samplingInterval = samplingInterval;
+}
+
+QT_END_NAMESPACE
diff --git a/src/opcua/client/qopcuamonitoringparameters.h b/src/opcua/client/qopcuamonitoringparameters.h
new file mode 100644
index 0000000..422726a
--- /dev/null
+++ b/src/opcua/client/qopcuamonitoringparameters.h
@@ -0,0 +1,165 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 basysKom GmbH, opensource@basyskom.com
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtOpcUa module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QOPCUAMONITORINGPARAMETERS_H
+#define QOPCUAMONITORINGPARAMETERS_H
+
+#include <QtOpcUa/qopcuatype.h>
+
+#include <QtCore/qshareddata.h>
+
+QT_BEGIN_NAMESPACE
+
+class QOpcUaMonitoringParametersPrivate;
+
+class Q_OPCUA_EXPORT QOpcUaMonitoringParameters
+{
+ Q_GADGET
+
+public:
+
+ enum class MonitoringMode {
+ Disabled = 0,
+ Sampling = 1,
+ Reporting = 2
+ };
+
+ enum class SubscriptionType {
+ Shared,
+ Exclusive
+ };
+
+ enum class Parameter {
+ PublishingEnabled = (1 << 0),
+ PublishingInterval = (1 << 1),
+ LifetimeCount = (1 << 2),
+ MaxKeepAliveCount = (1 << 3),
+ MaxNotificationsPerPublish = (1 << 4),
+ Priority = (1 << 5),
+ SamplingInterval = (1 << 6),
+ Filter = (1 << 7),
+ QueueSize = (1 << 8),
+ DiscardOldest = (1 << 9),
+ MonitoringMode = (1 << 10)
+ };
+ Q_ENUM(Parameter)
+ Q_DECLARE_FLAGS(Parameters, Parameter)
+
+ // This type and the enums are defined in OPC-UA part 4, 7.12.2
+ struct DataChangeFilter {
+ enum class DataChangeTrigger {
+ Status = 0,
+ StatusValue = 1,
+ StatusValueTimestamp = 3
+ };
+
+ enum class DeadbandType {
+ None = 0,
+ Absolute = 1,
+ Percent = 2
+ };
+
+ DataChangeTrigger trigger;
+ DeadbandType deadbandType;
+ double deadbandValue;
+
+ DataChangeFilter()
+ : trigger(DataChangeTrigger::Status)
+ , deadbandType(DeadbandType::None)
+ , deadbandValue(0)
+ {}
+ DataChangeFilter(DataChangeTrigger p_trigger, DeadbandType p_deadbandType, double p_deadbandValue)
+ : trigger(p_trigger)
+ , deadbandType(p_deadbandType)
+ , deadbandValue(p_deadbandValue)
+ {}
+ };
+
+ QOpcUaMonitoringParameters();
+ ~QOpcUaMonitoringParameters();
+ QOpcUaMonitoringParameters(double publishingInterval, SubscriptionType shared = SubscriptionType::Shared, quint32 subscriptionId = 0);
+ QOpcUaMonitoringParameters(const QOpcUaMonitoringParameters &other);
+ QOpcUaMonitoringParameters &operator=(const QOpcUaMonitoringParameters &other);
+
+ double samplingInterval() const;
+ void setSamplingInterval(double samplingInterval);
+ QVariant filter() const;
+ void setFilter(const QVariant &filter);
+ quint32 queueSize() const;
+ void setQueueSize(quint32 queueSize);
+ bool discardOldest() const;
+ void setDiscardOldest(bool discardOldest);
+ QOpcUaMonitoringParameters::MonitoringMode monitoringMode() const;
+ void setMonitoringMode(MonitoringMode monitoringMode);
+ quint32 subscriptionId() const;
+ void setSubscriptionId(quint32 subscriptionId);
+ double publishingInterval() const;
+ void setPublishingInterval(double publishingInterval);
+ quint32 lifetimeCount() const;
+ void setLifetimeCount(quint32 lifetimeCount);
+ quint32 maxKeepAliveCount() const;
+ void setMaxKeepAliveCount(quint32 maxKeepAliveCount);
+ quint32 maxNotificationsPerPublish() const;
+ void setMaxNotificationsPerPublish(quint32 maxNotificationsPerPublish);
+ quint8 priority() const;
+ void setPriority(quint8 priority);
+ bool publishingEnabled() const;
+ void setPublishingEnabled(bool publishingEnabled);
+ QOpcUa::UaStatusCode statusCode() const;
+ void setStatusCode(QOpcUa::UaStatusCode statusCode);
+ QOpcUaMonitoringParameters::SubscriptionType shared() const;
+ void setShared(SubscriptionType subscriptionType);
+
+private:
+ QSharedDataPointer<QOpcUaMonitoringParametersPrivate> d_ptr;
+};
+
+Q_DECLARE_TYPEINFO(QOpcUaMonitoringParameters::SubscriptionType, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QOpcUaMonitoringParameters::DataChangeFilter::DataChangeTrigger, Q_PRIMITIVE_TYPE);
+Q_DECLARE_TYPEINFO(QOpcUaMonitoringParameters::DataChangeFilter::DeadbandType, Q_PRIMITIVE_TYPE);
+Q_DECLARE_OPERATORS_FOR_FLAGS(QOpcUaMonitoringParameters::Parameters)
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QOpcUaMonitoringParameters)
+Q_DECLARE_METATYPE(QOpcUaMonitoringParameters::SubscriptionType)
+Q_DECLARE_METATYPE(QOpcUaMonitoringParameters::DataChangeFilter)
+Q_DECLARE_METATYPE(QOpcUaMonitoringParameters::DataChangeFilter::DataChangeTrigger)
+Q_DECLARE_METATYPE(QOpcUaMonitoringParameters::DataChangeFilter::DeadbandType)
+Q_DECLARE_METATYPE(QOpcUaMonitoringParameters::Parameter)
+Q_DECLARE_METATYPE(QOpcUaMonitoringParameters::Parameters)
+
+#endif // QOPCUAMONITORINGPARAMETERS_H
diff --git a/src/opcua/client/qopcuasubscription_p.h b/src/opcua/client/qopcuamonitoringparameters_p.h
index f509c10..5b6e824 100644
--- a/src/opcua/client/qopcuasubscription_p.h
+++ b/src/opcua/client/qopcuamonitoringparameters_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 basysKom GmbH, opensource@basyskom.com
+** Copyright (C) 2017 basysKom GmbH, opensource@basyskom.com
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtOpcUa module of the Qt Toolkit.
@@ -34,8 +34,8 @@
**
****************************************************************************/
-#ifndef QOPCUASUBSCRIPTION_P_H
-#define QOPCUASUBSCRIPTION_P_H
+#ifndef QOPCUAMONITORINGPARAMETERS_P_H
+#define QOPCUAMONITORINGPARAMETERS_P_H
//
// W A R N I N G
@@ -48,27 +48,53 @@
// We mean it.
//
-#include <QtOpcUa/qopcuaglobal.h>
-#include <QtOpcUa/qopcuasubscription.h>
-#include <private/qopcuasubscriptionimpl_p.h>
+#include <QtOpcUa/qopcuamonitoringparameters.h>
-#include <private/qobject_p.h>
-#include <QtCore/qscopedpointer.h>
+#include <QtCore/qshareddata.h>
QT_BEGIN_NAMESPACE
-class Q_OPCUA_EXPORT QOpcUaSubscriptionPrivate : public QObjectPrivate
+class Q_OPCUA_EXPORT QOpcUaMonitoringParametersPrivate : public QSharedData
{
public:
- Q_DECLARE_PUBLIC(QOpcUaSubscription)
- QOpcUaSubscriptionPrivate(QOpcUaSubscriptionImpl *impl, quint32 interval);
- ~QOpcUaSubscriptionPrivate();
+ QOpcUaMonitoringParametersPrivate()
+ : samplingInterval(0)
+ , queueSize(0)
+ , discardOldest(true)
+ , monitoringMode(QOpcUaMonitoringParameters::MonitoringMode::Reporting)
+ , subscriptionId(0)
+ , publishingInterval(0)
+ , lifetimeCount(0)
+ , maxKeepAliveCount(0)
+ , maxNotificationsPerPublish(0)
+ , priority(0)
+ , publishingEnabled(true)
+ , statusCode(QOpcUa::UaStatusCode::BadAttributeIdInvalid)
+ , shared(QOpcUaMonitoringParameters::SubscriptionType::Shared)
+ {}
- QScopedPointer<QOpcUaSubscriptionImpl> m_impl;
- quint32 m_interval;
+ // MonitoredItem
+ double samplingInterval;
+ QVariant filter;
+ quint32 queueSize;
+ bool discardOldest;
+ QOpcUaMonitoringParameters::MonitoringMode monitoringMode;
+
+ // Subscription
+ quint32 subscriptionId;
+ double publishingInterval;
+ quint32 lifetimeCount;
+ quint32 maxKeepAliveCount;
+ quint32 maxNotificationsPerPublish;
+ quint8 priority;
+ bool publishingEnabled;
+
+ // QtOpcUa specific
+ QOpcUa::UaStatusCode statusCode;
+ QOpcUaMonitoringParameters::SubscriptionType shared;
};
QT_END_NAMESPACE
-#endif // QOPCUASUBSCRIPTION_P_H
+#endif // QOPCUAMONITORINGPARAMETERS_P_H
diff --git a/src/opcua/client/qopcuanode.cpp b/src/opcua/client/qopcuanode.cpp
index d948365..e02d0aa 100644
--- a/src/opcua/client/qopcuanode.cpp
+++ b/src/opcua/client/qopcuanode.cpp
@@ -35,12 +35,9 @@
****************************************************************************/
#include "qopcuaclient.h"
-#include "qopcuamonitoredvalue.h"
#include "qopcuanode.h"
#include <private/qopcuaclient_p.h>
#include <private/qopcuaclientimpl_p.h>
-#include <private/qopcuamonitoredevent_p.h>
-#include <private/qopcuamonitoredvalue_p.h>
#include <private/qopcuanode_p.h>
#include <private/qopcuanodeimpl_p.h>
@@ -80,11 +77,6 @@ QT_BEGIN_NAMESPACE
event we want to keep up with to the subscription.
\image subscriptions.png
-
- After calling valueMonitor() or eventMonitor(), a QOpcUaMonitoredValue or
- QOpcUaMonitoredEvent is returned.
- These objects emit a signal on a data change or event,
- depending on which type of subscription has been requested from the server.
*/
/*!
@@ -121,7 +113,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QOpcUaNode::attributeWritten(QOpcUaNode::NodeAttribute attribute, quint32 statusCode)
+ \fn QOpcUaNode::attributeWritten(QOpcUaNode::NodeAttribute attribute, QOpcUa::UaStatusCode statusCode)
This signal is emitted after a \l writeAttribute() or \l writeAttributes() operation has finished.
@@ -130,6 +122,29 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \fn void enableMonitoringFinished(QOpcUaNode::NodeAttribute attr, QOpcUa::UaStatusCode statusCode)
+
+ This signal is emitted after an asynchronous call to \l enableMonitoring() has finished.
+ After this signal has been emitted, \l monitoringStatus() returns valid information for \a attr.
+*/
+
+/*!
+ \fn void disableMonitoringFinished(QOpcUaNode::NodeAttribute attr, QOpcUa::UaStatusCode statusCode)
+
+ This signal is emitted after an asynchronous call to \l disableMonitoring() has finished.
+ After this signal has been emitted, monitoringStatus returns a default constructed value with
+ status code BadMonitoredItemIdIinvalid for \a attr.
+*/
+
+/*!
+ \fn void QOpcUaNode::monitoringStatusChanged(QOpcUaNode::NodeAttribute attr, QOpcUaMonitoringParameters::Parameter item, QVariant value, QOpcUa::UaStatusCode statusCode);
+
+ This signal is emitted after an asynchronous call to \l modifyMonitoring() has finished.
+ The node attribute for which the operation was requested is returned in \a attr. \a item contains the parameters that have been modified.
+ \a statusCode contains the result of the modify operation on the server.
+*/
+
+/*!
\internal QOpcUaNodeImpl is an opaque type (as seen from the public API).
This prevents users of the public API to use this constructor (eventhough
it is public).
@@ -244,6 +259,72 @@ QOpcUa::UaStatusCode QOpcUaNode::attributeError(QOpcUaNode::NodeAttribute attrib
\li Guid
\endtable
*/
+
+/*!
+ This method creates a monitored item for each of the attributes given in \a attr.
+ The settings from \a settings are used in the creation of the monitored items and the subscription.
+
+ The \a shared field of \a settings controls how the monitored items are assigned to a subscription. If shared in \a settings is set to Shared,
+ the monitored item will be added to a subscription with a matching \a interval. If shared in \a settings is set to Exclusive,
+ either a new subscription is created, or if a subscription is provided via the subscriptionId field in \a settings, an existing subscription is used.
+ This can be used to group monitored items on a subscription manually by creating the first monitored item with \a shared=false and
+ using the subscriptionId returned in \a subscriptionId of monitoringStatus(\a attr) in the following requests.
+
+ Returns true if the asynchronous call has been successfully dispatched.
+
+ On the completion of the call, the \l enableMonitoringFinished signal is emitted.
+ There are multiple error cases in which a Bad status code is generated: A subscription with \a subscriptionId does not exist,
+ the node does not exist on the server, the node does not have the requested attribute or the maximum number of monitored items for
+ the server is reached.
+ */
+bool QOpcUaNode::enableMonitoring(QOpcUaNode::NodeAttributes attr, const QOpcUaMonitoringParameters &settings)
+{
+ if (d_func()->m_client.isNull() || d_func()->m_client->state() != QOpcUaClient::Connected)
+ return false;
+
+ return d_func()->m_impl->enableMonitoring(attr, settings);
+}
+
+/*!
+ This method modifies settings of the monitored item or the subscription.
+ The parameter \a item of the monitored item or subscription associated with \a attr is attempted to set to \a value.
+
+ Returns true if the asynchronous call has been successfully dispatched.
+
+ After the call has finished, the monitoringStatusChanged signal is emitted. This signal contains the modified parameters and the status code.
+ A Bad status code is generated if there is no monitored item associated with the requested attribute, revising the requested
+ parameter is not implemented or if the server has rejected the requested value.
+*/
+bool QOpcUaNode::modifyMonitoring(QOpcUaNode::NodeAttribute attr, QOpcUaMonitoringParameters::Parameter item, const QVariant &value)
+{
+ if (d_func()->m_client.isNull() || d_func()->m_client->state() != QOpcUaClient::Connected)
+ return false;
+
+ return d_func()->m_impl->modifyMonitoring(attr, item, value);
+}
+
+/*!
+ Returns the monitoring parameters associated with the attribute \a attr. This can be used to check the success of \l enableMonitoring()
+ or if parameters have been revised.
+ The returned values are only valid after \l enableMonitoringFinished or \l monitoringStatusChanged have been emitted for \a attr.
+*/
+QOpcUaMonitoringParameters QOpcUaNode::monitoringStatus(QOpcUaNode::NodeAttribute attr)
+{
+ auto it = d_func()->m_monitoringStatus.constFind(attr);
+ if (it == d_func()->m_monitoringStatus.constEnd()) {
+ QOpcUaMonitoringParameters p;
+ p.setStatusCode(QOpcUa::UaStatusCode::BadAttributeIdInvalid);
+ return p;
+ }
+
+ return *it;
+}
+
+/*!
+ Writes \value to the attribute given in \a attribute using the type information from \a type.
+
+ Returns true if the write operation has been dispatched successfully.
+ */
bool QOpcUaNode::writeAttribute(QOpcUaNode::NodeAttribute attribute, const QVariant &value, QOpcUa::Types type)
{
if (d_func()->m_client.isNull() || d_func()->m_client->state() != QOpcUaClient::Connected)
@@ -269,6 +350,22 @@ bool QOpcUaNode::writeAttributes(const AttributeMap &toWrite, QOpcUa::Types valu
}
/*!
+ This method disables monitoring for the attributes given in \a attr.
+
+ Returns true if the asynchronous call has been successfully dispatched.
+
+ After the call is finished, the \l disableMonitoringFinished signal is emitted and monitoringStatus returns a default constructed value with
+ status code BadMonitoredItemIdIinvalid for \a attr.
+*/
+bool QOpcUaNode::disableMonitoring(QOpcUaNode::NodeAttributes attr)
+{
+ if (d_func()->m_client.isNull() || d_func()->m_client->state() != QOpcUaClient::Connected)
+ return false;
+
+ return d_func()->m_impl->disableMonitoring(attr);
+}
+
+/*!
QStringList filled with the node IDs of all child nodes of the OPC UA node.
*/
QStringList QOpcUaNode::childrenIds() const
diff --git a/src/opcua/client/qopcuanode.h b/src/opcua/client/qopcuanode.h
index b2e3d13..cc0f889 100644
--- a/src/opcua/client/qopcuanode.h
+++ b/src/opcua/client/qopcuanode.h
@@ -38,6 +38,7 @@
#define QOPCUANODE_H
#include <QtOpcUa/qopcuaglobal.h>
+#include <QtOpcUa/qopcuamonitoringparameters.h>
#include <QtOpcUa/qopcuatype.h>
#include <QtCore/qdatetime.h>
@@ -50,8 +51,6 @@ QT_BEGIN_NAMESPACE
class QOpcUaNodePrivate;
class QOpcUaNodeImpl;
class QOpcUaClient;
-class QOpcUaMonitoredEvent;
-class QOpcUaMonitoredValue;
class Q_OPCUA_EXPORT QOpcUaNode : public QObject
{
@@ -119,6 +118,11 @@ public:
bool writeAttribute(QOpcUaNode::NodeAttribute attribute, const QVariant &value, QOpcUa::Types type = QOpcUa::Types::Undefined);
bool writeAttributes(const AttributeMap &toWrite, QOpcUa::Types valueAttributeType = QOpcUa::Types::Undefined);
+ bool enableMonitoring(QOpcUaNode::NodeAttributes attr, const QOpcUaMonitoringParameters &settings);
+ bool disableMonitoring(QOpcUaNode::NodeAttributes attr);
+ bool modifyMonitoring(QOpcUaNode::NodeAttribute attr, QOpcUaMonitoringParameters::Parameter item, const QVariant &value);
+ QOpcUaMonitoringParameters monitoringStatus(QOpcUaNode::NodeAttribute attr);
+
QStringList childrenIds() const;
QString nodeId() const;
@@ -131,6 +135,12 @@ public:
Q_SIGNALS:
void readFinished(QOpcUaNode::NodeAttributes attributes);
void attributeWritten(QOpcUaNode::NodeAttribute attribute, QOpcUa::UaStatusCode statusCode);
+ void attributeUpdated(QOpcUaNode::NodeAttribute attr, QVariant value);
+
+ void monitoringStatusChanged(QOpcUaNode::NodeAttribute attr, QOpcUaMonitoringParameters::Parameters items,
+ QOpcUa::UaStatusCode statusCode);
+ void enableMonitoringFinished(QOpcUaNode::NodeAttribute attr, QOpcUa::UaStatusCode statusCode);
+ void disableMonitoringFinished(QOpcUaNode::NodeAttribute attr, QOpcUa::UaStatusCode statusCode);
private:
Q_DISABLE_COPY(QOpcUaNode)
diff --git a/src/opcua/client/qopcuanode_p.h b/src/opcua/client/qopcuanode_p.h
index bd57fb5..53f2996 100644
--- a/src/opcua/client/qopcuanode_p.h
+++ b/src/opcua/client/qopcuanode_p.h
@@ -94,12 +94,67 @@ public:
emit q_func()->attributeWritten(attr, statusCode);
});
+
+ m_attributeUpdatedConnection = QObject::connect(impl, &QOpcUaNodeImpl::attributeUpdated,
+ [this](QOpcUaNode::NodeAttribute attr, QVariant value)
+ {
+ this->m_nodeAttributes[attr] = {value, QOpcUa::UaStatusCode::Good};
+ emit q_func()->attributeUpdated(attr, value);
+ });
+
+ m_monitoringEnableDisableConnection = QObject::connect(impl, &QOpcUaNodeImpl::monitoringEnableDisable,
+ [this](QOpcUaNode::NodeAttribute attr, bool subscribe, QOpcUaMonitoringParameters status)
+ {
+ if (subscribe == true) {
+ m_monitoringStatus[attr] = status;
+ emit q_func()->enableMonitoringFinished(attr, status.statusCode());
+ }
+ else {
+ m_monitoringStatus.remove(attr);
+ emit q_func()->disableMonitoringFinished(attr, status.statusCode());
+ }
+ });
+
+ m_monitoringStatusChangedConnection = QObject::connect(impl, &QOpcUaNodeImpl::monitoringStatusChanged,
+ [this](QOpcUaNode::NodeAttribute attr, QOpcUaMonitoringParameters::Parameters items, QOpcUaMonitoringParameters param)
+ {
+ auto it = m_monitoringStatus.find(attr);
+ if (param.statusCode() == QOpcUa::UaStatusCode::Good && it != m_monitoringStatus.end()) {
+ if (items & QOpcUaMonitoringParameters::Parameter::PublishingEnabled)
+ it->setPublishingEnabled(param.publishingEnabled());
+ if (items & QOpcUaMonitoringParameters::Parameter::PublishingInterval)
+ it->setPublishingInterval(param.publishingInterval());
+ if (items & QOpcUaMonitoringParameters::Parameter::LifetimeCount)
+ it->setLifetimeCount(param.lifetimeCount());
+ if (items & QOpcUaMonitoringParameters::Parameter::MaxKeepAliveCount)
+ it->setMaxKeepAliveCount(param.maxKeepAliveCount());
+ if (items & QOpcUaMonitoringParameters::Parameter::MaxNotificationsPerPublish)
+ it->setMaxNotificationsPerPublish(param.maxNotificationsPerPublish());
+ if (items & QOpcUaMonitoringParameters::Parameter::Priority)
+ it->setPriority(param.priority());
+ if (items & QOpcUaMonitoringParameters::Parameter::SamplingInterval)
+ it->setSamplingInterval(param.samplingInterval());
+ if (items & QOpcUaMonitoringParameters::Parameter::Filter)
+ it->setFilter(param.filter());
+ if (items & QOpcUaMonitoringParameters::Parameter::QueueSize)
+ it->setQueueSize(param.queueSize());
+ if (items & QOpcUaMonitoringParameters::Parameter::DiscardOldest)
+ it->setDiscardOldest(param.discardOldest());
+ if (items & QOpcUaMonitoringParameters::Parameter::MonitoringMode)
+ it->setMonitoringMode(param.monitoringMode());
+ }
+
+ emit q_func()->monitoringStatusChanged(attr, items, param.statusCode());
+ });
}
~QOpcUaNodePrivate()
{
QObject::disconnect(m_attributesReadConnection);
QObject::disconnect(m_attributeWrittenConnection);
+ QObject::disconnect(m_attributeUpdatedConnection);
+ QObject::disconnect(m_monitoringEnableDisableConnection);
+ QObject::disconnect(m_monitoringStatusChangedConnection);
}
QScopedPointer<QOpcUaNodeImpl> m_impl;
@@ -110,9 +165,13 @@ public:
QOpcUa::UaStatusCode statusCode;
};
QHash<QOpcUaNode::NodeAttribute, AttributeWithStatus> m_nodeAttributes;
+ QHash<QOpcUaNode::NodeAttribute, QOpcUaMonitoringParameters> m_monitoringStatus;
QMetaObject::Connection m_attributesReadConnection;
QMetaObject::Connection m_attributeWrittenConnection;
+ QMetaObject::Connection m_attributeUpdatedConnection;
+ QMetaObject::Connection m_monitoringEnableDisableConnection;
+ QMetaObject::Connection m_monitoringStatusChangedConnection;
};
QT_END_NAMESPACE
diff --git a/src/opcua/client/qopcuanodeimpl_p.h b/src/opcua/client/qopcuanodeimpl_p.h
index 585a025..ff49dc3 100644
--- a/src/opcua/client/qopcuanodeimpl_p.h
+++ b/src/opcua/client/qopcuanodeimpl_p.h
@@ -49,6 +49,7 @@
//
#include <QtOpcUa/qopcuaglobal.h>
+#include <QtOpcUa/qopcuamonitoringparameters.h>
#include <QtOpcUa/qopcuanode.h>
#include <QtOpcUa/qopcuatype.h>
@@ -56,9 +57,6 @@
QT_BEGIN_NAMESPACE
-class QOpcUaMonitoredEvent;
-class QOpcUaMonitoredValue;
-
struct QOpcUaReadResult {
QOpcUaNode::NodeAttribute attributeId;
QOpcUa::UaStatusCode statusCode;
@@ -73,11 +71,15 @@ public:
virtual ~QOpcUaNodeImpl();
virtual bool readAttributes(QOpcUaNode::NodeAttributes attr) = 0;
+ virtual bool enableMonitoring(QOpcUaNode::NodeAttributes attr, const QOpcUaMonitoringParameters &settings) = 0;
+ virtual bool disableMonitoring(QOpcUaNode::NodeAttributes attr) = 0;
virtual QStringList childrenIds() const = 0;
virtual QString nodeId() const = 0;
virtual bool writeAttribute(QOpcUaNode::NodeAttribute attribute, const QVariant &value, QOpcUa::Types type) = 0;
virtual bool writeAttributes(const QOpcUaNode::AttributeMap &toWrite, QOpcUa::Types valueAttributeType) = 0;
+ virtual bool modifyMonitoring(QOpcUaNode::NodeAttribute attr, QOpcUaMonitoringParameters::Parameter item,
+ const QVariant &value) = 0;
virtual QPair<double, double> readEuRange() const = 0;
virtual QPair<QString, QString> readEui() const = 0;
@@ -89,6 +91,10 @@ Q_SIGNALS:
void attributesRead(QVector<QOpcUaReadResult> attr, QOpcUa::UaStatusCode serviceResult);
void attributeWritten(QOpcUaNode::NodeAttribute attr, QVariant value, QOpcUa::UaStatusCode statusCode);
+ void attributeUpdated(QOpcUaNode::NodeAttribute attr, QVariant value);
+ void monitoringEnableDisable(QOpcUaNode::NodeAttribute attr, bool subscribe, QOpcUaMonitoringParameters status);
+ void monitoringStatusChanged(QOpcUaNode::NodeAttribute attr, QOpcUaMonitoringParameters::Parameters items,
+ QOpcUaMonitoringParameters param);
};
QT_END_NAMESPACE
diff --git a/src/opcua/client/qopcuasubscription.cpp b/src/opcua/client/qopcuasubscription.cpp
deleted file mode 100644
index f09a4a2..0000000
--- a/src/opcua/client/qopcuasubscription.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qopcuasubscription.h"
-#include <private/qopcuasubscription_p.h>
-#include <private/qopcuasubscriptionimpl_p.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QOpcUaSubscription
- \inmodule QtOpcUa
-
- \brief Enables the user to utilize the
- subscription mechanism in OPC UA for event subscriptions.
-*/
-
-/*!
- \internal
- */
-QOpcUaSubscription::QOpcUaSubscription(QOpcUaSubscriptionImpl *impl, quint32 interval, QObject *parent)
- : QObject(*new QOpcUaSubscriptionPrivate(impl, interval), parent)
-{
-}
-
-/*!
- \fn QOpcUaSubscription::~QOpcUaSubscription()
-
- Destroys this subscription instance. It will also destroy the subscrption on
- the server.
- */
-QOpcUaSubscription::~QOpcUaSubscription()
-{
-}
-
-/*!
- Create an event monitor for \a node by adding it to this subscription object.
-
- Returns a QOpcUaMonitoredEvent which can be used to receive a signal when an
- event occcurs.
-*/
-QOpcUaMonitoredEvent *QOpcUaSubscription::addEvent(QOpcUaNode *node)
-{
- return d_func()->m_impl->addEvent(node);
-}
-
-/*!
- Create a value monitor for \a node by adding it to this subscription object.
-
- Return a QOpcUaMonitoredEvent which can be used to receive a signal when
- the value changes.
- */
-QOpcUaMonitoredValue *QOpcUaSubscription::addValue(QOpcUaNode *node)
-{
- return d_func()->m_impl->addValue(node);
-}
-
-/*!
- Remove the monitored event represented by \a event from this subscription.
- */
-void QOpcUaSubscription::removeEvent(QOpcUaMonitoredEvent *e)
-{
- d_func()->m_impl->removeEvent(e);
-}
-
-/*!
- Remove the monitored value represented by \a value from this subscription.
- */
-void QOpcUaSubscription::removeValue(QOpcUaMonitoredValue *value)
-{
- d_func()->m_impl->removeValue(value);
-}
-
-QT_END_NAMESPACE
diff --git a/src/opcua/client/qopcuasubscription.h b/src/opcua/client/qopcuasubscription.h
deleted file mode 100644
index 2559a74..0000000
--- a/src/opcua/client/qopcuasubscription.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QOPCUASUBSCRIPTION_H
-#define QOPCUASUBSCRIPTION_H
-
-#include <QtOpcUa/qopcuaglobal.h>
-
-#include <QtCore/qobject.h>
-
-QT_BEGIN_NAMESPACE
-
-class QOpcUaMonitoredEvent;
-class QOpcUaMonitoredValue;
-class QOpcUaNode;
-class QOpcUaSubscriptionImpl;
-class QOpcUaSubscriptionPrivate;
-
-class Q_OPCUA_EXPORT QOpcUaSubscription : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QOpcUaSubscription)
-public:
- QOpcUaSubscription(QOpcUaSubscriptionImpl *impl, quint32 interval, QObject *parent = nullptr);
- ~QOpcUaSubscription() override;
-
- QOpcUaMonitoredEvent *addEvent(QOpcUaNode *node);
- void removeEvent(QOpcUaMonitoredEvent *e);
-
- QOpcUaMonitoredValue *addValue(QOpcUaNode *node);
- void removeValue(QOpcUaMonitoredValue *value);
-private:
- Q_DISABLE_COPY(QOpcUaSubscription)
-};
-
-QT_END_NAMESPACE
-
-#endif // QOPCUASUBSCRIPTION_H
diff --git a/src/opcua/client/qopcuasubscriptionimpl.cpp b/src/opcua/client/qopcuasubscriptionimpl.cpp
deleted file mode 100644
index 08b7eab..0000000
--- a/src/opcua/client/qopcuasubscriptionimpl.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <private/qopcuasubscriptionimpl_p.h>
-
-QT_BEGIN_NAMESPACE
-
-QOpcUaSubscriptionImpl::QOpcUaSubscriptionImpl()
-{
-}
-
-QOpcUaSubscriptionImpl::~QOpcUaSubscriptionImpl()
-{
-}
-
-QT_END_NAMESPACE
diff --git a/src/opcua/client/qopcuasubscriptionimpl_p.h b/src/opcua/client/qopcuasubscriptionimpl_p.h
deleted file mode 100644
index 8c0a138..0000000
--- a/src/opcua/client/qopcuasubscriptionimpl_p.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QOPCUASUBSCRIPTIONIMPL_P_H
-#define QOPCUASUBSCRIPTIONIMPL_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtOpcUa/qopcuaglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-class QOpcUaMonitoredEvent;
-class QOpcUaMonitoredValue;
-class QOpcUaNode;
-
-class Q_OPCUA_EXPORT QOpcUaSubscriptionImpl
-{
-public:
- QOpcUaSubscriptionImpl();
- virtual ~QOpcUaSubscriptionImpl();
-
- virtual QOpcUaMonitoredEvent *addEvent(QOpcUaNode *node) = 0;
- virtual void removeEvent(QOpcUaMonitoredEvent *event) = 0;
- virtual QOpcUaMonitoredValue *addValue(QOpcUaNode *node) = 0;
- virtual void removeValue(QOpcUaMonitoredValue *value) = 0;
-};
-
-QT_END_NAMESPACE
-
-#endif // QOPCUASUBSCRIPTIONIMPL_P_H
diff --git a/src/opcua/client/qopcuasubscriptionprivate.cpp b/src/opcua/client/qopcuasubscriptionprivate.cpp
deleted file mode 100644
index 762d413..0000000
--- a/src/opcua/client/qopcuasubscriptionprivate.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <private/qopcuasubscription_p.h>
-
-QT_BEGIN_NAMESPACE
-
-QOpcUaSubscriptionPrivate::QOpcUaSubscriptionPrivate(QOpcUaSubscriptionImpl *impl, quint32 interval)
- : m_impl(impl)
- , m_interval(interval)
-{
-
-}
-
-QOpcUaSubscriptionPrivate::~QOpcUaSubscriptionPrivate()
-{
-
-}
-
-QT_END_NAMESPACE
diff --git a/src/opcua/client/qopcuavaluesubscription.cpp b/src/opcua/client/qopcuavaluesubscription.cpp
deleted file mode 100644
index d48f772..0000000
--- a/src/opcua/client/qopcuavaluesubscription.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qopcuavaluesubscription.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QOpcUaValueSubscription
- \inmodule QtOpcUa
-
- \brief Enables the user to utilize the
- subscription mechanism in OPC UA for data change subscriptions.
-
- \note This class is not exposed to application developers.
-*/
-
-/*!
- Creates an empty QOpcUaValueSubscription object with interval \a interval
- */
-QOpcUaValueSubscription::QOpcUaValueSubscription(uint interval)
- : QOpcUaSubscription()
- , d_ptr(0) // new QOpcUaValueSubscriptionPrivate(this))
-{
- m_interval = interval;
-}
-
-/*!
- Return the interval of the subscription.
- */
-uint QOpcUaValueSubscription::interval() const
-{
- return m_interval;
-}
-
-/*!
- \fn QOpcUaMonitoredValue QOpcUaValueSubscription::addValue(const QString &nodeId)
-
- Adds the node with \a nodeId to this subscription.
-
- Must be reimplemented in the concrete plugin implementation.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/opcua/client/qopcuavaluesubscription.h b/src/opcua/client/qopcuavaluesubscription.h
deleted file mode 100644
index 95d2873..0000000
--- a/src/opcua/client/qopcuavaluesubscription.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 basysKom GmbH, opensource@basyskom.com
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtOpcUa module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QOPCUAVALUESUBSCRIPTION_H
-#define QOPCUAVALUESUBSCRIPTION_H
-
-#include <QtOpcUa/qopcuasubscription.h>
-
-QT_BEGIN_NAMESPACE
-
-class QOpcUaMonitoredValue;
-class QOpcUaValueSubscriptionPrivate;
-
-class Q_OPCUA_EXPORT QOpcUaValueSubscription : public QOpcUaSubscription
-{
-public:
- ~QOpcUaValueSubscription() override = default;
-
- virtual QOpcUaMonitoredValue *addValue(const QString &nodeId) = 0;
-
- uint interval() const;
-
-protected:
- explicit QOpcUaValueSubscription(uint interval);
-
- uint m_interval;
-
-private:
- Q_DECLARE_PRIVATE(QOpcUaValueSubscription)
-};
-
-QT_END_NAMESPACE
-
-#endif // QOPCUAVALUESUBSCRIPTION_H