From 5ff9705937ffc1647587e1b228effd30c8a0e309 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Mon, 23 Mar 2026 14:55:32 +0100 Subject: Refactor Main.qml into separate components and add comments Extract ConnectionPage, CertTrustDialog, and DebugConsole from Main.qml into their own QML files. Add inline comments to OpcUaMonitoredNode::handleValueUpdated explaining the range write guard, value store, and timestamp update. --- src/OpcUaMonitoredNode.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/OpcUaMonitoredNode.cpp') 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); -- cgit v1.2.3