From 592bc0f4fbb2555e9c30c07e6782d77a13b19fdf Mon Sep 17 00:00:00 2001 From: vajonam Date: Sat, 25 Nov 2023 14:01:42 +0000 Subject: [PATCH 01/42] feat: clircle control intial commit Signed-off-by: vajonam --- src/components/settings/ToolheadSettings.vue | 4 + src/components/widgets/toolhead/Toolhead.vue | 8 +- .../toolhead/ToolheadControlCircle.vue | 926 ++++++++++++++++++ src/locales/en.yaml | 1 + src/store/config/types.ts | 2 +- 5 files changed, 939 insertions(+), 2 deletions(-) create mode 100644 src/components/widgets/toolhead/ToolheadControlCircle.vue diff --git a/src/components/settings/ToolheadSettings.vue b/src/components/settings/ToolheadSettings.vue index 8aece56160..3ca4e5f1f9 100644 --- a/src/components/settings/ToolheadSettings.vue +++ b/src/components/settings/ToolheadSettings.vue @@ -440,6 +440,10 @@ export default class ToolHeadSettings extends Mixins(ToolheadMixin) { { value: 'bars', text: this.$t('app.general.label.bars') + }, + { + value: 'circle', + text: this.$t('app.general.label.cirlce') } ] } diff --git a/src/components/widgets/toolhead/Toolhead.vue b/src/components/widgets/toolhead/Toolhead.vue index a0e5fe6f70..3ba2ca451b 100644 --- a/src/components/widgets/toolhead/Toolhead.vue +++ b/src/components/widgets/toolhead/Toolhead.vue @@ -10,7 +10,11 @@ - + + @@ -45,6 +49,7 @@ import StateMixin from '@/mixins/state' import ToolheadMixin from '@/mixins/toolhead' import ToolheadControlCross from './ToolheadControlCross.vue' import ToolheadControlBars from './ToolheadControlBars.vue' +import ToolheadControlCircle from './ToolheadControlCircle.vue' import ExtruderMoves from './ExtruderMoves.vue' import ExtruderSelection from './ExtruderSelection.vue' import ToolheadPosition from './ToolheadPosition.vue' @@ -60,6 +65,7 @@ import type { ToolheadControlStyle } from '@/store/config/types' components: { ToolheadControlCross, ToolheadControlBars, + ToolheadControlCircle, ExtruderMoves, ExtruderSelection, ToolheadPosition, diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue new file mode 100644 index 0000000000..6147efe7c1 --- /dev/null +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -0,0 +1,926 @@ + + + diff --git a/src/locales/en.yaml b/src/locales/en.yaml index 71827365bb..39b0798eaa 100644 --- a/src/locales/en.yaml +++ b/src/locales/en.yaml @@ -247,6 +247,7 @@ app: command: Command confirm: Confirm cross: Cross + cirle: Circle current_password: Current password current_user: Current user default: Default diff --git a/src/store/config/types.ts b/src/store/config/types.ts index d4944ee0fd..218568af5f 100644 --- a/src/store/config/types.ts +++ b/src/store/config/types.ts @@ -94,7 +94,7 @@ export interface GeneralConfig { thumbnailSize: number; } -export type ToolheadControlStyle = 'cross' | 'bars' +export type ToolheadControlStyle = 'cross' | 'bars' | 'circle' export type TextSortOrder = 'default' | 'numeric-prefix' | 'version' From f6a89456151337d17aa2fa161a5d0a28f18d75d9 Mon Sep 17 00:00:00 2001 From: vajonam Date: Mon, 27 Nov 2023 00:11:14 +0000 Subject: [PATCH 02/42] fix: typo fix typo Signed-off-by: vajonam --- src/components/settings/ToolheadSettings.vue | 2 +- src/locales/en.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/settings/ToolheadSettings.vue b/src/components/settings/ToolheadSettings.vue index 3ca4e5f1f9..6abb30fb0d 100644 --- a/src/components/settings/ToolheadSettings.vue +++ b/src/components/settings/ToolheadSettings.vue @@ -443,7 +443,7 @@ export default class ToolHeadSettings extends Mixins(ToolheadMixin) { }, { value: 'circle', - text: this.$t('app.general.label.cirlce') + text: this.$t('app.general.label.circle') } ] } diff --git a/src/locales/en.yaml b/src/locales/en.yaml index 39b0798eaa..3fce7b61b1 100644 --- a/src/locales/en.yaml +++ b/src/locales/en.yaml @@ -247,7 +247,7 @@ app: command: Command confirm: Confirm cross: Cross - cirle: Circle + circle: Circle current_password: Current password current_user: Current user default: Default From 6967aa316f595a66fd4ba72b1cb5ca1ff74ef1dc Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Mon, 27 Nov 2023 01:39:43 +0000 Subject: [PATCH 03/42] feat: add settings for circle control Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- src/components/settings/ToolheadSettings.vue | 632 ++++++++++-------- .../toolhead/ToolheadControlCircle.vue | 108 ++- src/store/config/state.ts | 2 + src/store/config/types.ts | 2 + 4 files changed, 455 insertions(+), 289 deletions(-) diff --git a/src/components/settings/ToolheadSettings.vue b/src/components/settings/ToolheadSettings.vue index 6abb30fb0d..15ed7c449a 100644 --- a/src/components/settings/ToolheadSettings.vue +++ b/src/components/settings/ToolheadSettings.vue @@ -156,6 +156,54 @@ + + a - b), - server: true - }) - } - - get toolheadControlStyle () { - return this.$store.state.config.uiSettings.general.toolheadControlStyle - } - - set toolheadControlStyle (value: ToolheadControlStyle) { - this.$store.dispatch('config/saveByPath', { - path: 'uiSettings.general.toolheadControlStyle', - value, - server: true - }) - } - - get availableToolheadControlStyles () { - return [ - { - value: 'cross', - text: this.$t('app.general.label.cross') - }, - { - value: 'bars', - text: this.$t('app.general.label.bars') - }, - { - value: 'circle', - text: this.$t('app.general.label.circle') - } - ] - } - - get toolheadMoveDistances () { - return this.$store.state.config.uiSettings.general.toolheadMoveDistances - } - - set toolheadMoveDistances (value: (number | string)[]) { - if (!this.toolheadMoveDistancesElement.validate(true)) { - return - } - - this.$store.dispatch('config/saveByPath', { - path: 'uiSettings.general.toolheadMoveDistances', - value: [...new Set(value.map(Number))].sort((a, b) => a - b), - server: true - }) - } - - get toolheadXYMoveDistances () { - return this.$store.state.config.uiSettings.general.toolheadXYMoveDistances - } - - set toolheadXYMoveDistances (value: (number | string)[]) { - if (!this.toolheadXYMoveDistancesElement.validate(true)) { - return - } - - this.$store.dispatch('config/saveByPath', { - path: 'uiSettings.general.toolheadXYMoveDistances', - value: [...new Set(value.map(Number))].sort((a, b) => a - b), - server: true - }) - } - - get toolheadZMoveDistances () { - return this.$store.state.config.uiSettings.general.toolheadZMoveDistances - } - - set toolheadZMoveDistances (value: (number | string)[]) { - if (!this.toolheadZMoveDistancesElement.validate(true)) { - return - } - - this.$store.dispatch('config/saveByPath', { - path: 'uiSettings.general.toolheadZMoveDistances', - value: [...new Set(value.map(Number))].sort((a, b) => a - b), - server: true - }) - } - - get useGcodeCoords () { - return this.$store.state.config.uiSettings.general.useGcodeCoords - } - - set useGcodeCoords (value: boolean) { - this.$store.dispatch('config/saveByPath', { - path: 'uiSettings.general.useGcodeCoords', - value, - server: true - }) - } - - get invertX () { - return this.$store.state.config.uiSettings.general.axis.x.inverted - } - - set invertX (value: boolean) { - this.$store.dispatch('config/saveByPath', { - path: 'uiSettings.general.axis.x.inverted', - value, - server: true - }) - } - - get invertY () { - return this.$store.state.config.uiSettings.general.axis.y.inverted - } - - set invertY (value: boolean) { - this.$store.dispatch('config/saveByPath', { - path: 'uiSettings.general.axis.y.inverted', - value, - server: true - }) - } - - get invertZ () { - return this.$store.state.config.uiSettings.general.axis.z.inverted - } - - set invertZ (value: boolean) { - this.$store.dispatch('config/saveByPath', { - path: 'uiSettings.general.axis.z.inverted', - value, - server: true - }) - } - - get printerSupportsForceMove () { - return this.$store.getters['printer/getPrinterSettings']('force_move.enable_force_move') ?? false - } - - get printerSupportsSpoolman () { - return this.$store.getters['spoolman/getSupported'] - } - - get showManualProbeDialogAutomatically () { - return this.$store.state.config.uiSettings.general.showManualProbeDialogAutomatically - } - - set showManualProbeDialogAutomatically (value: boolean) { - this.$store.dispatch('config/saveByPath', { - path: 'uiSettings.general.showManualProbeDialogAutomatically', - value, - server: true - }) - } - - get showBedScrewsAdjustDialogAutomatically () { - return this.$store.state.config.uiSettings.general.showBedScrewsAdjustDialogAutomatically - } - - set showBedScrewsAdjustDialogAutomatically (value: boolean) { - this.$store.dispatch('config/saveByPath', { - path: 'uiSettings.general.showBedScrewsAdjustDialogAutomatically', - value, - server: true - }) - } - - get showScrewsTiltAdjustDialogAutomatically () { - return this.$store.state.config.uiSettings.general.showScrewsTiltAdjustDialogAutomatically - } - - set showScrewsTiltAdjustDialogAutomatically (value: boolean) { - this.$store.dispatch('config/saveByPath', { - path: 'uiSettings.general.showScrewsTiltAdjustDialogAutomatically', - value, - server: true - }) - } - - get forceMoveToggleWarning () { - return this.$store.state.config.uiSettings.general.forceMoveToggleWarning - } - - set forceMoveToggleWarning (value: boolean) { - this.$store.dispatch('config/saveByPath', { - path: 'uiSettings.general.forceMoveToggleWarning', - value, - server: true - }) - } - - handleReset () { - let value = defaultState().uiSettings.general - const current = this.$store.state.config.uiSettings.general - value = { - ...value, - instanceName: current.instanceName, - chartVisible: current.chartVisible, - hideTempWaits: current.hideTempWaits - } - this.$store.dispatch('config/saveByPath', { - path: 'uiSettings.general', - value, - server: true - }) - } + get defaultExtrudeSpeed () { + return this.$store.state.config.uiSettings.general.defaultExtrudeSpeed + } + + setDefaultExtrudeSpeed (value: string) { + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.defaultExtrudeSpeed', + value: +value, + server: true + }) + } + + get defaultExtrudeLength () { + return this.$store.state.config.uiSettings.general.defaultExtrudeLength + } + + setDefaultExtrudeLength (value: number) { + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.defaultExtrudeLength', + value: +value, + server: true + }) + } + + get defaultToolheadMoveLength () { + return this.$store.state.config.uiSettings.general.defaultToolheadMoveLength + } + + setDefaultToolheadMoveLength (value: number) { + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.defaultToolheadMoveLength', + value: +value, + server: true + }) + } + + get defaultToolheadXYSpeed () { + return this.$store.state.config.uiSettings.general.defaultToolheadXYSpeed + } + + setDefaultToolheadYXSpeed (value: number) { + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.defaultToolheadXYSpeed', + value: +value, + server: true + }) + } + + get defaultToolheadZSpeed () { + return this.$store.state.config.uiSettings.general.defaultToolheadZSpeed + } + + setDefaultToolheadZSpeed (value: number) { + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.defaultToolheadZSpeed', + value: +value, + server: true + }) + } + + get zAdjustValues () { + return this.$store.state.config.uiSettings.general.zAdjustDistances + } + + set zAdjustValues (value: (number | string)[]) { + if (!this.zAdjustValuesElement.validate(true)) { + return + } + + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.zAdjustDistances', + value: [...new Set(value.map(Number))].sort((a, b) => a - b), + server: true + }) + } + + get toolheadControlStyle () { + return this.$store.state.config.uiSettings.general.toolheadControlStyle + } + + set toolheadControlStyle (value: ToolheadControlStyle) { + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.toolheadControlStyle', + value, + server: true + }) + } + + get availableToolheadControlStyles () { + return [ + { + value: 'cross', + text: this.$t('app.general.label.cross') + }, + { + value: 'bars', + text: this.$t('app.general.label.bars') + }, + { + value: 'circle', + text: this.$t('app.general.label.circle') + } + ] + } + + get toolheadMoveDistances () { + return this.$store.state.config.uiSettings.general.toolheadMoveDistances + } + + set toolheadMoveDistances (value: (number | string)[]) { + if (!this.toolheadMoveDistancesElement.validate(true)) { + return + } + + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.toolheadMoveDistances', + value: [...new Set(value.map(Number))].sort((a, b) => a - b), + server: true + }) + } + + get toolheadXYMoveDistances () { + return this.$store.state.config.uiSettings.general.toolheadXYMoveDistances + } + + set toolheadXYMoveDistances (value: (number | string)[]) { + if (!this.toolheadXYMoveDistancesElement.validate(true)) { + return + } + + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.toolheadXYMoveDistances', + value: [...new Set(value.map(Number))].sort((a, b) => a - b), + server: true + }) + } + + get toolheadCircleXYMoveDistances () { + return this.$store.state.config.uiSettings.general.toolheadCircleXYMoveDistances + } + + set toolheadCircleXYMoveDistances (value: (number | string)[]) { + if (!this.toolheadCircleXYMoveDistancesElement.validate(true)) { + return + } + + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.toolheadCircleXYMoveDistances', + value: [...new Set(value.map(Number))].sort((a, b) => a - b), + server: true + }) + } + + get toolheadZMoveDistances () { + return this.$store.state.config.uiSettings.general.toolheadZMoveDistances + } + + set toolheadZMoveDistances (value: (number | string)[]) { + if (!this.toolheadZMoveDistancesElement.validate(true)) { + return + } + + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.toolheadZMoveDistances', + value: [...new Set(value.map(Number))].sort((a, b) => a - b), + server: true + }) + } + + get toolheadCircleZMoveDistances () { + return this.$store.state.config.uiSettings.general.toolheadCircleZMoveDistances + } + + set toolheadCircleZMoveDistances (value: (number | string)[]) { + if (!this.toolheadCircleZMoveDistancesElement.validate(true)) { + return + } + + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.toolheadCircleZMoveDistances', + value: [...new Set(value.map(Number))].sort((a, b) => a - b), + server: true + }) + } + + get useGcodeCoords () { + return this.$store.state.config.uiSettings.general.useGcodeCoords + } + + set useGcodeCoords (value: boolean) { + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.useGcodeCoords', + value, + server: true + }) + } + + get invertX () { + return this.$store.state.config.uiSettings.general.axis.x.inverted + } + + set invertX (value: boolean) { + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.axis.x.inverted', + value, + server: true + }) + } + + get invertY () { + return this.$store.state.config.uiSettings.general.axis.y.inverted + } + + set invertY (value: boolean) { + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.axis.y.inverted', + value, + server: true + }) + } + + get invertZ () { + return this.$store.state.config.uiSettings.general.axis.z.inverted + } + + set invertZ (value: boolean) { + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.axis.z.inverted', + value, + server: true + }) + } + + get printerSupportsForceMove () { + return this.$store.getters['printer/getPrinterSettings']('force_move.enable_force_move') ?? false + } + + get printerSupportsSpoolman () { + return this.$store.getters['spoolman/getSupported'] + } + + get showManualProbeDialogAutomatically () { + return this.$store.state.config.uiSettings.general.showManualProbeDialogAutomatically + } + + set showManualProbeDialogAutomatically (value: boolean) { + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.showManualProbeDialogAutomatically', + value, + server: true + }) + } + + get showBedScrewsAdjustDialogAutomatically () { + return this.$store.state.config.uiSettings.general.showBedScrewsAdjustDialogAutomatically + } + + set showBedScrewsAdjustDialogAutomatically (value: boolean) { + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.showBedScrewsAdjustDialogAutomatically', + value, + server: true + }) + } + + get showScrewsTiltAdjustDialogAutomatically () { + return this.$store.state.config.uiSettings.general.showScrewsTiltAdjustDialogAutomatically + } + + set showScrewsTiltAdjustDialogAutomatically (value: boolean) { + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.showScrewsTiltAdjustDialogAutomatically', + value, + server: true + }) + } + + get forceMoveToggleWarning () { + return this.$store.state.config.uiSettings.general.forceMoveToggleWarning + } + + set forceMoveToggleWarning (value: boolean) { + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general.forceMoveToggleWarning', + value, + server: true + }) + } + + handleReset () { + let value = defaultState().uiSettings.general + const current = this.$store.state.config.uiSettings.general + value = { + ...value, + instanceName: current.instanceName, + chartVisible: current.chartVisible, + hideTempWaits: current.hideTempWaits + } + this.$store.dispatch('config/saveByPath', { + path: 'uiSettings.general', + value, + server: true + }) + } } diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 6147efe7c1..9a9ec75b7c 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -710,32 +710,32 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } get stepTextClass () { - // if (!this.homedAxes.includes('xy') || this.isPrinting) return ['disabled'] + if (!this.homedAxes.includes('xy') || this.isPrinting) return ['disabled'] return [] } get xStepClass () { - // if (!this.homedAxes.includes('x') || this.isPrinting) return ['disabled'] + if (!this.homedAxes.includes('x') || this.isPrinting) return ['disabled'] return [] } get yStepClass () { - // if (!this.homedAxes.includes('y') || this.isPrinting) return ['disabled'] + if (!this.homedAxes.includes('y') || this.isPrinting) return ['disabled'] return [] } get zStepClass () { - // if (!this.homedAxes.includes('z') || this.isPrinting) return ['disabled'] + if (!this.homedAxes.includes('z') || this.isPrinting) return ['disabled'] return [] } get xHomeClass () { const classes = [] - // if (this.homedAxes.includes('x')) classes.push('homed') + if (this.homedAxes.includes('x')) classes.push('homed') if (this.isPrinting) classes.push('disabled') return classes @@ -743,7 +743,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi get yHomeClass () { const classes = [] - // if (this.homedAxes.includes('y')) classes.push('homed') + if (this.homedAxes.includes('y')) classes.push('homed') if (this.isPrinting) classes.push('disabled') return classes @@ -751,7 +751,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi get xyHomeClass () { const classes = [] - // if (this.homedAxes.includes('xy')) classes.push('homed') + if (this.homedAxes.includes('xy')) classes.push('homed') if (this.isPrinting) classes.push('disabled') return classes @@ -759,7 +759,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi get xyzHomeClass () { const classes = [] - // if (this.homedAxes.includes('xyz')) classes.push('homed') + if (this.homedAxes.includes('xyz')) classes.push('homed') if (this.isPrinting) classes.push('disabled') return classes @@ -767,7 +767,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi get zHomeClass () { const classes = [] - // if (this.homedAxes.includes('z')) classes.push('homed') + if (this.homedAxes.includes('z')) classes.push('homed') if (this.isPrinting) classes.push('disabled') return classes @@ -776,15 +776,15 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi get colorSpecialButton () { const classes = [] if (this.isPrinting) classes.push('disabled') - // if (this.existsQGL) classes.push(this.colorQuadGantryLevel) - // else if (this.existsZtilt) classes.push(this.colorZTilt) + if (this.existsQGL) classes.push(this.colorQuadGantryLevel) + else if (this.existsZtilt) classes.push(this.colorZTilt) return classes } get motorsOffClass () { const classes = [] - // classes.push(this.homedAxes !== '' ? 'primary' : 'warning') + classes.push(this.homedAxes !== '' ? 'primary' : 'warning') if (this.isPrinting) classes.push('disabled') return classes @@ -798,6 +798,82 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi // if (this.existsQGL) this.doQGL() // else if (this.existsZtilt) return this.doZtilt() } + + get absolute_coordinates () { + return this.$store.state.printer?.gcode_move?.absolute_coordinates ?? true + } + + get feedrateXY () { + return this.$store.state.gui.control?.feedrateXY ?? 100 + } + + get feedrateZ () { + return this.$store.state.gui.control?.feedrateZ ?? 10 + } + + get existsQGL () { + return this.$store.getters['printer/existsQGL'] + } + + get existsZtilt () { + return this.$store.getters['printer/existsZtilt'] + } + + get existsBedTilt () { + return this.$store.getters['printer/existsBedTilt'] + } + + get existsBedScrews () { + return this.$store.getters['printer/existsBedScrews'] + } + + get existsDeltaCalibrate () { + return this.$store.getters['printer/existsDeltaCalibrate'] + } + + get existsScrewsTilt () { + return this.$store.getters['printer/existsScrewsTilt'] + } + + get existsFirmwareRetraction (): boolean { + return this.$store.getters['printer/existsFirmwareRetraction'] + } + + get colorQuadGantryLevel () { + const status = this.$store.state.printer.quad_gantry_level?.applied ?? true + + return status ? 'primary' : 'warning' + } + + get colorZTilt () { + const status = this.$store.state.printer.z_tilt?.applied ?? true + + return status ? 'primary' : 'warning' + } + + get defaultActionButton () { + return this.$store.getters['gui/getDefaultControlActionButton'] + } + + /** + * Axes home states + */ + + get homedAxes (): string { + return this.$store.state.printer?.toolhead?.homed_axes ?? '' + } + + get xAxisHomed (): boolean { + return this.homedAxes.includes('x') + } + + get yAxisHomed (): boolean { + return this.homedAxes.includes('y') + } + + get zAxisHomed (): boolean { + return this.homedAxes.includes('z') + } } From 92856a5e9724b81288d58fe78295db7bc631024e Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:00:44 +0000 Subject: [PATCH 07/42] fix: add attribution to original code. Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- src/components/widgets/toolhead/ToolheadControlCircle.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 8bb0a497ff..91dd496b6f 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -621,6 +621,9 @@ import StateMixin from '@/mixins/state' import ToolheadMixin from '@/mixins/toolhead' import { SocketActions } from '@/api/socketActions' +// heavly adapted from https://github.com/mainsail-crew/mainsail/blob/develop/src/components/panels/ToolheadControls/CrossControl.vue +// modified to work with fluidd concepts. + @Component({}) export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMixin) { /** From fb1e4ba9d004d97ae92e5cd82a5328d65d701b42 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:04:02 +0000 Subject: [PATCH 08/42] fix: remove animations, will add them in later. Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- .../toolhead/ToolheadControlCircle.vue | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 91dd496b6f..7b2b699d81 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -1061,30 +1061,4 @@ svg a#stepper_off #stepper_off_icon { fill: #000; } -$randomNumber: random(2); - -@keyframes rotate { - 0% { - transform: rotate(0); - } - 100% { - transform: rotate(370deg); - } -} - -@keyframes dash { - 0% { - stroke-dasharray: 1, 150; - stroke-dashoffset: 0; - } - 50% { - stroke-dasharray: 90, 150; - stroke-dashoffset: -35; - } - 100% { - stroke-dasharray: 90, 150; - stroke-dashoffset: -124; - } -} - From 5f6ab87fc9098e6853dba26b82ecb5119c2dee60 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:12:41 +0000 Subject: [PATCH 09/42] fix: add waits to the correct objects! Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- src/components/widgets/toolhead/ToolheadControlCircle.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 7b2b699d81..a1d794a1b9 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -821,8 +821,8 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } clickSpecialButton () { - if (this.printerSupportsQuadGantryLevel) this.sendGcode('QUAD_GANTRY_LEVEL') - else if (this.printerSupportsZTiltAdjust) return this.sendGcode('Z_TILT_ADJUST') + if (this.printerSupportsQuadGantryLevel) this.sendGcode('QUAD_GANTRY_LEVEL', this.$waits.onQGL) + else if (this.printerSupportsZTiltAdjust) return this.sendGcode('Z_TILT_ADJUST', this.$waits.onZTilt) } sendGcode (gcode: string, wait?: string) { From b3625cc94399b3adb9413db8d0caa81190089e7c Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:27:09 +0000 Subject: [PATCH 10/42] fix: need exactly 4 for the cricle control. so append rules Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- src/components/settings/ToolheadSettings.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/settings/ToolheadSettings.vue b/src/components/settings/ToolheadSettings.vue index 9df31ffd4c..c5da9c277d 100644 --- a/src/components/settings/ToolheadSettings.vue +++ b/src/components/settings/ToolheadSettings.vue @@ -146,7 +146,7 @@ append-icon="" deletable-chips :rules="[ - $rules.lengthGreaterThanOrEqual(1), + $rules.lengthGreaterThanOrEqual(4), $rules.lengthLessThanOrEqual(3), $rules.numberArrayValid ]" @@ -171,7 +171,7 @@ append-icon="" deletable-chips :rules="[ - $rules.lengthGreaterThanOrEqual(1), + $rules.lengthGreaterThanOrEqual(4), $rules.lengthLessThanOrEqual(4), $rules.numberArrayValid ]" From 40edf4276eb9b44f075b8840d3d34de45f9c3584 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Mon, 27 Nov 2023 15:28:58 +0000 Subject: [PATCH 11/42] fix: fix it in the right spot! Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- src/components/settings/ToolheadSettings.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/settings/ToolheadSettings.vue b/src/components/settings/ToolheadSettings.vue index c5da9c277d..27a6a23800 100644 --- a/src/components/settings/ToolheadSettings.vue +++ b/src/components/settings/ToolheadSettings.vue @@ -146,7 +146,7 @@ append-icon="" deletable-chips :rules="[ - $rules.lengthGreaterThanOrEqual(4), + $rules.lengthGreaterThanOrEqual(1), $rules.lengthLessThanOrEqual(3), $rules.numberArrayValid ]" @@ -194,7 +194,7 @@ append-icon="" deletable-chips :rules="[ - $rules.lengthGreaterThanOrEqual(1), + $rules.lengthGreaterThanOrEqual(4), $rules.lengthLessThanOrEqual(4), $rules.numberArrayValid ]" From 5eaf8df25448468c855677b39b69d720a55f77a3 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Mon, 27 Nov 2023 20:52:39 +0000 Subject: [PATCH 12/42] feat: add center toolhead on bed icon - when not using XY homing there is room on the center icon, this allows centering of the toolhead in X and Y over the bed. Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- .../toolhead/ToolheadControlCircle.vue | 67 ++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index a1d794a1b9..2aee6a9cf2 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -193,6 +193,45 @@ + + + + + + + + + + + + Date: Mon, 27 Nov 2023 20:57:48 +0000 Subject: [PATCH 13/42] fix: clean up paths for icons Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- src/components/widgets/toolhead/ToolheadControlCircle.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 2aee6a9cf2..c8ea2b569b 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -217,13 +217,13 @@ fill="none" > Date: Mon, 27 Nov 2023 22:02:43 +0000 Subject: [PATCH 14/42] fix: for unhomed access but when toolhead is centered, switch back to warning color Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- src/components/widgets/toolhead/ToolheadControlCircle.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index c8ea2b569b..33ddb2ca6b 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -836,7 +836,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi const tool_pos = this.$store.state.printer.printer.toolhead.position const bedSize = this.$store.getters['printer/getBedSize'] as BedSize const classes = [] - if ((tool_pos[0] === bedSize.maxX / 2) && (tool_pos[1] === bedSize.maxY / 2)) classes.push('homed') + if ((tool_pos[0] === bedSize.maxX / 2) && (tool_pos[1] === bedSize.maxY / 2) && this.homedAxes.includes('y') && this.homedAxes.includes('x')) classes.push('homed') if (this.isPrinting) classes.push('disabled') if (this.hasWait([this.$waits.onHomeX, this.$waits.onHomeXY, this.$waits.onHomeZ, this.$waits.onHomeY, this.$waits.onHomeAll])) classes.push('loading') From aa7acb8b455e131d792bcaeadecbeab3f0ad8246 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Tue, 28 Nov 2023 14:07:49 +0000 Subject: [PATCH 15/42] fix: when not connected bedsize is missing so fixes console errors Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- src/components/widgets/toolhead/ToolheadControlCircle.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 33ddb2ca6b..03c689b085 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -836,7 +836,9 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi const tool_pos = this.$store.state.printer.printer.toolhead.position const bedSize = this.$store.getters['printer/getBedSize'] as BedSize const classes = [] - if ((tool_pos[0] === bedSize.maxX / 2) && (tool_pos[1] === bedSize.maxY / 2) && this.homedAxes.includes('y') && this.homedAxes.includes('x')) classes.push('homed') + if (bedSize) { + if ((tool_pos[0] === bedSize.maxX / 2) && (tool_pos[1] === bedSize.maxY / 2) && this.homedAxes.includes('y') && this.homedAxes.includes('x')) classes.push('homed') + } if (this.isPrinting) classes.push('disabled') if (this.hasWait([this.$waits.onHomeX, this.$waits.onHomeXY, this.$waits.onHomeZ, this.$waits.onHomeY, this.$waits.onHomeAll])) classes.push('loading') From a6c1b33ee0aceef6100ab983f0539584e159cb56 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Tue, 28 Nov 2023 14:15:10 +0000 Subject: [PATCH 16/42] fix: disable when not homed Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- src/components/widgets/toolhead/ToolheadControlCircle.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 03c689b085..70f2202a43 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -839,6 +839,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi if (bedSize) { if ((tool_pos[0] === bedSize.maxX / 2) && (tool_pos[1] === bedSize.maxY / 2) && this.homedAxes.includes('y') && this.homedAxes.includes('x')) classes.push('homed') } + if (!this.homedAxes.includes('xy')) classes.push('disabled') if (this.isPrinting) classes.push('disabled') if (this.hasWait([this.$waits.onHomeX, this.$waits.onHomeXY, this.$waits.onHomeZ, this.$waits.onHomeY, this.$waits.onHomeAll])) classes.push('loading') From eeb6e82bc5472ace52f866408526f1a1df21d8ce Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Tue, 28 Nov 2023 15:13:30 +0000 Subject: [PATCH 17/42] refactor: cleanup SVG control Signed-off-by: Pedro Lamas --- .../toolhead/ToolheadControlCircle.vue | 266 ++++++++---------- 1 file changed, 118 insertions(+), 148 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 70f2202a43..ee82c1d002 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -7,30 +7,73 @@ height="100%" viewBox="0 0 78 62" xmlns="http://www.w3.org/2000/svg" - xml:space="preserve" style="fill-rule: evenodd; clip-rule: evenodd; stroke-linejoin: round; stroke-miterlimit: 2" > - - + + + + + + + + + + + + + + + - > - + - + > @@ -75,7 +115,7 @@ class="home_button" transform="matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)" > - + - + - + - + - + - + - + - + - + @@ -273,23 +298,23 @@ > - + + + - - + + - + - + - + - + - + - + @@ -350,7 +375,7 @@ @@ -394,14 +419,14 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -547,7 +572,7 @@ QGL - - + + Z-TILT - - + + - + @@ -666,61 +691,6 @@ import type { BedSize } from '@/store/printer/types' @Component({}) export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMixin) { - /** - * SVG paths for home buttons - */ - centerIcon1 = 'M15 12L12 12M12 12L9 12M12 12L12 9M12 12L12 15' - centerIcon2 = 'M22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C21.5093 4.43821 21.8356 5.80655 21.9449 8' - homeIcon = 'M10,20L10,14L14,14L14,20L19,20L19,12L22,12L12,3L2,12L5,12L5,20L10,20Z' - pathHomeButtonTop = - 'M9.188,-0C9.634,0.001 10.028,0.291 10.162,0.717C10.295,1.142 10.136,1.605 9.77,1.86C6.722,4.035 4.05,6.701 1.869,9.743C1.614,10.11 1.151,10.269 0.724,10.135C0.298,10.002 0.008,9.607 0.008,9.16C0,6.418 0,2.781 0,1.029C-0,0.756 0.108,0.495 0.302,0.302C0.495,0.108 0.756,-0 1.029,0L9.188,-0Z' - - pathHomeButtonBottom = - 'M9.188,0C9.634,0.001 10.028,0.291 10.162,0.717C10.295,1.142 10.136,1.605 9.77,1.86C6.722,4.035 4.05,6.701 1.869,9.743C1.614,10.11 1.151,10.269 0.724,10.135C0.298,10.002 0.008,9.607 0.008,9.16C0,6.418 0,2.781 0,1.029C-0,0.756 0.108,0.495 0.302,0.302C0.495,0.108 0.756,-0 1.029,0L9.188,0Z' - - /** - * SVG paths for XY steps - */ - xyStepOuter = - 'M43.181,8.535C43.262,8.453 43.373,8.409 43.488,8.412C43.602,8.415 43.711,8.466 43.787,8.551C47.661,12.933 50,18.695 50,25C50,31.291 47.672,37.042 43.811,41.42C43.735,41.505 43.627,41.556 43.512,41.559C43.398,41.562 43.287,41.518 43.206,41.437C42.343,40.575 39.981,38.213 39.981,38.213C43.11,34.7 45,30.069 45,25C45,19.918 43.1,15.276 39.956,11.759C39.956,11.759 42.319,9.397 43.181,8.535Z' - - xyStepOuterMid = - 'M47.418,4.777C57.663,18.688 57.829,31.029 47.304,45.072L39.308,37.098C42.081,33.838 43.75,29.612 43.75,25C43.75,20.371 42.069,16.132 39.277,12.868L47.418,4.777Z' - - xyStepInnerMid = - 'M54.897,-1.964C68.991,16.277 68.542,32.764 54.738,51.763L44.077,41.131L38.115,35.169C40.361,32.389 41.667,28.846 41.667,25C41.667,21.132 40.346,17.57 38.076,14.784L54.897,-1.964Z' - - xyStepInner = - 'M36.096,19.243C35.88,18.839 35.954,18.342 36.278,18.019C40.686,13.619 69.84,-15.445 69.84,-15.445C90.891,13.786 89.845,38.467 69.564,65.144C69.564,65.144 40.684,36.265 36.318,31.899C35.996,31.576 35.922,31.081 36.134,30.678C37.008,28.975 37.5,27.044 37.5,25C37.5,22.925 36.993,20.967 36.096,19.243Z' - - /** - * SVG paths for Z steps - */ - zStepOuter = - 'M66.037,2.5C66.037,1.672 66.709,1 67.537,1L74.537,1C75.365,1 76.037,1.672 76.037,2.5L76.037,7.521C74.428,7.179 72.759,7 71.048,7C69.33,7 67.654,7.181 66.037,7.525L66.037,2.5Z' - - zStepOuterMid = - 'M66.037,7.221C69.367,6.597 72.7,6.583 76.037,7.192L76.037,13.702C74.453,13.245 72.778,13 71.048,13C69.309,13 67.627,13.247 66.037,13.708L66.037,7.221Z' - - zStepInnerMid = - 'M66.037,13.244C69.353,12.66 72.687,12.7 76.037,13.355L76.037,20.099C74.523,19.39 72.831,19 71.048,19C69.256,19 67.556,19.393 66.037,20.109L66.037,13.244Z' - - zStepInner = - 'M66.037,19.186C69.409,18.542 72.742,18.52 76.037,19.102L76.037,23.682C76.037,23.815 75.984,23.942 75.891,24.036C75.564,24.362 74.774,25.153 74.359,25.567C74.204,25.722 73.967,25.757 73.773,25.656C72.955,25.236 72.029,25 71.048,25C70.051,25 69.112,25.243 68.284,25.674C68.09,25.777 67.852,25.742 67.697,25.586C67.283,25.175 66.506,24.395 66.183,24.071C66.09,23.977 66.037,23.85 66.037,23.718C66.037,22.806 66.037,19.186 66.037,19.186Z' - - /** - * SVG path for Z Tilt icon - */ - zTiltIcon1 = 'M74.189,31.503L67.751,30.009L67.638,30.496L74.076,31.99L74.189,31.503Z' - zTiltIcon2 = - 'M74.361,32.85L74.034,32.676L74.939,32.188L75.039,33.211L74.745,33.055C74.386,33.724 73.858,34.288 73.213,34.69L72.983,34.321C73.563,33.959 74.038,33.452 74.361,32.85ZM67.193,28.75C67.586,28.1 68.142,27.564 68.807,27.196L69.018,27.576C68.42,27.907 67.919,28.389 67.565,28.974L67.883,29.165L66.954,29.605L66.907,28.578L67.193,28.75Z' - - /** - * SVG path for engine off icon - */ - engineOffIcon = - 'M3.78 2.5L21.5 20.22l-1.27 1.28L18 19.27V20h-8l-2-2H5v-3H3v3H1v-8h2v3h2v-3l1.87-1.86L2.5 3.77L3.78 2.5M20 9v3h-2V8h-6V6h3V4H7.82l15 15H23V9h-3Z' - get actionButton (): string { return this.$store.state.gui.control.actionButton // ?? this.defaultActionButton } From 6570f885797f56f3b896e48802604d4bd50381c5 Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Tue, 28 Nov 2023 15:33:18 +0000 Subject: [PATCH 18/42] refactor: cleanup SVG control (cont.) Signed-off-by: Pedro Lamas --- .../toolhead/ToolheadControlCircle.vue | 159 ++++++++++-------- 1 file changed, 85 insertions(+), 74 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index ee82c1d002..c1cc32802d 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -71,7 +71,7 @@ > > @@ -134,7 +134,7 @@ @@ -419,7 +419,7 @@ - From 7745c203b0e4d61ce3c028af9c9770232a95f7c8 Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Tue, 28 Nov 2023 15:45:07 +0000 Subject: [PATCH 19/42] fix: adds missing divider on settings Signed-off-by: Pedro Lamas --- src/components/settings/ToolheadSettings.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/settings/ToolheadSettings.vue b/src/components/settings/ToolheadSettings.vue index 27a6a23800..9daebf2949 100644 --- a/src/components/settings/ToolheadSettings.vue +++ b/src/components/settings/ToolheadSettings.vue @@ -210,6 +210,8 @@ class="mt-0 mb-4" /> + + From 7480f31d7dba7ba04ca9ff7278878947023f650c Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Tue, 28 Nov 2023 15:47:15 +0000 Subject: [PATCH 20/42] fix: change default toolhead xy move distances Signed-off-by: Pedro Lamas --- src/store/config/state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/config/state.ts b/src/store/config/state.ts index 7187d1b4d0..7f2bb9efed 100644 --- a/src/store/config/state.ts +++ b/src/store/config/state.ts @@ -33,7 +33,7 @@ export const defaultState = (): ConfigState => { toolheadControlStyle: 'cross', toolheadMoveDistances: [0.1, 1, 10, 25, 50, 100], toolheadXYMoveDistances: [1, 10, 50], - toolheadCircleXYMoveDistances: [0.1, 1, 10, 50], + toolheadCircleXYMoveDistances: [1, 10, 25, 50], toolheadZMoveDistances: [0.1, 1, 10], toolheadCircleZMoveDistances: [0.1, 1, 10, 50], useGcodeCoords: false, From 2b0cff7aa483d7ab74025949f24adccc6d744ea6 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:04:59 +0000 Subject: [PATCH 21/42] fix: begin to simplify svg selection for applying colors. Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- .../toolhead/ToolheadControlCircle.vue | 73 ++++++++++--------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index c1cc32802d..1911693bd3 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -87,12 +87,13 @@ X @@ -119,6 +120,7 @@ Y @@ -150,12 +152,13 @@ Z @@ -182,12 +185,13 @@ XY @@ -213,7 +217,7 @@ @@ -239,20 +243,18 @@ /> @@ -278,7 +280,7 @@ /> @@ -1039,18 +1041,6 @@ svg a#tilt_adjust text { display: none; } -svg g#home_buttons text { - font-family: 'Roboto-Regular', 'Roboto', sans-serif; - font-size: 5px; - fill: black; -} - -svg g.home_button, -svg a#home_all_center { - fill: var(--v-warning-lighten3); - transition: opacity 250ms; -} - svg a.disabled { pointer-events: none; } @@ -1070,9 +1060,36 @@ svg a#stepper_off { transition: opacity 250ms; } +svg g.home_button, +svg a#home_all_center, svg a#tilt_adjust.warning, svg a#stepper_off.warning { - fill: var(--v-warning-lighten3); + fill: var(--v-btncolor-base); + transition: opacity 250ms; +} + +svg a#tilt_adjust #tilt_icon, +svg a#stepper_off #stepper_off_icon { + fill: white; // TODO: change to fg color + stroke: none; +} + +svg g#icon.center_icon { + fill: none; + stroke: white +} +svg g#icon.home_icon + { + fill: white; + stroke: white; + transition: opacity 250ms; +} + +svg g#home_buttons text { + font-family: 'Roboto-Regular', 'Roboto', sans-serif; + font-size: 5px; + fill: white; + stroke: white; } svg a#tilt_adjust.primary, @@ -1100,16 +1117,4 @@ svg a#stepper_off:hover { opacity: 0.8; } -svg a#tilt_adjust text, -svg a#tilt_adjust #tilt_icon, -svg a#stepper_off #stepper_off_icon, -svg g#home_buttons .home_icon { - pointer-events: none; - user-select: none; -} - -svg a#tilt_adjust #tilt_icon, -svg a#stepper_off #stepper_off_icon { - fill: #000; -} From 14a87cca7912d5861cf5ff63b8a809f059f73627 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:43:27 +0000 Subject: [PATCH 22/42] fix: clean up some SVG and make it easier to understand! I hope! Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- .../toolhead/ToolheadControlCircle.vue | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 1911693bd3..6442814662 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -1092,6 +1092,58 @@ svg g#home_buttons text { stroke: white; } +svg g#icon.center_icon { + fill: none; + stroke: white +} +svg g#icon.home_icon + { + fill: white; + stroke: white; + transition: opacity 250ms; +} + +// DISABLED STATES / LOADING STATES + +svg a#tilt_adjust.disabled #tilt_icon, +svg a#stepper_off.disabled #stepper_off_icon { + fill: black; // TODO: change to fg color + stroke: none; +} + +svg a.loading g#icon.center_icon , +svg a.disabled g#icon.center_icon { + fill: none; + stroke: rgb(85,85,85);// TODO change to disabled +} + +svg a.disabled g#icon.center_icon, +svg a.loading g#icon.center_icon { + fill: none; + stroke: black +} + +svg a.disabled g#home_buttons text, +svg a.loading g#home_buttons text { + font-family: 'Roboto-Regular', 'Roboto', sans-serif; + font-size: 5px; + fill: black; + stroke: black; +} + +svg a.disabled g#icon.home_icon, +svg a.loading g#icon.home_icon + { + fill: black; + stroke: black; + transition: opacity 250ms; +} +svg g#home_buttons .disabled text, +svg g#home_buttons .loading text { + fill: black; + stroke: black; +} + svg a#tilt_adjust.primary, svg a#stepper_off.primary { fill: var(--v-anchor-base); From 55e69e1bb66727ea02e88f196362792235668b9b Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:57:00 +0000 Subject: [PATCH 23/42] fix: disable specialbutton if not homed. Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- src/components/widgets/toolhead/ToolheadControlCircle.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 6442814662..0b2de67b4f 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -828,6 +828,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi get colorSpecialButton () { const classes = [] if (this.isPrinting) classes.push('disabled') + if (!this.homedAxes.includes('xy')) classes.push('disabled') if (this.printerSupportsQuadGantryLevel) classes.push(this.colorQuadGantryLevel) else if (this.printerSupportsZTiltAdjust) classes.push(this.colorZTilt) From 257392e568b5b632ad4ef19613c4d36869fa1b88 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Tue, 28 Nov 2023 17:09:07 +0000 Subject: [PATCH 24/42] fix: typo Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- src/components/widgets/toolhead/ToolheadControlCircle.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 0b2de67b4f..aa9e96004e 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -828,7 +828,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi get colorSpecialButton () { const classes = [] if (this.isPrinting) classes.push('disabled') - if (!this.homedAxes.includes('xy')) classes.push('disabled') + if (!this.homedAxes.includes('xyz')) classes.push('disabled') if (this.printerSupportsQuadGantryLevel) classes.push(this.colorQuadGantryLevel) else if (this.printerSupportsZTiltAdjust) classes.push(this.colorZTilt) From c4131c2133b497e4fddff318ba19133afd985c68 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Tue, 28 Nov 2023 18:37:18 +0000 Subject: [PATCH 25/42] fix: cleanup more ids and classes Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- src/components/widgets/toolhead/ToolheadControlCircle.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index aa9e96004e..b922cdfa12 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -280,8 +280,8 @@ /> From e11ab7b78a050b384cc850b11c5821ed1604f634 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Tue, 28 Nov 2023 20:25:59 +0000 Subject: [PATCH 26/42] fix: simply css some more. Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- .../widgets/toolhead/ToolheadControlCircle.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index b922cdfa12..816a43db3d 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -1084,6 +1084,7 @@ svg g#icon.home_icon fill: white; stroke: white; transition: opacity 250ms; + pointer-events: auto; } svg g#home_buttons text { @@ -1155,10 +1156,9 @@ svg .homed a#home_all_center { fill: var(--v-anchor-base); } -svg .loading g.home_button, -svg a#tilt_adjust.loading, -svg a#stepper_off.loading, -svg .loading a#home_all_center { +svg a.loading +svg a.disabled +{ fill: rgb(85,85,85); pointer-events: none; } @@ -1167,7 +1167,7 @@ svg g.home_button:hover, svg a#home_all_center:hover, svg a#tilt_adjust:hover, svg a#stepper_off:hover { - opacity: 0.8; + opacity: 0.4; } From bdb2b4d1935f16b38b0ed5265c783fa515c150f4 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Tue, 28 Nov 2023 20:47:44 +0000 Subject: [PATCH 27/42] fix: on hover change the opacity of the children too Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- .../widgets/toolhead/ToolheadControlCircle.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 816a43db3d..472e44a1b7 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -1163,6 +1163,18 @@ svg a.disabled pointer-events: none; } +// TODO: see if we can simplify this! + +svg g#home_x:hover .home_icon, +svg g#home_x:hover text, +svg g#home_y:hover .home_icon, +svg g#home_y:hover text, +svg g#home_z:hover .home_icon, +svg g#home_z:hover text, +svg g#home_z:hover .home_icon, +svg g#home_z:hover text, +svg g#home_all:hover .home_icon, + svg g.home_button:hover, svg a#home_all_center:hover, svg a#tilt_adjust:hover, From 02dd83b980ce08f1e577c6182d1e3d71f54ed220 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Tue, 28 Nov 2023 21:45:21 +0000 Subject: [PATCH 28/42] fix: that was easier! Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- .../widgets/toolhead/ToolheadControlCircle.vue | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 472e44a1b7..e297fc724e 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -1077,7 +1077,8 @@ svg a#stepper_off #stepper_off_icon { svg g#icon.center_icon { fill: none; - stroke: white + stroke: white; + pointer-events: none; } svg g#icon.home_icon { @@ -1091,7 +1092,8 @@ svg g#home_buttons text { font-family: 'Roboto-Regular', 'Roboto', sans-serif; font-size: 5px; fill: white; - stroke: white; + stroke: none; + pointer-events: none; } svg g#icon.center_icon { @@ -1163,18 +1165,6 @@ svg a.disabled pointer-events: none; } -// TODO: see if we can simplify this! - -svg g#home_x:hover .home_icon, -svg g#home_x:hover text, -svg g#home_y:hover .home_icon, -svg g#home_y:hover text, -svg g#home_z:hover .home_icon, -svg g#home_z:hover text, -svg g#home_z:hover .home_icon, -svg g#home_z:hover text, -svg g#home_all:hover .home_icon, - svg g.home_button:hover, svg a#home_all_center:hover, svg a#tilt_adjust:hover, From 6b4c70786ab2ab3514ad60434765111a1e30b244 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Tue, 28 Nov 2023 23:09:07 +0000 Subject: [PATCH 29/42] fix: forgot main icon Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- src/components/widgets/toolhead/ToolheadControlCircle.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index e297fc724e..c8be367909 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -1085,7 +1085,7 @@ svg g#icon.home_icon fill: white; stroke: white; transition: opacity 250ms; - pointer-events: auto; + pointer-events: none; } svg g#home_buttons text { From f8c115125dbb4bc3133edb59eeaac82190f1d91a Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Tue, 28 Nov 2023 23:23:44 +0000 Subject: [PATCH 30/42] refactor: use objects for classes Also removes dead code Signed-off-by: Pedro Lamas --- .../toolhead/ToolheadControlCircle.vue | 501 ++++++++---------- 1 file changed, 220 insertions(+), 281 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index c8be367909..d24152118f 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -681,11 +681,11 @@ + - get existsBedTilt () { - return this.$store.getters['printer/existsBedTilt'] + From b4930462e4c872db006f0acd426a594cf0208a2a Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Wed, 29 Nov 2023 01:14:21 +0000 Subject: [PATCH 31/42] refactor: use objects for classes (cont.) Signed-off-by: Pedro Lamas --- .../toolhead/ToolheadControlCircle.vue | 173 +++++++----------- src/store/printer/getters.ts | 8 +- 2 files changed, 70 insertions(+), 111 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index d24152118f..f693b7bf14 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -71,7 +71,7 @@ > > @@ -136,7 +136,7 @@ @@ -421,7 +421,7 @@ QGL - - - - - - - - Z-TILT + >{{ printerSupportsQuadGantryLevel ? "QGL" : "ZTILT" }} @@ -660,11 +638,10 @@ a - b) + get stepsXY (): number[] { + return this.$store.state.config.uiSettings.general.toolheadCircleXYMoveDistances as number[] } - get stepsZ () { - const steps = this.$store.state.config.uiSettings.general.toolheadCircleZMoveDistances ?? [] + get stepsZ (): number[] { + return this.$store.state.config.uiSettings.general.toolheadCircleZMoveDistances as number[] + } - return Array.from(new Set([...(steps ?? [])])).sort((a, b) => a - b) + get forceMove () { + return this.$store.state.config.uiSettings.toolhead.forceMove } get printerSettings () { @@ -725,7 +698,14 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi return 'z_tilt' in this.printerSettings } - get stepTextClass () { + get printerSupportsLeveling (): boolean { + return ( + this.printerSupportsQuadGantryLevel || + this.printerSupportsZTiltAdjust + ) + } + + get stepTextClasses () { return { disabled: ( this.printerPrinting || @@ -735,7 +715,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } } - get xStepClass () { + get xStepClasses () { return { disabled: ( this.printerPrinting || @@ -745,7 +725,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } } - get yStepClass () { + get yStepClasses () { return { disabled: ( this.printerPrinting || @@ -755,7 +735,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } } - get zStepClass () { + get zStepClasses () { return { disabled: ( this.printerPrinting || @@ -765,7 +745,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } } - get xHomeClass () { + get xHomeClasses () { return { homed: this.xHomed, disabled: this.printerPrinting, @@ -773,7 +753,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } } - get yHomeClass () { + get yHomeClasses () { return { homed: this.yHomed, disabled: this.printerPrinting, @@ -781,7 +761,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } } - get xyHomeClass () { + get xyHomeClasses () { return { homed: this.xyHomed, disabled: this.printerPrinting, @@ -789,7 +769,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } } - get xyzHomeClass () { + get xyzHomeClasses () { return { homed: this.allHomed, disabled: this.printerPrinting, @@ -797,7 +777,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } } - get centerToolheadClass () { + get centerToolheadClasses () { const tool_pos = this.$store.state.printer.printer.toolhead.position const bedCenter = this.bedCenter @@ -815,7 +795,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } } - get zHomeClass () { + get zHomeClasses () { return { homed: this.zHomed, disabled: this.printerPrinting, @@ -823,39 +803,44 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } } - get colorSpecialButton () { + get levelingClasses () { + const baseLevelingClasses = this.printerSupportsQuadGantryLevel + ? { + [this.$store.state.printer.printer.quad_gantry_level?.applied ? 'primary' : 'warning']: true, + loading: this.hasWait([this.$waits.onQGL, this.$waits.onHomeZ, this.$waits.onHomeAll]) + } + : this.printerSupportsZTiltAdjust + ? { + [this.$store.state.printer.printer.z_tilt?.applied ? 'primary' : 'warning']: true, + loading: this.hasWait([this.$waits.onZTilt, this.$waits.onHomeZ, this.$waits.onHomeAll]) + } + : undefined + return { disabled: ( this.printerPrinting || - this.allHomed + !this.allHomed ), - [this.colorQuadGantryLevel.toString()]: this.printerSupportsQuadGantryLevel, - ...( - this.printerSupportsQuadGantryLevel - ? this.colorQuadGantryLevel - : this.printerSupportsZTiltAdjust - ? this.colorZTilt - : undefined - ) + ...baseLevelingClasses } } - get motorsOffClass () { + get motorsOffClasses () { return { - disabled: this.printerPrinting - // [this.homedAxes !== '' ? 'primary' : 'warning']: true + disabled: this.printerPrinting, + [this.$store.state.printer.printer.toolhead.homed_axes.length > 0 ? 'primary' : 'warning']: true } } - clickSpecialButton () { + sendLevelingGcode () { if (this.printerSupportsQuadGantryLevel) { this.sendGcode('QUAD_GANTRY_LEVEL', this.$waits.onQGL) } else if (this.printerSupportsZTiltAdjust) { - return this.sendGcode('Z_TILT_ADJUST', this.$waits.onZTilt) + this.sendGcode('Z_TILT_ADJUST', this.$waits.onZTilt) } } - sendMoveGcode (axis: string, distance: string, negative = false) { + sendMoveGcode (axis: string, distance: number | string, negative = false) { axis = axis.toLowerCase() const rate = (axis.toLowerCase() === 'z') ? this.$store.state.config.uiSettings.general.defaultToolheadZSpeed @@ -897,34 +882,12 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } } - centerToolHead () { + sendMoveCenterGcode () { const bedCenter = this.bedCenter const rate = this.$store.state.config.uiSettings.general.defaultToolheadXYSpeed this.sendGcode(`G1 X${bedCenter.x} Y${bedCenter.y} F${rate * 60}`) } - - get forceMove () { - return this.$store.state.config.uiSettings.toolhead.forceMove - } - - get colorQuadGantryLevel () { - return { - [this.$store.state.printer.printer.quad_gantry_level?.applied ? 'primary' : 'warning']: true, - loading: this.hasWait([this.$waits.onQGL, this.$waits.onHomeZ, this.$waits.onHomeAll]) - } - } - - get colorZTilt () { - return { - [this.$store.state.printer.printer.z_tilt?.applied ? 'primary' : 'warning']: true, - loading: this.hasWait([this.$waits.onZTilt, this.$waits.onHomeZ, this.$waits.onHomeAll]) - } - } - - get defaultActionButton () { - return this.$store.getters['gui/getDefaultControlActionButton'] - } } diff --git a/src/store/printer/getters.ts b/src/store/printer/getters.ts index c57826be1e..1a53978f1d 100644 --- a/src/store/printer/getters.ts +++ b/src/store/printer/getters.ts @@ -340,12 +340,8 @@ export const getters: GetterTree = { */ getHomedAxes: (state) => (axes?: string): boolean => { if (axes && axes.length > 0) { - let r = false - const a = axes.split('') - a.forEach((char) => { - r = state.printer.toolhead.homed_axes.includes(char) - }) - return r + return axes.split('') + .every(char => state.printer.toolhead.homed_axes.includes(char)) } return false }, From 427aba09d49301724c6d93d1af95f7da8d2cfdfd Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Thu, 30 Nov 2023 14:05:58 +0000 Subject: [PATCH 32/42] style: full css refactor (WIP) Signed-off-by: Pedro Lamas --- .../toolhead/ToolheadControlCircle.vue | 709 ++++++++---------- 1 file changed, 300 insertions(+), 409 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index f693b7bf14..229e09197e 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -8,6 +8,10 @@ viewBox="0 0 78 62" xmlns="http://www.w3.org/2000/svg" style="fill-rule: evenodd; clip-rule: evenodd; stroke-linejoin: round; stroke-miterlimit: 2" + class="app-circle-control" + :class="{ + [$vuetify.theme.dark ? 'theme--dark': 'theme--light']: true, + }" > - - - + + - - - + + + X - + + - > - - - + + + Y - + + - - - + + + Z - + + - - - + + + XY - + + - - - + + + - + @@ -228,155 +186,153 @@ - + - - + - - + - - + - + + + - + - + - + - + - + - + - + - + - + - + + @@ -417,164 +373,208 @@ + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - {{ printerSupportsQuadGantryLevel ? "QGL" : "ZTILT" }} - - - + + - + @@ -747,7 +741,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi get xHomeClasses () { return { - homed: this.xHomed, + primary: !this.xHomed, disabled: this.printerPrinting, loading: this.hasWait([this.$waits.onHomeX, this.$waits.onHomeXY, this.$waits.onHomeAll]) } @@ -755,7 +749,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi get yHomeClasses () { return { - homed: this.yHomed, + primary: !this.yHomed, disabled: this.printerPrinting, loading: this.hasWait([this.$waits.onHomeY, this.$waits.onHomeXY, this.$waits.onHomeAll]) } @@ -763,7 +757,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi get xyHomeClasses () { return { - homed: this.xyHomed, + primary: !this.xyHomed, disabled: this.printerPrinting, loading: this.hasWait([this.$waits.onHomeX, this.$waits.onHomeY, this.$waits.onHomeXY, this.$waits.onHomeAll]) } @@ -771,7 +765,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi get xyzHomeClasses () { return { - homed: this.allHomed, + primary: !this.allHomed, disabled: this.printerPrinting, loading: this.hasWait([this.$waits.onHomeX, this.$waits.onHomeXY, this.$waits.onHomeZ, this.$waits.onHomeY, this.$waits.onHomeAll]) } @@ -782,7 +776,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi const bedCenter = this.bedCenter return { - homed: ( + primary: !( this.xyHomed && tool_pos[0] === bedCenter.x && tool_pos[1] === bedCenter.y @@ -797,7 +791,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi get zHomeClasses () { return { - homed: this.zHomed, + primary: !this.zHomed, disabled: this.printerPrinting, loading: this.hasWait([this.$waits.onHomeZ, this.$waits.onHomeAll]) } @@ -892,186 +886,83 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi From 3595178645a54982090063bb3a4b4c4b59863769 Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Thu, 30 Nov 2023 15:43:17 +0000 Subject: [PATCH 33/42] style: full css refactor Signed-off-by: Pedro Lamas --- .../toolhead/ToolheadControlCircle.vue | 290 ++++++++++++------ 1 file changed, 193 insertions(+), 97 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 229e09197e..8b7e2512e2 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -184,6 +184,7 @@ + @@ -250,6 +251,7 @@ @@ -261,6 +263,7 @@ @@ -272,6 +275,7 @@ @@ -285,6 +289,7 @@ @@ -296,6 +301,7 @@ @@ -307,6 +313,7 @@ @@ -318,6 +325,7 @@ @@ -376,9 +384,10 @@ - + @@ -390,6 +399,7 @@ @@ -401,6 +411,7 @@ @@ -412,6 +423,7 @@ @@ -422,12 +434,10 @@ - + @@ -439,6 +449,7 @@ @@ -450,6 +461,7 @@ @@ -461,6 +473,7 @@ @@ -471,12 +484,10 @@ - + @@ -488,6 +499,7 @@ @@ -499,6 +511,7 @@ @@ -510,6 +523,7 @@ @@ -520,12 +534,10 @@ - + @@ -537,6 +549,7 @@ @@ -548,6 +561,7 @@ @@ -559,6 +573,7 @@ @@ -573,7 +588,7 @@ @@ -699,75 +714,98 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi ) } - get stepTextClasses () { + get xStepClasses () { return { disabled: ( + !this.klippyReady || this.printerPrinting || - !this.xyHomed || - this.hasWait([this.$waits.onHomeX, this.$waits.onHomeXY, this.$waits.onHomeAll]) + !this.xHomed ) } } - get xStepClasses () { + get yStepClasses () { return { disabled: ( + !this.klippyReady || this.printerPrinting || - !this.xHomed || - this.hasWait([this.$waits.onHomeX, this.$waits.onHomeXY, this.$waits.onHomeAll]) + !this.yHomed ) } } - get yStepClasses () { + get zStepClasses () { return { disabled: ( + !this.klippyReady || this.printerPrinting || - !this.yHomed || - this.hasWait([this.$waits.onHomeY, this.$waits.onHomeXY, this.$waits.onHomeAll]) + !this.zHomed ) } } - get zStepClasses () { + get xyStepClasses () { return { disabled: ( + !this.klippyReady || this.printerPrinting || - !this.zHomed || - this.hasWait([this.$waits.onHomeZ, this.$waits.onHomeAll]) + !(this.xHomed || this.yHomed) ) } } get xHomeClasses () { return { - primary: !this.xHomed, - disabled: this.printerPrinting, - loading: this.hasWait([this.$waits.onHomeX, this.$waits.onHomeXY, this.$waits.onHomeAll]) + disabled: ( + !this.klippyReady || + this.printerPrinting, + this.hasWait([this.$waits.onHomeX, this.$waits.onHomeXY, this.$waits.onHomeAll]) + ), + primary: !this.xHomed } } get yHomeClasses () { return { - primary: !this.yHomed, - disabled: this.printerPrinting, - loading: this.hasWait([this.$waits.onHomeY, this.$waits.onHomeXY, this.$waits.onHomeAll]) + disabled: ( + !this.klippyReady || + this.printerPrinting, + this.hasWait([this.$waits.onHomeY, this.$waits.onHomeXY, this.$waits.onHomeAll]) + ), + primary: !this.yHomed + } + } + + get zHomeClasses () { + return { + disabled: ( + !this.klippyReady || + this.printerPrinting, + this.hasWait([this.$waits.onHomeZ, this.$waits.onHomeAll]) + ), + primary: !this.zHomed } } get xyHomeClasses () { return { - primary: !this.xyHomed, - disabled: this.printerPrinting, - loading: this.hasWait([this.$waits.onHomeX, this.$waits.onHomeY, this.$waits.onHomeXY, this.$waits.onHomeAll]) + disabled: ( + !this.klippyReady || + this.printerPrinting || + this.hasWait([this.$waits.onHomeX, this.$waits.onHomeY, this.$waits.onHomeXY, this.$waits.onHomeAll]) + ), + primary: !this.xyHomed } } get xyzHomeClasses () { return { - primary: !this.allHomed, - disabled: this.printerPrinting, - loading: this.hasWait([this.$waits.onHomeX, this.$waits.onHomeXY, this.$waits.onHomeZ, this.$waits.onHomeY, this.$waits.onHomeAll]) + disabled: ( + !this.klippyReady || + this.printerPrinting || + this.hasWait([this.$waits.onHomeX, this.$waits.onHomeY, this.$waits.onHomeZ, this.$waits.onHomeXY, this.$waits.onHomeAll]) + ), + primary: !this.allHomed } } @@ -776,42 +814,34 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi const bedCenter = this.bedCenter return { - primary: !( - this.xyHomed && - tool_pos[0] === bedCenter.x && - tool_pos[1] === bedCenter.y - ), disabled: ( + !this.klippyReady || this.printerPrinting || !this.xyHomed ), - loading: this.hasWait([this.$waits.onHomeX, this.$waits.onHomeXY, this.$waits.onHomeZ, this.$waits.onHomeY, this.$waits.onHomeAll]) - } - } - - get zHomeClasses () { - return { - primary: !this.zHomed, - disabled: this.printerPrinting, - loading: this.hasWait([this.$waits.onHomeZ, this.$waits.onHomeAll]) + primary: !( + tool_pos[0] === bedCenter.x && + tool_pos[1] === bedCenter.y + ) } } get levelingClasses () { const baseLevelingClasses = this.printerSupportsQuadGantryLevel ? { - [this.$store.state.printer.printer.quad_gantry_level?.applied ? 'primary' : 'warning']: true, + primary: this.$store.state.printer.printer.quad_gantry_level?.applied, loading: this.hasWait([this.$waits.onQGL, this.$waits.onHomeZ, this.$waits.onHomeAll]) } : this.printerSupportsZTiltAdjust ? { - [this.$store.state.printer.printer.z_tilt?.applied ? 'primary' : 'warning']: true, + primary: this.$store.state.printer.printer.z_tilt?.applied, loading: this.hasWait([this.$waits.onZTilt, this.$waits.onHomeZ, this.$waits.onHomeAll]) } : undefined return { disabled: ( + !this.klippyReady || this.printerPrinting || !this.allHomed ), @@ -821,8 +851,8 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi get motorsOffClasses () { return { - disabled: this.printerPrinting, - [this.$store.state.printer.printer.toolhead.homed_axes.length > 0 ? 'primary' : 'warning']: true + disabled: !this.klippyReady || this.printerPrinting, + primary: this.$store.state.printer.printer.toolhead.homed_axes.length > 0 } } @@ -888,23 +918,48 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi From 6f730cca09cf346cee7d1c4ff9760eec9b5b0774 Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Thu, 30 Nov 2023 16:58:48 +0000 Subject: [PATCH 34/42] fix: copy paste typo Signed-off-by: Pedro Lamas --- src/components/widgets/toolhead/ToolheadControlCircle.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 8b7e2512e2..863fecf377 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -758,7 +758,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi return { disabled: ( !this.klippyReady || - this.printerPrinting, + this.printerPrinting || this.hasWait([this.$waits.onHomeX, this.$waits.onHomeXY, this.$waits.onHomeAll]) ), primary: !this.xHomed @@ -769,7 +769,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi return { disabled: ( !this.klippyReady || - this.printerPrinting, + this.printerPrinting || this.hasWait([this.$waits.onHomeY, this.$waits.onHomeXY, this.$waits.onHomeAll]) ), primary: !this.yHomed @@ -780,7 +780,7 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi return { disabled: ( !this.klippyReady || - this.printerPrinting, + this.printerPrinting || this.hasWait([this.$waits.onHomeZ, this.$waits.onHomeAll]) ), primary: !this.zHomed From 5eff2051e5c45ec8105eb9d3bb00d595ec9d4332 Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Fri, 1 Dec 2023 10:48:07 +0000 Subject: [PATCH 35/42] style: tweaks and improvements Signed-off-by: Pedro Lamas --- .../toolhead/ToolheadControlCircle.vue | 161 +++++++----------- 1 file changed, 66 insertions(+), 95 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 863fecf377..d748b90184 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -931,34 +931,33 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } } - .theme--light.app-circle-control .cc-btn { - &.inner .cc-btn-container { - fill: var(--v-btncolor-lighten1); - } - &.inner-mid .cc-btn-container { - fill: var(--v-btncolor-base); - } - &.outer-mid .cc-btn-container { - fill: var(--v-btncolor-darken1); - } - &.outer .cc-btn-container { - fill: var(--v-btncolor-darken2); + @mixin cc-btn-theme ($component, $text, $back, $hover) { + &#{$component} { + fill: #{$text}; + stroke: #{$text}; + + .cc-btn-container { + fill: #{$back}; + } + + &:hover .cc-btn-container { + fill: #{$hover}; + } } } + .theme--light.app-circle-control .cc-btn { + @include cc-btn-theme('.inner', '', 'var(--v-btncolor-lighten1)', ''); + @include cc-btn-theme('.inner-mid', '', 'var(--v-btncolor-base)', ''); + @include cc-btn-theme('.outer-mid', '', 'var(--v-btncolor-darken1)', ''); + @include cc-btn-theme('.outer', '', 'var(--v-btncolor-darken2)', ''); + } + .theme--dark.app-circle-control .cc-btn { - &.inner .cc-btn-container { - fill: var(--v-btncolor-lighten2); - } - &.inner-mid .cc-btn-container { - fill: var(--v-btncolor-lighten1); - } - &.outer-mid .cc-btn-container { - fill: var(--v-btncolor-base); - } - &.outer .cc-btn-container { - fill: var(--v-btncolor-darken1); - } + @include cc-btn-theme('.inner', '', 'var(--v-btncolor-lighten2)', ''); + @include cc-btn-theme('.inner-mid', '', 'var(--v-btncolor-lighten1)', ''); + @include cc-btn-theme('.outer-mid', '', 'var(--v-btncolor-base)', ''); + @include cc-btn-theme('.outer', '', 'var(--v-btncolor-darken1)', ''); } .app-circle-control { @@ -967,87 +966,56 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi max-height: 350px; min-height: 275px; user-select: none; - filter: drop-shadow(0px 1px 1px rgba(0, 0, 0, 0.12)) drop-shadow(0px 2px 1px rgba(0, 0, 0, 0.14)); - - .large { - font-size: 5px !important; - } + filter: drop-shadow(0px 1px 1px rgba(0, 0, 0, 0.2)) drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.14)) drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.12)); .cc-btn { stroke-width: 0; .cc-btn-container { fill: var(--v-btncolor-base); - stroke-width: 0.3px; stroke: var(--v-btncolor-darken4); + stroke-width: 0.2px; } - &:hover { - .cc-btn-container { - fill: var(--v-btncolor-lighten1); - transition: fill 100ms ease-in; - } - } - - &.primary:not(.disabled) { - fill: map-deep-get($material-dark, 'text', 'primary'); - stroke: map-deep-get($material-dark, 'text', 'primary'); - - .cc-btn-container { - fill: var(--v-primary-base); - } - - &:hover .cc-btn-container { - fill: var(--v-primary-lighten1); - } - } - - &.inner:not(.disabled) { - fill: map-deep-get($material-dark, 'text', 'primary'); - - .cc-btn-container { - fill: var(--v-primary-lighten1); - } - - &:hover .cc-btn-container { - fill: var(--v-primary-lighten2); - } - } - - &.inner-mid:not(.disabled) { - fill: map-deep-get($material-dark, 'text', 'primary'); - - .cc-btn-container { - fill: var(--v-primary-base); - } - - &:hover .cc-btn-container { - fill: var(--v-primary-lighten1); - } - } - - &.outer-mid:not(.disabled) { - fill: map-deep-get($material-dark, 'text', 'primary'); - - .cc-btn-container { - fill: var(--v-primary-darken1); - } - - &:hover .cc-btn-container { - fill: var(--v-primary-base); - } + &:hover .cc-btn-container { + fill: var(--v-btncolor-lighten1); + transition-duration: 0.28s; + transition-property: fill; + transition-timing-function: map-get($transition, 'fast-out-slow-in'); } - &.outer:not(.disabled) { - fill: map-deep-get($material-dark, 'text', 'primary'); - - .cc-btn-container { - fill: var(--v-primary-darken2); - } - - &:hover .cc-btn-container { - fill: var(--v-primary-darken1); - } + &:not(.disabled) { + $material-dark-text-primary: map-deep-get($material-dark, 'text', 'primary'); + + @include cc-btn-theme( + '.primary', + $material-dark-text-primary, + 'var(--v-primary-base)', + 'var(--v-primary-lighten1)'); + + @include cc-btn-theme( + '.inner', + $material-dark-text-primary, + 'var(--v-primary-lighten1)', + 'var(--v-primary-lighten2)'); + + @include cc-btn-theme( + '.inner-mid', + $material-dark-text-primary, + 'var(--v-primary-base)', + 'var(--v-primary-lighten1)'); + + @include cc-btn-theme( + '.outer-mid', + $material-dark-text-primary, + 'var(--v-primary-darken1)', + 'var(--v-primary-base)'); + + @include cc-btn-theme( + '.outer', + $material-dark-text-primary, + 'var(--v-primary-darken2)', + 'var(--v-primary-darken1)'); } } @@ -1056,9 +1024,12 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi stroke-width: 0; } + .large { + font-size: 5px; + } + .disabled { pointer-events: none; - stroke-width: 0; } } From 7770849ed68c0ff1a7934ccda8361b8beff1d61a Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Fri, 1 Dec 2023 10:56:05 +0000 Subject: [PATCH 36/42] refactor: toolhead controls selection Signed-off-by: Pedro Lamas --- src/components/widgets/toolhead/Toolhead.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/widgets/toolhead/Toolhead.vue b/src/components/widgets/toolhead/Toolhead.vue index 3ba2ca451b..16b105ea41 100644 --- a/src/components/widgets/toolhead/Toolhead.vue +++ b/src/components/widgets/toolhead/Toolhead.vue @@ -9,13 +9,12 @@ > - - - - + + From 34b2d65468931bad0a38ddce523b996da83a9f84 Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Fri, 1 Dec 2023 11:01:50 +0000 Subject: [PATCH 37/42] refactor: translation labels Signed-off-by: Pedro Lamas --- src/components/settings/ToolheadSettings.vue | 2 +- src/locales/en.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/settings/ToolheadSettings.vue b/src/components/settings/ToolheadSettings.vue index 9daebf2949..525e48f18b 100644 --- a/src/components/settings/ToolheadSettings.vue +++ b/src/components/settings/ToolheadSettings.vue @@ -203,7 +203,7 @@ - + Date: Fri, 1 Dec 2023 11:08:42 +0000 Subject: [PATCH 38/42] refactor: there should always be 4 steps Signed-off-by: Pedro Lamas --- .../widgets/toolhead/ToolheadControlCircle.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index d748b90184..0b76008952 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -350,7 +350,7 @@ y="19.056px" text-anchor="middle" > - {{ stepsZ.length >= 0 ? stepsZ[0] : '--' }} + {{ stepsZ[0] }} @@ -359,7 +359,7 @@ y="19.056px" text-anchor="middle" > - {{ stepsZ.length >= 1 ? stepsZ[1] : '--' }} + {{ stepsZ[1] }} @@ -368,7 +368,7 @@ y="19.056px" text-anchor="middle" > - {{ stepsZ.length >= 2 ? stepsZ[2] : '--' }} + {{ stepsZ[2] }} @@ -377,7 +377,7 @@ y="19.056px" text-anchor="middle" > - {{ stepsZ.length >= 3 ? stepsZ[3] : '--' }} + {{ stepsZ[3] }} @@ -597,7 +597,7 @@ y="19.056px" text-anchor="middle" > - {{ stepsXY.length >= 0 ? stepsXY[0] : '--' }} + {{ stepsXY[0] }} @@ -606,7 +606,7 @@ y="19.056px" text-anchor="middle" > - {{ stepsXY.length >= 1 ? stepsXY[1] : '--' }} + {{ stepsXY[1] }} @@ -615,7 +615,7 @@ y="19.056px" text-anchor="middle" > - {{ stepsXY.length >= 2 ? stepsXY[2] : '--' }} + {{ stepsXY[2] }} @@ -624,7 +624,7 @@ y="19.056px" text-anchor="middle" > - {{ stepsXY.length >= 3 ? stepsXY[3] : '--' }} + {{ stepsXY[3] }} From 0e01fa01fa01d3443cb6f2532564faeb1008cde2 Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Fri, 1 Dec 2023 15:07:29 +0000 Subject: [PATCH 39/42] fix: leveling classes Signed-off-by: Pedro Lamas --- .../widgets/toolhead/ToolheadControlCircle.vue | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 0b76008952..b9216edd6a 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -827,25 +827,16 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } get levelingClasses () { - const baseLevelingClasses = this.printerSupportsQuadGantryLevel - ? { - primary: this.$store.state.printer.printer.quad_gantry_level?.applied, - loading: this.hasWait([this.$waits.onQGL, this.$waits.onHomeZ, this.$waits.onHomeAll]) - } - : this.printerSupportsZTiltAdjust - ? { - primary: this.$store.state.printer.printer.z_tilt?.applied, - loading: this.hasWait([this.$waits.onZTilt, this.$waits.onHomeZ, this.$waits.onHomeAll]) - } - : undefined - return { disabled: ( !this.klippyReady || this.printerPrinting || !this.allHomed ), - ...baseLevelingClasses + primary: ( + (this.printerSupportsQuadGantryLevel && !this.$store.state.printer.printer.quad_gantry_level?.applied) || + (this.printerSupportsZTiltAdjust && !this.$store.state.printer.printer.z_tilt?.applied) + ) } } From e2b1cfca08bde9fcbb60ae9b2b9147460bf4ed32 Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Fri, 1 Dec 2023 15:17:43 +0000 Subject: [PATCH 40/42] refactor: this should be on develop branch Signed-off-by: Pedro Lamas --- src/store/printer/getters.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/store/printer/getters.ts b/src/store/printer/getters.ts index 1a53978f1d..c57826be1e 100644 --- a/src/store/printer/getters.ts +++ b/src/store/printer/getters.ts @@ -340,8 +340,12 @@ export const getters: GetterTree = { */ getHomedAxes: (state) => (axes?: string): boolean => { if (axes && axes.length > 0) { - return axes.split('') - .every(char => state.printer.toolhead.homed_axes.includes(char)) + let r = false + const a = axes.split('') + a.forEach((char) => { + r = state.printer.toolhead.homed_axes.includes(char) + }) + return r } return false }, From 767ae1149e476b4df74a29e5e6ca316301ef7c8f Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Fri, 1 Dec 2023 15:38:43 +0000 Subject: [PATCH 41/42] fix: leveling classes (cont.) Signed-off-by: Pedro Lamas --- .../toolhead/ToolheadControlCircle.vue | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index b9216edd6a..1601626219 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -827,16 +827,26 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi } get levelingClasses () { + const [primary, disabled] = this.printerSupportsQuadGantryLevel + ? [ + !this.$store.state.printer.printer.quad_gantry_level?.applied, + this.hasWait(this.$waits.onQGL) + ] + : this.printerSupportsZTiltAdjust + ? [ + !this.$store.state.printer.printer.z_tilt?.applied, + this.hasWait(this.$waits.onZTilt) + ] + : [] + return { disabled: ( !this.klippyReady || this.printerPrinting || - !this.allHomed + !this.allHomed || + disabled ), - primary: ( - (this.printerSupportsQuadGantryLevel && !this.$store.state.printer.printer.quad_gantry_level?.applied) || - (this.printerSupportsZTiltAdjust && !this.$store.state.printer.printer.z_tilt?.applied) - ) + primary } } From 15038eaed414d366b2b10782f4a7ee3fddc0d5a9 Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Fri, 1 Dec 2023 15:43:10 +0000 Subject: [PATCH 42/42] refactor: improve "motors off" check Signed-off-by: Pedro Lamas --- .../widgets/toolhead/ToolheadControlCircle.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/widgets/toolhead/ToolheadControlCircle.vue b/src/components/widgets/toolhead/ToolheadControlCircle.vue index 1601626219..d83b275f55 100644 --- a/src/components/widgets/toolhead/ToolheadControlCircle.vue +++ b/src/components/widgets/toolhead/ToolheadControlCircle.vue @@ -648,7 +648,7 @@ @@ -695,6 +695,10 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi return this.$store.state.config.uiSettings.toolhead.forceMove } + get hasSteppersEnabled (): boolean { + return this.$store.getters['printer/getHasSteppersEnabled'] as boolean + } + get printerSettings () { return this.$store.getters['printer/getPrinterSettings']() } @@ -852,8 +856,11 @@ export default class ToolheadControlCircle extends Mixins(StateMixin, ToolheadMi get motorsOffClasses () { return { - disabled: !this.klippyReady || this.printerPrinting, - primary: this.$store.state.printer.printer.toolhead.homed_axes.length > 0 + disabled: ( + !this.klippyReady || + this.printerPrinting || + !this.hasSteppersEnabled + ) } }