Skip to content

Commit

Permalink
feat: add ability to remove mesh profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
cadriel committed Jan 3, 2021
1 parent 0ec0386 commit f2830df
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
46 changes: 38 additions & 8 deletions src/components/widgets/configuration/BedMeshWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,39 @@
</td>
<td class="grey--text text--lighten-1 text-body-1"><span v-if="mesh.active">{{ variance.toFixed(4) }}</span></td>
<td>
<v-btn
@click="loadProfile(mesh.profile_name)"
:elevation="2"
:disabled="mesh.active || hasWaits || printerPrinting || printerBusy"
color="secondary"
small>
Load Profile
</v-btn>
<v-tooltip left>
<template v-slot:activator="{ on, attrs }">
<v-btn
@click="loadProfile(mesh.profile_name)"
:elevation="2"
:disabled="mesh.active || hasWaits || printerPrinting || printerBusy"
v-bind="attrs"
v-on="on"
color="secondary"
small
icon>
<v-icon small>$open</v-icon>
</v-btn>
</template>
<span>Load Profile</span>
</v-tooltip>
<v-tooltip right>
<template v-slot:activator="{ on, attrs }">
<v-btn
@click="removeProfile(mesh.profile_name)"
:elevation="2"
:disabled="hasWaits || printerPrinting || printerBusy"
v-bind="attrs"
v-on="on"
color="warning"
class="ml-2"
icon
small>
<v-icon small>$delete</v-icon>
</v-btn>
</template>
<span>Delete Profile. This WILL restart your printer.</span>
</v-tooltip>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -226,6 +251,11 @@ export default class BedMeshWidget extends Mixins(UtilsMixin) {
this.sendGcode('BED_MESH_PROFILE LOAD=' + name)
}
removeProfile (name: string) {
this.sendGcode('BED_MESH_PROFILE REMOVE=' + name)
this.sendGcode('SAVE_CONFIG')
}
saveToConfig () {
(this.$refs.form as Vue & { validate: () => boolean }).validate()
if (this.saveDialog.valid) {
Expand Down
4 changes: 3 additions & 1 deletion src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ import {
mdiChevronRight,
mdiChevronLeft,
mdiDrag,
mdiCheckboxMultipleBlank
mdiCheckboxMultipleBlank,
mdiOpenInApp
} from '@mdi/js'

/**
Expand All @@ -101,6 +102,7 @@ export const Icons = Object.freeze({
help: mdiHelp,
limits: mdiArrowHorizontalLock,
send: mdiSend,
open: mdiOpenInApp,
tabs: mdiCheckboxMultipleBlank,
menu: mdiDotsVertical,
menuAlt: mdiMenuDown,
Expand Down
1 change: 0 additions & 1 deletion todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## Next Up
- add filesystem usage
- add klippy disconnected notify impl so that we can error correctly if say a heater stops working
- z-offset configuration + sheet config + probe calibration
- i18n (translations)
- docker image
Expand Down

0 comments on commit f2830df

Please sign in to comment.