load all position

This commit is contained in:
sanjayk03-dev
2024-07-23 23:54:12 +05:30
parent 8083cf877c
commit 205305bff5
2 changed files with 15 additions and 3 deletions

View File

@@ -779,9 +779,17 @@ module.exports = {
api.put(`position/${axis}`, { position: parseFloat(position) });
},
load_position: function (axis) {
console.log(this.config.axes["offset_" + axis]);
this.set_position(axis, -this.config.axes["offset_" + axis]);
load_position: function (axes) {
try {
for (const axis of axes) {
if (this.config.axes["offset_" + axis]) {
console.log(axis, this.config.axes["offset_" + axis]);
this.set_position(axis, -this.config.axes["offset_" + axis]);
}
}
} catch (error) {
console.warn(error);
}
},
zero_all: function () {

View File

@@ -129,6 +129,10 @@ script#control-view-template(type="text/x-template")
button.pure-button(title="Home all axes.", @click="home()",
:disabled="!is_idle",style="height:60px;width:60px")
.fa.fa-home
button.pure-button(:disabled="!is_idle", @click=`load_position('xyz')`,
title=`Load all origin.`, style="height:60px;width:60px")
.fa.fa-map-pin
each axis in 'xyzabc'
tr.axis(:class=`${axis}.klass`, v-if=`${axis}.enabled`,