blob: 908dcbd8b4135185c34d78e9c14c41bb1ffe3c4f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
// 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
}
}
}
|