From 87169e10cb7ebe732ef388552bb0c057c09767ef Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Fri, 13 Mar 2026 18:20:35 +0100 Subject: Unified socket slots, --wire-debug CLI flag, fix mock TX and disconnect logging Collapse 12 per-socket slots into 4 sender()-based slots. Replace runtime wireDebug QML property with static --wire-debug CLI flag on both demo and mock server. Route MockServer::sendKaPing through sendReply so KA_PING TX shows wire bytes. Simplify sendReply to deduce command token from wire data. Fix Xpl2Client disconnect logging (logTag takes pointer, null-sender fallback). --- demo/Main.qml | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'demo/Main.qml') diff --git a/demo/Main.qml b/demo/Main.qml index edf317c..db015e3 100644 --- a/demo/Main.qml +++ b/demo/Main.qml @@ -23,23 +23,10 @@ ApplicationWindow { debugConsole.appendLog("ERROR: " + error); } - function onJcVersionReceived() { - debugConsole.appendLog( - "JC Version: controller=%1 fw=%2 hw=%3 phCount=%4".arg( - Xpl2Client.controllerId).arg( - Xpl2Client.firmwareVersion).arg( - Xpl2Client.hardwareVersion).arg( - Xpl2Client.printheadCount)); - } - function onStatusMessage(message: string) { debugConsole.appendLog(message); } - function onWireDebugMessage(message: string) { - debugConsole.appendLog("WIRE: " + message); - } - target: Xpl2Client } @@ -84,13 +71,6 @@ ApplicationWindow { Xpl2Client.connectToServer(); } } - - CheckBox { - checked: Xpl2Client.wireDebug - text: "Wire debug" - - onToggled: Xpl2Client.wireDebug = checked - } } } @@ -134,7 +114,8 @@ ApplicationWindow { id: debugConsole function appendLog(msg: string): void { - let ts = new Date().toLocaleTimeString(Qt.locale(), "HH:mm:ss"); + let ts = new Date().toLocaleTimeString(Qt.locale(), + "HH:mm:ss.zzz"); debugLog.text += "[" + ts + "] " + msg + "\n"; debugLog.cursorPosition = debugLog.text.length; } -- cgit v1.2.3