diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-20 12:32:56 +0100 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-20 12:32:56 +0100 |
| commit | 263a055f9b9460e4da747c7e56372e963f72fe68 (patch) | |
| tree | 8620dbf4946e765779fa55247bd3cea8b48128fe /src/OpcUaMonitoredNode.cpp | |
| parent | 690db0fa630ac57d0ec99010862c7b7e4a7ac589 (diff) | |
| download | BobinkQtOpcUa-263a055f9b9460e4da747c7e56372e963f72fe68.tar.gz BobinkQtOpcUa-263a055f9b9460e4da747c7e56372e963f72fe68.zip | |
Display all 30 nodes across 3 pages with human-readable tooltips
NodePage rewritten with Repeater/ItemDelegate showing 10 nodes per page
(RW Scalars, RO Scalars, RW Arrays). DataType resolved via namespace0Id
helpers, AccessLevel decoded from bitmask to readable flags.
Diffstat (limited to 'src/OpcUaMonitoredNode.cpp')
| -rw-r--r-- | src/OpcUaMonitoredNode.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/OpcUaMonitoredNode.cpp b/src/OpcUaMonitoredNode.cpp index 0ffe300..b158881 100644 --- a/src/OpcUaMonitoredNode.cpp +++ b/src/OpcUaMonitoredNode.cpp @@ -7,6 +7,7 @@ #include <QMetaEnum> #include <QOpcUaLocalizedText> +#include <QStringList> OpcUaMonitoredNode::OpcUaMonitoredNode (QObject *parent) : QObject (parent) {} @@ -161,10 +162,29 @@ OpcUaMonitoredNode::handleAttributeUpdated (QOpcUa::NodeAttribute attr, } break; case QOpcUa::NodeAttribute::DataType: - m_info.dataType = value.toString (); + { + auto ns0 = QOpcUa::namespace0IdFromNodeId (value.toString ()); + m_info.dataType = QOpcUa::namespace0IdName (ns0); + if (m_info.dataType.isEmpty ()) + m_info.dataType = value.toString (); + } break; case QOpcUa::NodeAttribute::AccessLevel: - m_info.accessLevel = value.toUInt (); + { + quint32 bits = value.toUInt (); + QStringList flags; + if (bits & quint32 (QOpcUa::AccessLevelBit::CurrentRead)) + flags << QStringLiteral ("Read"); + if (bits & quint32 (QOpcUa::AccessLevelBit::CurrentWrite)) + flags << QStringLiteral ("Write"); + if (bits & quint32 (QOpcUa::AccessLevelBit::HistoryRead)) + flags << QStringLiteral ("History Read"); + if (bits & quint32 (QOpcUa::AccessLevelBit::HistoryWrite)) + flags << QStringLiteral ("History Write"); + m_info.accessLevel = flags.isEmpty () + ? QStringLiteral ("None") + : flags.join (QStringLiteral (", ")); + } break; default: return; |
