summaryrefslogtreecommitdiffstats
path: root/demo/NodePage.qml
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-02-20 10:41:09 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-02-20 10:41:09 +0100
commit0012cb312e92c33f5263478d318eb82da22ee879 (patch)
treecaac374dd3716b42d13cb85b85a7f90c7d5aac45 /demo/NodePage.qml
parent11b99fda8727f2225961c0b83ecdb18674a9670a (diff)
downloadBobinkQtOpcUa-0012cb312e92c33f5263478d318eb82da22ee879.tar.gz
BobinkQtOpcUa-0012cb312e92c33f5263478d318eb82da22ee879.zip
Rename classes to OpcUa* prefix, replace BobinkNode with OpcUaMonitoredNode boilerplate
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.
Diffstat (limited to 'demo/NodePage.qml')
-rw-r--r--demo/NodePage.qml112
1 files changed, 2 insertions, 110 deletions
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"
}