// Main.qml — Demo app for Bobink library. // Connects to an OPC UA server, then pushes NodePage for node interaction. pragma ComponentBehavior: Bound import QtQuick import QtQuick.Controls import QtQuick.Layouts import Bobink ApplicationWindow { id: root height: 900 title: "Bobink Demo" visible: true width: 800 Connections { function onCertificateTrustRequested(certInfo) { certTrustDialog.certInfo = certInfo; certTrustDialog.open(); } function onConnectedChanged() { debugConsole.appendLog("Connected: " + Bobink.connected); if (Bobink.connected) { connectionPage.autoConnectFailed = false; Bobink.stopDiscovery(); stack.push("NodePage.qml", { stackRef: stack, pageNumber: 1 }); } else { stack.pop(null); } } function onConnectionError(message) { debugConsole.appendLog("Connection error: " + message); connectionPage.autoConnectFailed = true; } function onDiscoveringChanged() { debugConsole.appendLog("Discovering: " + Bobink.discovering); } function onServersChanged() { debugConsole.appendLog("Discovered server list updated"); } function onStatusMessage(message) { debugConsole.appendLog(message); } target: Bobink } CertTrustDialog { id: certTrustDialog } ColumnLayout { anchors.fill: parent spacing: 0 StackView { id: stack Layout.fillHeight: true Layout.fillWidth: true initialItem: ConnectionPage { id: connectionPage } Connections { function onLogRequested(message) { debugConsole.appendLog(message); } ignoreUnknownSignals: true target: stack.currentItem } } DebugConsole { id: debugConsole Layout.fillWidth: true Layout.preferredHeight: 120 } } }