aboutsummaryrefslogtreecommitdiffstats
path: root/jetting-interface
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-06-16 17:03:26 +0200
committerThomas Vanbesien <tvanbesi@proton.me>2026-06-16 17:03:26 +0200
commite90b28d8ccb9eedc19c23ebeb0129308a74e2865 (patch)
tree0cfdd646986c8ea8b2ecf325ac96fa909db5069a /jetting-interface
parentbf525d35301dcf0c612598f4394e4357b8378746 (diff)
downloadQtXpl2-reality-check.tar.gz
QtXpl2-reality-check.zip
fix: add workaround for turning all printheads on/offreality-check
Diffstat (limited to 'jetting-interface')
-rw-r--r--jetting-interface/CommandsPage.qml44
-rw-r--r--jetting-interface/Main.qml27
2 files changed, 57 insertions, 14 deletions
diff --git a/jetting-interface/CommandsPage.qml b/jetting-interface/CommandsPage.qml
index 5a084e6..5b466f0 100644
--- a/jetting-interface/CommandsPage.qml
+++ b/jetting-interface/CommandsPage.qml
@@ -163,12 +163,31 @@ ColumnLayout {
ColumnLayout {
anchors.fill: parent
- Button {
- text: "Get All PH Versions"
+ RowLayout {
+ Layout.fillWidth: true
+
+ Button {
+ text: "Get All PH Versions"
+
+ onClicked: {
+ for (let i = 0; i < commandsPage.phModel.count; ++i)
+ Xpl2Client.getPhVersion(commandsPage.phModel.get(i).phId);
+ }
+ }
+
+ // Working replacement for the broken Jetting All On/Off: the
+ // library self-probes versions then jets each available head by
+ // ID, even non-contiguous (see docs/DISCREPANCIES.md, D6).
+ Button {
+ text: "Jet On All Available"
+
+ onClicked: Xpl2Client.jettingAvailableOn()
+ }
- onClicked: {
- for (let i = 0; i < commandsPage.phModel.count; ++i)
- Xpl2Client.getPhVersion(commandsPage.phModel.get(i).phId);
+ Button {
+ text: "Jet Off All Available"
+
+ onClicked: Xpl2Client.jettingAvailableOff()
}
}
@@ -185,6 +204,7 @@ ColumnLayout {
required property int phId
required property string versionInfo
+ required property bool valid
width: ListView.view.width
@@ -200,6 +220,20 @@ ColumnLayout {
onClicked: Xpl2Client.getPhVersion(phDelegate.phId)
}
+ Button {
+ text: "Jet On"
+ enabled: phDelegate.valid
+
+ onClicked: Xpl2Client.phJettingOn(phDelegate.phId, "FFFFFFFFFFFF")
+ }
+
+ Button {
+ text: "Jet Off"
+ enabled: phDelegate.valid
+
+ onClicked: Xpl2Client.phJettingOff(phDelegate.phId)
+ }
+
Label {
Layout.fillWidth: true
elide: Text.ElideRight
diff --git a/jetting-interface/Main.qml b/jetting-interface/Main.qml
index cd69ed8..cd239bb 100644
--- a/jetting-interface/Main.qml
+++ b/jetting-interface/Main.qml
@@ -20,7 +20,8 @@ ApplicationWindow {
for (let i = 1; i <= root.demoPhCount; ++i)
phModel.append({
"phId": i,
- "versionInfo": ""
+ "versionInfo": "",
+ "valid": false
});
}
@@ -54,16 +55,24 @@ ApplicationWindow {
fpgaFirmwareVersion: string,
fpgaHardwareVersion: string,
bootloaderVersion: string) {
+ // A printhead is present only if it reports a non-zero version.
+ // Absent slots reply with all zeros; mcuHardwareVersion and
+ // mcuFirmwareVariant are "00" even on present heads, so they are
+ // excluded from the check (see docs/DISCREPANCIES.md).
+ let isZero = v => parseFloat(v) === 0 || v === "";
+ let valid = !(isZero(mcuFirmwareVersion) && isZero(fpgaFirmwareVersion)
+ && isZero(fpgaHardwareVersion) && isZero(bootloaderVersion));
+ let info = valid ? "MCU %1/%2 (%3) | FPGA %4/%5 | Boot %6".arg(
+ mcuFirmwareVersion).arg(
+ mcuHardwareVersion).arg(
+ mcuFirmwareVariant).arg(
+ fpgaFirmwareVersion).arg(
+ fpgaHardwareVersion).arg(
+ bootloaderVersion) : "(Printhead unavailable)";
for (let i = 0; i < phModel.count; ++i) {
if (phModel.get(i).phId === printheadId) {
- phModel.setProperty(i, "versionInfo",
- "MCU %1/%2 (%3) | FPGA %4/%5 | Boot %6".arg(
- mcuFirmwareVersion).arg(
- mcuHardwareVersion).arg(
- mcuFirmwareVariant).arg(
- fpgaFirmwareVersion).arg(
- fpgaHardwareVersion).arg(
- bootloaderVersion));
+ phModel.setProperty(i, "versionInfo", info);
+ phModel.setProperty(i, "valid", valid);
break;
}
}