summaryrefslogtreecommitdiffstats
path: root/src/opcua/client/qopcuaclientimpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opcua/client/qopcuaclientimpl.cpp')
-rw-r--r--src/opcua/client/qopcuaclientimpl.cpp25
1 files changed, 25 insertions, 0 deletions
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