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 /src/Xpl2Client.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 'src/Xpl2Client.cpp')
| -rw-r--r-- | src/Xpl2Client.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/Xpl2Client.cpp b/src/Xpl2Client.cpp index ba6a1ec..54346e0 100644 --- a/src/Xpl2Client.cpp +++ b/src/Xpl2Client.cpp @@ -110,6 +110,12 @@ Xpl2Client::getJcVersion () sendCommand (m_commandSocket, "GS_JC_VERSION"); } +void +Xpl2Client::getPhVersion (int printheadId) +{ + sendCommand (m_commandSocket, "GS_PH_VERSION", { printheadId }); +} + /* ------------------------------------------------------------------ */ /* Send / dispatch */ /* ------------------------------------------------------------------ */ @@ -141,6 +147,8 @@ Xpl2Client::dispatchCommandMessage (const Xpl2Protocol::ParsedMessage &msg) handleKaPing (m_commandSocket); else if (msg.command == "GS_JC_VERSION") handleGsJcVersion (msg.params); + else if (msg.command == "GS_PH_VERSION") + handleGsPhVersion (msg.params); else qWarning ("%s Unknown command: %s", qPrintable (logTag (&m_commandSocket)), msg.command.constData ()); @@ -197,6 +205,40 @@ Xpl2Client::handleGsJcVersion (const QVariantList ¶ms) emit jcVersionReceived (); } +void +Xpl2Client::handleGsPhVersion (const QVariantList ¶ms) +{ + if (params.size () < 8) + { + qWarning () << "GS_PH_VERSION: expected 8 params, got" << params.size (); + return; + } + int cid = params[0].toInt (); + int phId = params[1].toInt (); + QString mcuFw = params[2].toString (); + QString mcuHw = params[3].toString (); + QString mcuFwVar = params[4].toString (); + QString fpgaFw = params[5].toString (); + QString fpgaHw = params[6].toString (); + QString bootVer = params[7].toString (); + qDebug ("%s PH[%d] mcuFw=%s mcuHw=%s mcuFwVar=%s fpgaFw=%s fpgaHw=%s " + "boot=%s", + qPrintable (logTag (&m_commandSocket)), phId, qPrintable (mcuFw), + qPrintable (mcuHw), qPrintable (mcuFwVar), qPrintable (fpgaFw), + qPrintable (fpgaHw), qPrintable (bootVer)); + emit statusMessage ( + QStringLiteral ( + "RX PH[%1] Version: mcuFw=%2 mcuHw=%3 fpgaFw=%4 fpgaHw=%5 boot=%6") + .arg (phId) + .arg (mcuFw) + .arg (mcuHw) + .arg (fpgaFw) + .arg (fpgaHw) + .arg (bootVer)); + emit phVersionReceived (cid, phId, mcuFw, mcuHw, mcuFwVar, fpgaFw, fpgaHw, + bootVer); +} + /* ------------------------------------------------------------------ */ /* Internal */ /* ------------------------------------------------------------------ */ |
