From 00b31c2d6147c256fcd9fc2bee961fee873c01ed Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Thu, 13 Nov 2025 10:06:40 +0000 Subject: [PATCH] fix: Cartographer simple integration Signed-off-by: Pedro Lamas --- .../widgets/toolhead/ToolheadCard.vue | 19 +++++++++++++++++++ src/globals.ts | 2 ++ src/store/printer/types.ts | 2 ++ 3 files changed, 23 insertions(+) diff --git a/src/components/widgets/toolhead/ToolheadCard.vue b/src/components/widgets/toolhead/ToolheadCard.vue index 813107a66e..cf9d63fada 100644 --- a/src/components/widgets/toolhead/ToolheadCard.vue +++ b/src/components/widgets/toolhead/ToolheadCard.vue @@ -223,6 +223,7 @@ export default class ToolheadCard extends Mixins(StateMixin, ToolheadMixin) { this.printerSettings.probe != null || this.printerSettings.bltouch != null || this.printerSettings.smart_effector != null || + this.printerSettings.cartographer != null || ( this.printerSettings.scanner != null && 'sensor' in this.printerSettings.scanner && @@ -233,6 +234,10 @@ export default class ToolheadCard extends Mixins(StateMixin, ToolheadMixin) { ) } + get printerSupportsCartographerCalibrate (): boolean { + return this.printerSettings.cartographer != null + } + get printerSupportsZEndstopCalibrate (): boolean { return ( this.printerSettings.stepper_z?.position_endstop != null @@ -345,6 +350,20 @@ export default class ToolheadCard extends Mixins(StateMixin, ToolheadMixin) { }) } + if (this.printerSupportsCartographerCalibrate) { + tools.push({ + name: 'CARTOGRAPHER_SCAN_CALIBRATE', + disabled: !this.allHomed || this.isManualProbeActive, + wait: this.$waits.onCartographerScanCalibrate + }) + + tools.push({ + name: 'CARTOGRAPHER_TOUCH_CALIBRATE', + disabled: !this.allHomed || this.isManualProbeActive, + wait: this.$waits.onCartographerTouchCalibrate + }) + } + if (this.printerSupportsDeltaCalibrate) { tools.push({ name: 'DELTA_CALIBRATE', diff --git a/src/globals.ts b/src/globals.ts index ff2fea440a..ba40240540 100644 --- a/src/globals.ts +++ b/src/globals.ts @@ -546,6 +546,8 @@ export const Waits = Object.freeze({ onDatabaseDeleteBackup: 'onDatabaseDeleteBackup', onBedScrewsCalculate: 'onBedScrewsCalculate', onBedTiltCalibrate: 'onBedTiltCalibrate', + onCartographerScanCalibrate: 'onCartographerScanCalibrate', + onCartographerTouchCalibrate: 'onCartographerTouchCalibrate', onDeltaCalibrate: 'onDeltaCalibrate', onPrintPause: 'onPrintPause', onPrintCancel: 'onPrintCancel', diff --git a/src/store/printer/types.ts b/src/store/printer/types.ts index 358726d168..35d0fa68ac 100644 --- a/src/store/printer/types.ts +++ b/src/store/printer/types.ts @@ -843,6 +843,8 @@ type KlipperPrinterSettingsBaseType = beacon: KlipperPrinterBeaconSettings; + cartographer: KlipperPrinterCartographerScannerSettings; + scanner: KlipperPrinterCartographerScannerSettings; [key: `beacon model ${Lowercase}`]: KlipperPrinterBeaconModelSettings;