diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-03-23 16:48:32 +0100 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-03-23 16:48:32 +0100 |
| commit | 8bcf948b76c9564cb38d3611228ccaf73890a548 (patch) | |
| tree | 5d7bc5aec767ff7911c067d1bc137f6905919c91 /jetting-interface/main.cpp | |
| parent | 61debe99a269bf7e87f6ba2f8d2a376e619fcf12 (diff) | |
| download | QtXpl2-8bcf948b76c9564cb38d3611228ccaf73890a548.tar.gz QtXpl2-8bcf948b76c9564cb38d3611228ccaf73890a548.zip | |
Rename demo/ → jetting-interface/, mock-server/ → mock-jetting-controller/
Executables: QtXpl2Demo → JettingInterfaceDemo, Xpl2MockServer → MockJettingController.
Dev log prefixes: "Demo" → "JI", "MockServer" → "MockJC". Window title → "Jetting Interface".
Diffstat (limited to 'jetting-interface/main.cpp')
| -rw-r--r-- | jetting-interface/main.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/jetting-interface/main.cpp b/jetting-interface/main.cpp new file mode 100644 index 0000000..b88bd37 --- /dev/null +++ b/jetting-interface/main.cpp @@ -0,0 +1,42 @@ +/** + * @file main.cpp + * @brief Entry point for the Jetting Interface demo application. + */ +#include "Xpl2Client.h" + +#include <QCommandLineParser> +#include <QGuiApplication> +#include <QQmlApplicationEngine> + +#include <QtQml/QQmlExtensionPlugin> +Q_IMPORT_QML_PLUGIN (Xpl2Plugin) + +int +main (int argc, char *argv[]) +{ + qSetMessagePattern ("JI [%{time HH:mm:ss.zzz}] %{message}"); + + QGuiApplication app (argc, 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); + + engine.loadFromModule ("JettingInterfaceDemo", "Main"); + return app.exec (); +} |
