diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-03-23 14:55:32 +0100 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-03-23 14:55:32 +0100 |
| commit | 5ff9705937ffc1647587e1b228effd30c8a0e309 (patch) | |
| tree | e1c5d9397ebbd68dd593788d6b09688a1d6ee8bd /src/OpcUaMonitoredNode.cpp | |
| parent | 47096b375797c38b5b1e79f1366f1152cc292875 (diff) | |
| download | BobinkQtOpcUa-5ff9705937ffc1647587e1b228effd30c8a0e309.tar.gz BobinkQtOpcUa-5ff9705937ffc1647587e1b228effd30c8a0e309.zip | |
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.
Diffstat (limited to 'src/OpcUaMonitoredNode.cpp')
| -rw-r--r-- | src/OpcUaMonitoredNode.cpp | 10 |
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); |
