diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-03-16 11:04:21 +0100 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-03-16 11:04:21 +0100 |
| commit | 9ac64169720fb2b9852589b74f7300bcfebcaf62 (patch) | |
| tree | 693e6582542c0c420cf521f42084d35c72ceff8f /mock-server/MockServer.cpp | |
| parent | 87169e10cb7ebe732ef388552bb0c057c09767ef (diff) | |
| download | QtXpl2-9ac64169720fb2b9852589b74f7300bcfebcaf62.tar.gz QtXpl2-9ac64169720fb2b9852589b74f7300bcfebcaf62.zip | |
GS_PH_VERSION command, per-printhead demo UI with --printheads CLI arg
Add getPhVersion(printheadId) to Xpl2Client with phVersionReceived signal
carrying all 8 response fields. Mock server echoes canned version data for
any requested printhead ID.
Demo app accepts --printheads N (default 10) to simulate N printheads.
The UI shows a scrollable per-PH list with individual and bulk version
query buttons, updating each row's version info on response.
Diffstat (limited to 'mock-server/MockServer.cpp')
| -rw-r--r-- | mock-server/MockServer.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mock-server/MockServer.cpp b/mock-server/MockServer.cpp index d58e58e..981bd1c 100644 --- a/mock-server/MockServer.cpp +++ b/mock-server/MockServer.cpp @@ -119,6 +119,8 @@ MockServer::handleCommand (QTcpSocket *client, const QByteArray &line) handleKaPing (client, params); else if (cmd == "GS_JC_VERSION") handleGsJcVersion (client); + else if (cmd == "GS_PH_VERSION") + handleGsPhVersion (client, params); else qWarning ("%s Unknown command: %s", qPrintable (logTag (client->localPort ())), cmd.constData ()); @@ -154,3 +156,14 @@ MockServer::handleGsJcVersion (QTcpSocket *client) qDebug ("%s RX GS_JC_VERSION", qPrintable (logTag (client->localPort ()))); sendReply (client, "GS_JC_VERSION,1,\"1.05\",\"2.00\",15\n"); } + +void +MockServer::handleGsPhVersion (QTcpSocket *client, const QByteArray ¶ms) +{ + qDebug ("%s RX GS_PH_VERSION,%s", qPrintable (logTag (client->localPort ())), + params.constData ()); + /* Echo back canned version info for whatever printhead ID was requested. */ + sendReply (client, QByteArray ("GS_PH_VERSION,1,") + params + + ",\"3.10\",\"1.00\",\"Standard\"," + "\"2.05\",\"1.02\",\"0.9.1\"\n"); +} |
