aboutsummaryrefslogtreecommitdiffstats
path: root/demo/main.cpp
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-03-16 11:04:21 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-03-16 11:04:21 +0100
commit9ac64169720fb2b9852589b74f7300bcfebcaf62 (patch)
tree693e6582542c0c420cf521f42084d35c72ceff8f /demo/main.cpp
parent87169e10cb7ebe732ef388552bb0c057c09767ef (diff)
downloadQtXpl2-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 'demo/main.cpp')
-rw-r--r--demo/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/demo/main.cpp b/demo/main.cpp
index 3100254..e0651d9 100644
--- a/demo/main.cpp
+++ b/demo/main.cpp
@@ -20,13 +20,19 @@ main (int argc, char *argv[])
QCommandLineParser parser;
parser.addOption ({ "wire-debug", "Log raw wire TX/RX to dev log" });
+ parser.addOption ({ "printheads",
+ "Number of simulated printheads (default 10)", "N",
+ "10" });
parser.addHelpOption ();
parser.process (app);
if (parser.isSet ("wire-debug"))
Xpl2Client::enableWireDebug ();
+ int phCount = qBound (1, parser.value ("printheads").toInt (), 99);
+
QQmlApplicationEngine engine;
+ engine.setInitialProperties ({ { "demoPhCount", phCount } });
QObject::connect (
&engine, &QQmlApplicationEngine::objectCreationFailed, &app,
[] () { QCoreApplication::exit (1); }, Qt::QueuedConnection);