diff --git a/src/components/widgets/toolhead/ToolheadCard.vue b/src/components/widgets/toolhead/ToolheadCard.vue index 842dcc39f4..62613471d0 100644 --- a/src/components/widgets/toolhead/ToolheadCard.vue +++ b/src/components/widgets/toolhead/ToolheadCard.vue @@ -224,16 +224,15 @@ export default class ToolheadCard extends Mixins(StateMixin, ToolheadMixin) { this.printerSettings.bltouch != null || this.printerSettings.smart_effector != null || this.printerSettings.cartographer != null || - ( - this.printerSettings.scanner != null && - 'sensor' in this.printerSettings.scanner && - this.printerSettings.scanner.sensor === 'cartographer' - ) || Object.keys(this.printerSettings) .some(x => x.startsWith('probe_eddy_current ')) ) } + get printerSupportsAxisTwistCompensationCalibrate (): boolean { + return this.printerSettings.axis_twist_compensation != null + } + get printerSupportsBeaconCalibrate (): boolean { return this.printerSettings.beacon != null } @@ -242,6 +241,13 @@ export default class ToolheadCard extends Mixins(StateMixin, ToolheadMixin) { return this.printerSettings.cartographer != null } + get printerSupportsCartographerAxisTwistCompensation (): boolean { + return ( + this.printerSettings.cartographer != null && + this.printerSettings.axis_twist_compensation != null + ) + } + get printerSupportsZEndstopCalibrate (): boolean { return ( this.printerSettings.stepper_z?.position_endstop != null @@ -338,6 +344,14 @@ export default class ToolheadCard extends Mixins(StateMixin, ToolheadMixin) { }) } + if (this.printerSupportsAxisTwistCompensationCalibrate) { + tools.push({ + name: 'AXIS_TWIST_COMPENSATION_CALIBRATE', + disabled: !this.allHomed || this.isManualProbeActive, + wait: this.$waits.onAxisTwistCompensationCalibrate + }) + } + if (this.printerSupportsBeaconCalibrate) { tools.push({ name: 'BEACON_AUTO_CALIBRATE', @@ -376,6 +390,14 @@ export default class ToolheadCard extends Mixins(StateMixin, ToolheadMixin) { }) } + if (this.printerSupportsCartographerAxisTwistCompensation) { + tools.push({ + name: 'CARTOGRAPHER_AXIS_TWIST_COMPENSATION', + disabled: !this.allHomed || this.isManualProbeActive, + wait: this.$waits.onCartographerAxisTwistCompensation + }) + } + if (this.printerSupportsDeltaCalibrate) { tools.push({ name: 'DELTA_CALIBRATE', diff --git a/src/globals.ts b/src/globals.ts index c03659fecc..c712b8738f 100644 --- a/src/globals.ts +++ b/src/globals.ts @@ -577,6 +577,7 @@ export const Waits = Object.freeze({ onHomeZ: 'onHomeZ', onQGL: 'onQGL', onZTilt: 'onZTilt', + onAxisTwistCompensationCalibrate: 'onAxisTwistCompensationCalibrate', onBedScrewsAdjust: 'onBedScrewAdjust', onDatabaseList: 'onDatabaseList', onDatabaseCompact: 'onDatabaseCompact', @@ -585,6 +586,7 @@ export const Waits = Object.freeze({ onDatabaseDeleteBackup: 'onDatabaseDeleteBackup', onBedScrewsCalculate: 'onBedScrewsCalculate', onBedTiltCalibrate: 'onBedTiltCalibrate', + onCartographerAxisTwistCompensation: 'onCartographerAxisTwistCompensation', onCartographerScanCalibrate: 'onCartographerScanCalibrate', onCartographerTouchCalibrate: 'onCartographerTouchCalibrate', onDeltaCalibrate: 'onDeltaCalibrate', diff --git a/src/typings/klipper.d.ts b/src/typings/klipper.d.ts index b46803d044..506b72aa8a 100644 --- a/src/typings/klipper.d.ts +++ b/src/typings/klipper.d.ts @@ -880,6 +880,8 @@ declare namespace Klipper { [key: `temperature_probe ${Lowercase}`]: TemperatureProbeSettings; + axis_twist_compensation: AxisTwistCompensationSettings; + safe_z_home: SafeZHomeSettings; z_tilt: ZTiltSettings; @@ -1163,6 +1165,19 @@ declare namespace Klipper { smooth_time: number; } + export interface AxisTwistCompensationSettings { + horizontal_move_z: number; + speed: number; + z_compensations: number[]; + zy_compensations: number[]; + calibrate_start_x?: number; + calibrate_end_x?: number; + calibrate_y?: number; + calibrate_start_y?: number; + calibrate_end_y?: number; + calibrate_x?: number; + } + export interface SafeZHomeSettings { home_xy_position: [number, number] z_hop: number;