From 0012cb312e92c33f5263478d318eb82da22ee879 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Fri, 20 Feb 2026 10:41:09 +0100 Subject: Rename classes to OpcUa* prefix, replace BobinkNode with OpcUaMonitoredNode boilerplate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename BobinkAuth → OpcUaAuth, BobinkClient → OpcUaClient (C++ class names only; QML module URI and singleton name stay as Bobink). Remove BobinkNode (QQuickItem-based) and add OpcUaMonitoredNode skeleton using QObject + QQmlParserStatus, following Qt convention for non-visual QML types. --- demo/NodePage.qml | 112 +----------------------------------------------------- 1 file changed, 2 insertions(+), 110 deletions(-) (limited to 'demo/NodePage.qml') diff --git a/demo/NodePage.qml b/demo/NodePage.qml index fd81db5..bd57583 100644 --- a/demo/NodePage.qml +++ b/demo/NodePage.qml @@ -1,6 +1,4 @@ -// NodePage.qml — Monitors a single OPC UA node. -// Two instances demonstrate visibility lifecycle: switching pages -// stops monitoring on the hidden page automatically. +// NodePage.qml — Placeholder while OpcUaMonitoredNode is implemented. import QtQuick import QtQuick.Controls @@ -14,24 +12,6 @@ Page { required property int pageNumber required property var logFunction - property string monitoredNodeId: "" - property string nodeDescription: "" - property bool nodeWritable: true - property bool metadataLoaded: false - - BobinkNode { - id: node - nodeId: nodePage.monitoredNodeId - onAttributeRead: (name, val) => { - if (name === "DisplayName") - nodePage.nodeDescription = val.toString(); - else if (name === "AccessLevel") - nodePage.nodeWritable = (val & 0x02) !== 0; - nodePage.metadataLoaded = true; - } - onWriteError: (message) => nodePage.logFunction("WRITE: " + message) - } - ColumnLayout { anchors.fill: parent anchors.margins: 20 @@ -50,96 +30,8 @@ Page { } } - RowLayout { - TextField { - id: nodeIdField - Layout.fillWidth: true - placeholderText: "ns=2;s=Temperature" - enabled: !nodePage.monitoredNodeId - } - Button { - text: nodePage.monitoredNodeId ? "Stop" : "Monitor" - onClicked: { - if (nodePage.monitoredNodeId) { - nodePage.monitoredNodeId = ""; - nodePage.nodeDescription = ""; - nodePage.nodeWritable = true; - nodePage.metadataLoaded = false; - } else { - nodePage.monitoredNodeId = nodeIdField.text; - node.readAttribute("DisplayName"); - node.readAttribute("AccessLevel"); - } - } - } - } - - GroupBox { - Layout.fillWidth: true - visible: nodePage.monitoredNodeId.length > 0 - title: nodePage.nodeDescription || nodePage.monitoredNodeId - - GridLayout { - columns: 2 - width: parent.width - - Label { text: "Value:" } - Label { - text: node.value !== undefined ? node.value.toString() : "—" - font.family: "monospace" - font.bold: true - } - - Label { text: "Status:" } - Label { - text: node.status === BobinkNode.Good ? "Good" - : node.status === BobinkNode.Uncertain ? "Uncertain" - : "Bad" - color: node.status === BobinkNode.Good ? "green" - : node.status === BobinkNode.Uncertain ? "orange" - : "red" - } - - Label { text: "Source TS:" } - Label { - text: node.sourceTimestamp.toLocaleString( - Qt.locale(), "HH:mm:ss.zzz") - font.family: "monospace" - } - - Label { text: "Server TS:" } - Label { - text: node.serverTimestamp.toLocaleString( - Qt.locale(), "HH:mm:ss.zzz") - font.family: "monospace" - } - } - } - - RowLayout { - visible: nodePage.monitoredNodeId.length > 0 - - TextField { - id: writeField - Layout.fillWidth: true - enabled: nodePage.nodeWritable - placeholderText: nodePage.metadataLoaded && !nodePage.nodeWritable - ? "Read-only node" : "Value to write" - } - Button { - text: "Write" - enabled: nodePage.nodeWritable - onClicked: { - node.value = writeField.text; - writeField.clear(); - } - } - } - Label { - visible: nodePage.monitoredNodeId.length > 0 - && nodePage.metadataLoaded && !nodePage.nodeWritable - text: "Read-only node" + text: "Node monitoring not yet available (OpcUaMonitoredNode in progress)" font.italic: true color: "gray" } -- cgit v1.2.3