bugfix: filament runout sensor new design / rework
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
parent
339dda6455
commit
6f4f33f1a6
@ -2,15 +2,15 @@
|
|||||||
<div>
|
<div>
|
||||||
<div v-for="(runout, index) of this['printer/getFilamentSwitchSensors']" v-bind:key="index">
|
<div v-for="(runout, index) of this['printer/getFilamentSwitchSensors']" v-bind:key="index">
|
||||||
<v-card class="mt-6">
|
<v-card class="mt-6">
|
||||||
<v-list-item>
|
<v-toolbar flat dense >
|
||||||
<v-list-item-avatar color="grey"><v-icon dark>mdi-printer-3d-nozzle-alert</v-icon></v-list-item-avatar>
|
<v-toolbar-title>
|
||||||
<v-list-item-content>
|
<span class="subheading"><v-icon left>mdi-printer-3d-nozzle-alert</v-icon>{{ runout.name }}</span>
|
||||||
<v-list-item-title class="headline">{{ runout.name }}</v-list-item-title>
|
</v-toolbar-title>
|
||||||
</v-list-item-content>
|
<v-spacer></v-spacer>
|
||||||
</v-list-item>
|
<v-switch v-model="runout.enabled" hide-details @change="changeSensor(runout)" class="settingsRunoutSwitchInput my-0"></v-switch>
|
||||||
<v-divider class="my-2"></v-divider>
|
</v-toolbar>
|
||||||
<v-card-text class="px-0 pt-0 pb-2 content">
|
<v-card-text v-if="runout.enabled">
|
||||||
<settings-runout-switch :name="runout.name" :enabled="runout.enabled" :filament_detected="runout.filament_detected"></settings-runout-switch>
|
<v-chip label block :color="runout.filament_detected ? 'green' : 'red' " class="d-block text-center">{{ runout.filament_detected ? 'detected' : 'empty' }}</v-chip>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
</div>
|
</div>
|
||||||
@ -19,11 +19,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import SettingsRunoutSwitch from "../../../inputs/SettingsRunoutSwitch";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
SettingsRunoutSwitch
|
|
||||||
},
|
},
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
@ -36,7 +35,11 @@
|
|||||||
])
|
])
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changeSensor(runout) {
|
||||||
|
const gcode = 'SET_FILAMENT_SENSOR SENSOR='+runout.name+' ENABLE='+(runout.enabled ? 1 : 0)
|
||||||
|
this.$store.commit('server/addEvent', gcode)
|
||||||
|
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
@ -1,51 +0,0 @@
|
|||||||
<style>
|
|
||||||
.settingsRunoutSwitchInput .v-messages {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<v-row class="px-6" >
|
|
||||||
<v-col sm-12>
|
|
||||||
<v-switch v-model="value" :label="enabled ? 'enabled' : 'disabled'" @change="changeSensor()" class="settingsRunoutSwitchInput my-0"></v-switch>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
<v-row class="px-6" v-if="value" >
|
|
||||||
<v-col sm-12>
|
|
||||||
<label class="mt-1 d-inline-block">Filament:</label>
|
|
||||||
<v-chip class="float-right" :color="filament_detected ? 'green' : 'red' " text-color="white">{{ filament_detected ? 'detected' : 'empty' }}</v-chip>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data: function() {
|
|
||||||
return {
|
|
||||||
value: false,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
name: String,
|
|
||||||
enabled: Boolean,
|
|
||||||
filament_detected: Boolean,
|
|
||||||
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
changeSensor() {
|
|
||||||
let gcode = 'SET_FILAMENT_SENSOR SENSOR='+this.name+' ENABLE='+(this.value ? 1 : 0)
|
|
||||||
this.$store.commit('server/addEvent', gcode)
|
|
||||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.value = this.enabled
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
Loading…
x
Reference in New Issue
Block a user