diff --git a/src/components/inputs/MacroButton.vue b/src/components/inputs/MacroButton.vue index 89586f774..873d4cb21 100644 --- a/src/components/inputs/MacroButton.vue +++ b/src/components/inputs/MacroButton.vue @@ -59,7 +59,7 @@ {{ mdiMenuDown }} - + {{ mdiCloseThick }} @@ -101,6 +101,8 @@ import BaseMixin from '@/components/mixins/base' import { GuiMacrosStateMacrogroupMacro } from '@/store/gui/macros/types' import { mdiCloseThick, mdiMenuDown, mdiRefresh } from '@mdi/js' import Panel from '@/components/ui/Panel.vue' +import { TranslateResult } from 'vue-i18n' +import { PrinterStateMacro } from '@/store/printer/types' interface param { type: 'int' | 'double' | 'string' | null @@ -128,13 +130,13 @@ export default class MacroButton extends Mixins(BaseMixin) { private paramsDialog = false @Prop({ required: true }) - declare readonly macro: GuiMacrosStateMacrogroupMacro + declare readonly macro: GuiMacrosStateMacrogroupMacro | PrinterStateMacro @Prop({ default: 'primary' }) declare readonly color: string @Prop({ default: null }) - declare readonly alias: string + declare readonly alias: string | TranslateResult @Prop({ default: false }) declare readonly disabled: boolean diff --git a/src/components/inputs/NumberInput.vue b/src/components/inputs/NumberInput.vue index e0c6ee546..5b36dbdec 100644 --- a/src/components/inputs/NumberInput.vue +++ b/src/components/inputs/NumberInput.vue @@ -53,6 +53,7 @@ import Component from 'vue-class-component' import { Mixins, Prop, Watch } from 'vue-property-decorator' import BaseMixin from '@/components/mixins/base' import { mdiChevronDown, mdiChevronUp, mdiRestart } from '@mdi/js' +import { TranslateResult } from 'vue-i18n' @Component export default class NumberInput extends Mixins(BaseMixin) { @@ -65,48 +66,23 @@ export default class NumberInput extends Mixins(BaseMixin) { private invalidChars: string[] = ['e', 'E', '+'] // input field name and identifier - @Prop({ type: String, required: true }) - declare readonly label: string - - @Prop({ type: String, required: true }) - declare readonly param: string - + @Prop({ required: true }) declare readonly label: TranslateResult | string + @Prop({ type: String, required: true }) declare readonly param: string // props defining incoming data - @Prop({ type: Number, required: true }) - declare readonly target: number - - @Prop({ type: Number, required: false }) - declare readonly defaultValue: number - + @Prop({ type: Number, required: true }) declare readonly target: number + @Prop({ type: Number, required: false }) declare readonly defaultValue: number // props for internal processing - @Prop({ type: Number, required: true }) - declare readonly min: number - - @Prop({ type: Number, default: null }) - declare readonly max: number | null - - @Prop({ type: Number, required: true }) - declare readonly dec: number - - @Prop({ type: Number, required: false, default: 1 }) - declare readonly step: number - - @Prop({ type: String, required: false }) - declare readonly unit: string - + @Prop({ type: Number, required: true }) declare readonly min: number + @Prop({ default: null }) declare readonly max: number | null + @Prop({ type: Number, required: true }) declare readonly dec: number + @Prop({ type: Number, required: false, default: 1 }) declare readonly step: number + @Prop({ type: String, required: false }) declare readonly unit: string // spinner related props - @Prop({ type: Boolean, required: false, default: false }) - declare readonly hasSpinner: boolean - - @Prop({ type: Number, required: false, default: 1 }) - declare readonly spinnerFactor: number - + @Prop({ type: Boolean, required: false, default: false }) declare readonly hasSpinner: boolean + @Prop({ type: Number, required: false, default: 1 }) declare readonly spinnerFactor: number // props for general internal behaviour - @Prop({ type: Boolean, required: false, default: false }) - declare readonly disabled: boolean - - @Prop({ type: Boolean, required: false, default: false }) - declare readonly outputErrorMsg: boolean + @Prop({ type: Boolean, required: false, default: false }) declare readonly disabled: boolean + @Prop({ type: Boolean, required: false, default: false }) declare readonly outputErrorMsg: boolean created(): void { this.value = this.target.toString() diff --git a/src/components/mixins/base.ts b/src/components/mixins/base.ts index 8bc9ce571..cabb2b14e 100644 --- a/src/components/mixins/base.ts +++ b/src/components/mixins/base.ts @@ -47,6 +47,10 @@ export default class BaseMixin extends Vue { return this.klipperReadyForGui && ['printing', 'paused'].includes(this.printer_state) } + get printerIsPrintingOnly() { + return this.klipperReadyForGui && this.printer_state === 'printing' + } + get printerPowerDevice(): string { let deviceName = this.$store.state.gui.uiSettings.powerDeviceName ?? null if (deviceName === null) deviceName = 'printer' diff --git a/src/components/mixins/extruder.ts b/src/components/mixins/extruder.ts new file mode 100644 index 000000000..1b4f5c6a1 --- /dev/null +++ b/src/components/mixins/extruder.ts @@ -0,0 +1,40 @@ +import Vue from 'vue' +import { Component } from 'vue-property-decorator' +@Component +export default class ExtruderMixin extends Vue { + get activeExtruder(): string { + return this.$store.state.printer.toolhead?.extruder + } + + get activeExtruderSettings(): any { + return this.$store.state.printer.configfile?.settings?.[this.activeExtruder] + } + + get filamentDiameter(): number { + return this.activeExtruderSettings?.filament_diameter ?? 1.75 + } + + get nozzleDiameter(): number { + return this.activeExtruderSettings?.nozzle_diameter ?? 0.4 + } + + get feedamount(): number { + return parseFloat(this.$store.state.gui.control.extruder.feedamount) + } + + get feedrate(): number { + return parseFloat(this.$store.state.gui.control.extruder.feedrate) + } + + get extrudeFactor() { + return this.$store.state.printer?.gcode_move?.extrude_factor ?? 1 + } + + get extrudePossible(): boolean { + return this.$store.getters['printer/getExtrudePossible'] + } + + get minExtrudeTemp(): number { + return this.activeExtruderSettings?.min_extrude_temp ?? 170 + } +} diff --git a/src/components/panels/Extruder/EstimatedExtrusionOutput.vue b/src/components/panels/Extruder/EstimatedExtrusionOutput.vue new file mode 100644 index 000000000..251cf1f23 --- /dev/null +++ b/src/components/panels/Extruder/EstimatedExtrusionOutput.vue @@ -0,0 +1,42 @@ + + + + + {{ $t('Panels.ExtruderControlPanel.EstimatedExtrusion') }} ~ {{ extrudedLength }} mm @ + {{ volumetricFlow }} mm³/s - + + {{ mdiDiameterVariant }} + + {{ nozzleDiameter }} mm + + + + + + diff --git a/src/components/panels/Extruder/ExtruderControlPanelControl.vue b/src/components/panels/Extruder/ExtruderControlPanelControl.vue new file mode 100644 index 000000000..23afad0a0 --- /dev/null +++ b/src/components/panels/Extruder/ExtruderControlPanelControl.vue @@ -0,0 +1,320 @@ + + + + + + + + + + {{ value }} + + + + + + + + {{ value }} + + + + + + + + + + + {{ mdiArrowUpBold }} + {{ $t('Panels.ExtruderControlPanel.Retract') }} + + + + + {{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }} + {{ minExtrudeTemp }} °C + + + {{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }} + + {{ $t('Panels.ExtruderControlPanel.Requested') }}: {{ feedamount * extrudeFactor }} mm + + {{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm + + + + + + + + {{ mdiArrowDownBold }} + {{ $t('Panels.ExtruderControlPanel.Extrude') }} + + + + + {{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }} + {{ minExtrudeTemp }} °C + + + {{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }} + + {{ $t('Panels.ExtruderControlPanel.Requested') }}: {{ feedamount * extrudeFactor }} mm + + {{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm + + + + + + + + + + + + + + + {{ mdiArrowUpBold }} + {{ $t('Panels.ExtruderControlPanel.Retract') }} + + + + + {{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }} + {{ minExtrudeTemp }} °C + + + {{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }} + + {{ $t('Panels.ExtruderControlPanel.Requested') }}: + {{ feedamount * extrudeFactor }} mm + + {{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm + + + + + + + + {{ mdiArrowDownBold }} + {{ $t('Panels.ExtruderControlPanel.Extrude') }} + + + + + {{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }} + {{ minExtrudeTemp }} °C + + + {{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }} + + {{ $t('Panels.ExtruderControlPanel.Requested') }}: + {{ feedamount * extrudeFactor }} mm + + {{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm + + + + + + + + + + + + + + diff --git a/src/components/panels/Extruder/ExtruderControlPanelTools.vue b/src/components/panels/Extruder/ExtruderControlPanelTools.vue new file mode 100644 index 000000000..0d675ee0f --- /dev/null +++ b/src/components/panels/Extruder/ExtruderControlPanelTools.vue @@ -0,0 +1,69 @@ + + + + + + + + + diff --git a/src/components/panels/Extruder/ExtruderControlPanelToolsItem.vue b/src/components/panels/Extruder/ExtruderControlPanelToolsItem.vue new file mode 100644 index 000000000..937b7ae89 --- /dev/null +++ b/src/components/panels/Extruder/ExtruderControlPanelToolsItem.vue @@ -0,0 +1,45 @@ + + + {{ macro.name }} + + + + diff --git a/src/components/panels/Extruder/ExtrusionFactorSettings.vue b/src/components/panels/Extruder/ExtrusionFactorSettings.vue new file mode 100644 index 000000000..0766e7ccf --- /dev/null +++ b/src/components/panels/Extruder/ExtrusionFactorSettings.vue @@ -0,0 +1,27 @@ + + + + + + + diff --git a/src/components/panels/Extruder/FirmwareRetractionSettings.vue b/src/components/panels/Extruder/FirmwareRetractionSettings.vue new file mode 100644 index 000000000..9e42f99a8 --- /dev/null +++ b/src/components/panels/Extruder/FirmwareRetractionSettings.vue @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/panels/Extruder/PressureAdvanceSettings.vue b/src/components/panels/Extruder/PressureAdvanceSettings.vue new file mode 100644 index 000000000..32ac28ef6 --- /dev/null +++ b/src/components/panels/Extruder/PressureAdvanceSettings.vue @@ -0,0 +1,144 @@ + + + + + + + + + + + {{ mdiRestart }} + + + + + + + + + + + + + + + + + + diff --git a/src/components/panels/ExtruderControlPanel.vue b/src/components/panels/ExtruderControlPanel.vue index fcbe7f956..ff2395c9b 100644 --- a/src/components/panels/ExtruderControlPanel.vue +++ b/src/components/panels/ExtruderControlPanel.vue @@ -1,10 +1,11 @@ + card-class="extruder-control-panel" + class="pb-1"> @@ -21,8 +22,8 @@ @@ -39,8 +40,8 @@ @@ -53,319 +54,55 @@ - - - - - - - {{ tool.name }} - - - - - - - - - - - - - - - - - - - - - - - - - - {{ value }} - - - - - - - - {{ value }} - - - - - - - - - - - {{ mdiArrowUpBold }} - {{ $t('Panels.ExtruderControlPanel.Retract') }} - - - - - {{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }} - {{ minExtrudeTemp }} °C - - - {{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }} - - {{ $t('Panels.ExtruderControlPanel.Requested') }}: - {{ feedamount * extrudeFactor }} mm - - {{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm - - - - - - - - {{ mdiArrowDownBold }} - {{ $t('Panels.ExtruderControlPanel.Extrude') }} - - - - - {{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }} - {{ minExtrudeTemp }} °C - - - {{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }} - - {{ $t('Panels.ExtruderControlPanel.Requested') }}: - {{ feedamount * extrudeFactor }} mm - - {{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm - - - - - - - - - - - - - - - {{ mdiArrowUpBold }} - {{ $t('Panels.ExtruderControlPanel.Retract') }} - - - - - {{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }} - {{ minExtrudeTemp }} °C - - - {{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }} - - {{ $t('Panels.ExtruderControlPanel.Requested') }}: - {{ feedamount * extrudeFactor }} mm - - {{ $t('Panels.ExtruderControlPanel.Allowed') }}: - {{ maxExtrudeOnlyDistance }} mm - - - - - - - - {{ mdiArrowDownBold }} - {{ $t('Panels.ExtruderControlPanel.Extrude') }} - - - - - {{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }} - {{ minExtrudeTemp }} °C - - - {{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }} - - {{ $t('Panels.ExtruderControlPanel.Requested') }}: - {{ feedamount * extrudeFactor }} mm - - {{ $t('Panels.ExtruderControlPanel.Allowed') }}: - {{ maxExtrudeOnlyDistance }} mm - - - - - - - - - - - - {{ $t('Panels.ExtruderControlPanel.EstimatedExtrusion') }} ~ {{ extrudedLength }} mm @ - {{ volumetricFlow }} mm³/s - - - {{ mdiDiameterVariant }} - - {{ nozzleDiameter }} mm - - - - - + + + + + + + + + + + + + - - diff --git a/src/components/panels/ExtruderSettings/FirmwareRetractionSettings.vue b/src/components/panels/ExtruderSettings/FirmwareRetractionSettings.vue deleted file mode 100644 index 51223065c..000000000 --- a/src/components/panels/ExtruderSettings/FirmwareRetractionSettings.vue +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/components/panels/ExtruderSettings/PressureAdvanceSettings.vue b/src/components/panels/ExtruderSettings/PressureAdvanceSettings.vue deleted file mode 100644 index b7f2a1921..000000000 --- a/src/components/panels/ExtruderSettings/PressureAdvanceSettings.vue +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - {{ mdiRestart }} - - - - - - - - - - - - - - - - - diff --git a/src/store/printer/getters.ts b/src/store/printer/getters.ts index d9d330479..3da6dcbc9 100644 --- a/src/store/printer/getters.ts +++ b/src/store/printer/getters.ts @@ -772,28 +772,6 @@ export const getters: GetterTree = { return output }, - getToolchangeMacros: (state, getters) => { - const macros = getters['getMacros'] - const tools: PrinterStateToolchangeMacro[] = [] - - macros - .filter((macro: any) => macro.name.toUpperCase().match(/^T\d+/)) - .forEach((macro: any) => - tools.push({ - name: macro.name, - active: macro.variables.active ?? false, - color: macro.variables.color ?? macro.variables.colour ?? null, - }) - ) - - return tools.sort((a, b) => { - const numberA = parseInt(a.name.slice(1)) - const numberB = parseInt(b.name.slice(1)) - - return numberA - numberB - }) - }, - getKinematics: (state) => { if (!state.configfile?.settings?.printer) return false