diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-03-24 17:25:03 +0100 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-03-24 17:29:52 +0100 |
| commit | e9d8a8b052150f42ea00da2c07e3f78a9b7d2061 (patch) | |
| tree | 2124701ae0991ed854c1a94e58d64558b6f78b48 /jetting-interface/Main.qml | |
| parent | 8bcf948b76c9564cb38d3611228ccaf73890a548 (diff) | |
| download | QtXpl2-e9d8a8b052150f42ea00da2c07e3f78a9b7d2061.tar.gz QtXpl2-e9d8a8b052150f42ea00da2c07e3f78a9b7d2061.zip | |
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().
Diffstat (limited to 'jetting-interface/Main.qml')
| -rw-r--r-- | jetting-interface/Main.qml | 39 |
1 files changed, 24 insertions, 15 deletions
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(); } } } |
