From e9d8a8b052150f42ea00da2c07e3f78a9b7d2061 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Tue, 24 Mar 2026 17:25:03 +0100 Subject: Add JettingProxy relay, convert Xpl2Client to active connection model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Insert a transparent TCP proxy between the controller and N clients: - JettingProxy listens on 9110-9112 (controller) and 9210-9212 (clients) - Broadcasts controller frames to all clients, forwards client→controller - Independent KA_PING handling on both sides Convert Xpl2Client from passive QTcpServer listener to active QTcpSocket outbound connections with auto-retry. New QML API: host/commandPort properties, connectToProxy()/disconnectFromProxy() replacing startListening()/stopListening(). --- jetting-interface/Main.qml | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'jetting-interface') diff --git a/jetting-interface/Main.qml b/jetting-interface/Main.qml index 1c7b553..cd69ed8 100644 --- a/jetting-interface/Main.qml +++ b/jetting-interface/Main.qml @@ -31,9 +31,8 @@ ApplicationWindow { Connections { function onConnectedChanged() { - debugConsole.appendLog(Xpl2Client.connected - ? "Controller connected" : - "Controller disconnected"); + debugConsole.appendLog(Xpl2Client.connected ? "Connected to proxy" : + "Disconnected from proxy"); } function onErrorOccurred(error: string) { @@ -44,12 +43,6 @@ ApplicationWindow { statusPage.lastJcStatus = status; } - function onListeningChanged() { - debugConsole.appendLog(Xpl2Client.listening - ? "Listening on ports 9110/9111/9112" : - "Stopped listening"); - } - function onPhStatusReceived(status) { statusPage.lastPhStatus = status; } @@ -101,9 +94,25 @@ ApplicationWindow { RowLayout { anchors.fill: parent + TextField { + Layout.preferredWidth: 140 + placeholderText: "Host" + text: Xpl2Client.host + + onEditingFinished: Xpl2Client.host = text + } + + TextField { + Layout.preferredWidth: 70 + placeholderText: "Port" + text: Xpl2Client.commandPort + + onEditingFinished: Xpl2Client.commandPort = parseInt(text) + } + Label { - text: Xpl2Client.connected ? "Controller connected" : - "Waiting for controller…" + text: Xpl2Client.connected ? "Connected to proxy" : + "Disconnected" } Item { @@ -111,13 +120,13 @@ ApplicationWindow { } Button { - text: Xpl2Client.listening ? "Stop" : "Listen" + text: Xpl2Client.connected ? "Disconnect" : "Connect" onClicked: { - if (Xpl2Client.listening) - Xpl2Client.stopListening(); + if (Xpl2Client.connected) + Xpl2Client.disconnectFromProxy(); else - Xpl2Client.startListening(); + Xpl2Client.connectToProxy(); } } } -- cgit v1.2.3