feature: exclude object map (#369)

* feature: add 2D object map (testing)
* feature: 2D map for objects
* chore: update materialdesignicons
* feature: move exclude object map and list in a seperate dialog
* feature: add hover function to display hovered object in the map
* feature: colorize border of current object
* feature: click on object in map to cancel object
* feature: add mobile support for exclude object dialog

Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Stefan Dej authored and GitHub committed 2021-10-05 22:52:17 +02:00
1 parent dd2c8c58ca
commit a81a486602
8 files changed
+449 -88

No files matched your search

@@ -0,0 +1,95 @@
<style lang="scss" scoped>
</style>
<template>
<div v-if="['printing', 'paused'].includes(printer_state) && printing_objects.length">
<v-container>
<v-row>
<v-col class="py-2">
<span class="subtitle-2 d-block px-0 text--disabled"><v-icon class="mr-2" small>mdi-printer-3d-nozzle</v-icon>{{ current_object !== null ? current_object : '--' }}</span>
</v-col>
<v-col class="col-auto py-2">
<v-icon class="text--disabled cursor-pointer" @click="openCancelObjectDialog(current_object)" small v-if="current_object !== null">mdi-close-circle</v-icon>
</v-col>
</v-row>
</v-container>
<v-divider class="mt-0 mb-0" ></v-divider>
<v-dialog v-model="boolShowExcludeObjectDialog" max-width="400">
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-selection-remove</v-icon>{{ $t("Panels.StatusPanel.ExcludeObject.ExcludeObjectHeadline") }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="mt-3">{{ $t("Panels.StatusPanel.ExcludeObject.ExcludeObjectText", {name: excludeObjectDialogName}) }}</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn text @click="boolShowExcludeObjectDialog = false">{{ $t("Panels.StatusPanel.ExcludeObject.Cancel") }}</v-btn>
<v-btn color="primary" text @click="cancelObject">{{ $t("Panels.StatusPanel.ExcludeObject.ExcludeObject") }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<status-panel-exclude-object-dialog
:show-dialog.sync="showDialogPass"
:exclude-object-dialog-name.sync="excludeObjectDialogName"
@update:name="updateExcludeObjectDialogName"
:exclude-object-dialog-bool.sync="boolShowExcludeObjectDialog"
@update:bool="updateExcludeObjectDialogBool"
></status-panel-exclude-object-dialog>
</div>
</template>
<script lang="ts">
import Component from 'vue-class-component'
import {Mixins, Prop} from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import StatusPanelExcludeObjectDialog from '@/components/panels/StatusPanelExcludeObjectDialog.vue'
@Component({
components: {StatusPanelExcludeObjectDialog}
})
export default class StatusPanelExcludeObject extends Mixins(BaseMixin) {
boolShowExcludeObjectDialog = false
excludeObjectDialogName = ''
@Prop({ required: true }) readonly showDialog!: boolean
get showDialogPass() {
return this.showDialog
}
set showDialogPass(newVal) {
this.$emit('update:showDialog', newVal )
}
get printing_objects() {
return this.$store.state.printer.exclude_object?.objects ?? []
}
get current_object() {
return this.$store.state.printer.exclude_object?.current_object ?? null
}
get excluded_objects() {
return this.$store.state.printer.exclude_object?.excluded_objects ?? []
}
updateExcludeObjectDialogName(newVal: string) {
this.excludeObjectDialogName = newVal
}
updateExcludeObjectDialogBool(newVal: boolean) {
this.boolShowExcludeObjectDialog = newVal
}
openCancelObjectDialog(objectName: string) {
this.excludeObjectDialogName = objectName
this.boolShowExcludeObjectDialog = true
}
cancelObject() {
this.$socket.emit('printer.gcode.script', {script: 'EXCLUDE_OBJECT NAME='+this.excludeObjectDialogName})
this.boolShowExcludeObjectDialog = false
}
}
</script>