feat: show current bed mesh profile name in toolhead panel (#1000)
Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
1 parent
4c9aab5a2d
commit
2eb34007e1
1 file changed
+43
-9
@@ -1,20 +1,42 @@
|
||||
<template>
|
||||
<responsive
|
||||
:breakpoints="{
|
||||
small: (el) => el.width <= 320,
|
||||
xsmall: (el) => el.width <= 320,
|
||||
small: (el) => el.width > 320 && el.width <= 460,
|
||||
medium: (el) => el.width > 460 && el.width <= 560,
|
||||
large: (el) => el.width > 560,
|
||||
}">
|
||||
<template #default="{ el }">
|
||||
<v-container class="py-0">
|
||||
<v-row>
|
||||
<v-col class="v-subheader text--secondary pr-0">
|
||||
<v-icon small class="mr-2">
|
||||
<v-row class="flex-nowrap pb-1">
|
||||
<v-col
|
||||
:class="{
|
||||
'col-5': el.is.small,
|
||||
'col-4': el.is.xsmall || el.is.medium,
|
||||
'col-3': el.is.large,
|
||||
}"
|
||||
class="v-subheader text--secondary mr-2">
|
||||
<v-icon small class="mr-1">
|
||||
{{ mdiCrosshairsGps }}
|
||||
</v-icon>
|
||||
<span>{{ $t('Panels.ToolheadControlPanel.Position') }}: {{ displayPositionAbsolute }}</span>
|
||||
<span v-if="!el.is.xsmall" class="text-no-wrap">
|
||||
{{ $t('Panels.ToolheadControlPanel.Position') }}:
|
||||
</span>
|
||||
<span class="text-no-wrap">{{ displayPositionAbsolute }}</span>
|
||||
</v-col>
|
||||
<v-col
|
||||
v-if="currentProfileName"
|
||||
class="v-subheader text--secondary pl-2 justify-end text-no-wrap text-truncate">
|
||||
<v-icon small class="mr-1">
|
||||
{{ mdiGrid }}
|
||||
</v-icon>
|
||||
<span class="text-no-wrap text-truncate">
|
||||
{{ currentProfileName }}
|
||||
</span>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row dense>
|
||||
<v-col :class="el.is.small ? 'col-12' : 'col-4'">
|
||||
<v-col :class="el.is.xsmall ? 'col-12' : 'col-4'">
|
||||
<move-to-input
|
||||
v-model="input.x.pos"
|
||||
:label="livePositions.x"
|
||||
@@ -28,7 +50,7 @@
|
||||
@validate="validate"
|
||||
@submit="sendCmd"></move-to-input>
|
||||
</v-col>
|
||||
<v-col :class="el.is.small ? 'col-12' : 'col-4'">
|
||||
<v-col :class="el.is.xsmall ? 'col-12' : 'col-4'">
|
||||
<move-to-input
|
||||
v-model="input.y.pos"
|
||||
:label="livePositions.y"
|
||||
@@ -42,7 +64,7 @@
|
||||
@validate="validate"
|
||||
@submit="sendCmd"></move-to-input>
|
||||
</v-col>
|
||||
<v-col :class="el.is.small ? 'col-12' : 'col-4'">
|
||||
<v-col :class="el.is.xsmall ? 'col-12' : 'col-4'">
|
||||
<move-to-input
|
||||
v-model="input.z.pos"
|
||||
:label="livePositions.z"
|
||||
@@ -68,13 +90,14 @@ import BaseMixin from '@/components/mixins/base'
|
||||
import ControlMixin from '@/components/mixins/control'
|
||||
import MoveToInput from '@/components/inputs/MoveToInput.vue'
|
||||
import Responsive from '@/components/ui/Responsive.vue'
|
||||
import { mdiCrosshairsGps } from '@mdi/js'
|
||||
import { mdiCrosshairsGps, mdiGrid } from '@mdi/js'
|
||||
|
||||
@Component({
|
||||
components: { MoveToInput, Responsive },
|
||||
})
|
||||
export default class MoveToControl extends Mixins(BaseMixin, ControlMixin) {
|
||||
mdiCrosshairsGps = mdiCrosshairsGps
|
||||
mdiGrid = mdiGrid
|
||||
|
||||
input: { [index: string]: any } = {
|
||||
x: { pos: '', valid: true },
|
||||
@@ -159,6 +182,17 @@ export default class MoveToControl extends Mixins(BaseMixin, ControlMixin) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get currently loaded bed mesh profile name
|
||||
*/
|
||||
get bed_mesh() {
|
||||
return this.$store.state.printer.bed_mesh ?? null
|
||||
}
|
||||
|
||||
get currentProfileName() {
|
||||
return this.bed_mesh?.profile_name ?? ''
|
||||
}
|
||||
|
||||
sendCmd(): void {
|
||||
const xPos = this.input.x.pos !== this.gcodePositions.x ? ` X${this.input.x.pos}` : ''
|
||||
const yPos = this.input.y.pos !== this.gcodePositions.y ? ` Y${this.input.y.pos}` : ''
|
||||
|
||||
Reference in new issue
Block a user