aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/OpcUaMonitoredNode.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/OpcUaMonitoredNode.cpp b/src/OpcUaMonitoredNode.cpp
index 9155838..290a1c2 100644
--- a/src/OpcUaMonitoredNode.cpp
+++ b/src/OpcUaMonitoredNode.cpp
@@ -264,8 +264,8 @@ OpcUaMonitoredNode::handleAttributeUpdated (QOpcUa::NodeAttribute attr,
m_info.valueRank = QStringLiteral ("TwoDimensions");
break;
default:
- m_info.valueRank = QString::number (vr)
- + QStringLiteral ("Dimensions");
+ m_info.valueRank
+ = QString::number (vr) + QStringLiteral ("Dimensions");
break;
}
}
@@ -312,12 +312,18 @@ OpcUaMonitoredNode::handleAttributeUpdated (QOpcUa::NodeAttribute attr,
void
OpcUaMonitoredNode::handleValueUpdated (const QVariant &value)
{
+ // After a range write, Qt emits valueAttributeUpdated with only the
+ // partial written value instead of the full array. Ignore this
+ // update and let the monitored item deliver the correct full array
+ // on the next data change notification.
if (m_pendingRangeWrite)
return;
+ // Store the new value pushed by the OPC UA monitored item.
m_value = value;
emit valueChanged ();
+ // Update status and timestamps from the node's cached attributes.
m_info.status = QOpcUa::statusToString (m_node->valueAttributeError ());
m_info.sourceTimestamp
= m_node->sourceTimestamp (QOpcUa::NodeAttribute::Value);