feature: add probe to endstop status panel
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
@@ -7,12 +7,20 @@
|
|||||||
</v-toolbar>
|
</v-toolbar>
|
||||||
<v-card-text class="pb-0">
|
<v-card-text class="pb-0">
|
||||||
<v-container px-0 py-0>
|
<v-container px-0 py-0>
|
||||||
<v-row v-for="(status, index) of sortEndstops" v-bind:key="index">
|
<div class="py-2" v-if="Object.keys(endstops).length">
|
||||||
<v-col>
|
<v-row v-for="(status, index) of sortEndstops" v-bind:key="index">
|
||||||
<label class="mt-1 d-inline-block">Endstop <b>{{ index.toUpperCase() }}</b></label>
|
<v-col class="py-1">
|
||||||
<v-chip class="float-right" :color="status === 'open' ? 'green' : 'red' " text-color="white">{{ status }}</v-chip>
|
<label class="mt-1 d-inline-block">Endstop <b>{{ index.toUpperCase() }}</b></label>
|
||||||
</v-col>
|
<v-chip class="float-right" small :color="status === 'open' ? 'green' : 'red' " text-color="white">{{ status }}</v-chip>
|
||||||
</v-row>
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<v-row v-if="probe !== false">
|
||||||
|
<v-col class="py-1">
|
||||||
|
<label class="mt-1 d-inline-block">Probe</label>
|
||||||
|
<v-chip class="float-right" small :color="probe ? 'red' : 'green' " text-color="white">{{ probe ? 'TRIGGERED' : 'open' }}</v-chip>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</div>
|
||||||
<v-row v-if="(Object.keys(endstops).length === 0 && endstops.constructor === Object)" >
|
<v-row v-if="(Object.keys(endstops).length === 0 && endstops.constructor === Object)" >
|
||||||
<v-col>
|
<v-col>
|
||||||
<p>Press the sync-button on the right-bottom to load the current endstop status.</p>
|
<p>Press the sync-button on the right-bottom to load the current endstop status.</p>
|
||||||
@@ -45,15 +53,29 @@
|
|||||||
...mapState({
|
...mapState({
|
||||||
loadings: state => state.socket.loadings,
|
loadings: state => state.socket.loadings,
|
||||||
endstops: state => state.printer.endstops,
|
endstops: state => state.printer.endstops,
|
||||||
})
|
}),
|
||||||
|
probe: {
|
||||||
|
get() {
|
||||||
|
if (
|
||||||
|
'probe' in this.$store.state.printer &&
|
||||||
|
'last_query' in this.$store.state.printer.probe
|
||||||
|
) return this.$store.state.printer.probe.last_query
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getEndstops();
|
this.getEndstops();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
syncEndstops() {
|
syncEndstops() {
|
||||||
this.$store.commit('socket/addLoading', { name: 'queryEndstops' });
|
this.$store.commit('socket/addLoading', { name: 'queryEndstops' })
|
||||||
this.$socket.sendObj('printer.query_endstops.status', { }, "printer/getEndstopStatus");
|
this.$socket.sendObj('printer.query_endstops.status', { }, "printer/getEndstopStatus")
|
||||||
|
if (this.probe !== false) {
|
||||||
|
this.$store.commit('server/addEvent', { message: "QUERY_PROBE", type: 'command' })
|
||||||
|
this.$socket.sendObj('printer.gcode.script', { script: "QUERY_PROBE" })
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getEndstops() {
|
getEndstops() {
|
||||||
this.sortEndstops = {};
|
this.sortEndstops = {};
|
||||||
|
Reference in New Issue
Block a user