commented load position from web

This commit is contained in:
sanjayk03-dev
2024-07-30 18:00:15 +05:30
parent b6f091f0ed
commit 17bc101cef
2 changed files with 20 additions and 20 deletions

View File

@@ -779,20 +779,20 @@ module.exports = {
api.put(`position/${axis}`, { position: parseFloat(position) }); api.put(`position/${axis}`, { position: parseFloat(position) });
}, },
load_position: function (axes) { // load_position: function (axes) {
try { // try {
for (const axis of axes) { // for (const axis of axes) {
if (this.config.axes["offset_" + axis] && this.state["offset_" + axis] == 0 && this[axis].state == "HOMED") { // if (this.config.axes["offset_" + axis] && this.state["offset_" + axis] == 0 && this[axis].state == "HOMED") {
const position = this.state.metric // const position = this.state.metric
? this.config.axes["offset_" + axis] // ? this.config.axes["offset_" + axis]
: this.config.axes["offset_" + axis] / 25.4; // : this.config.axes["offset_" + axis] / 25.4;
this.set_position(axis, -position); // this.set_position(axis, -position);
} // }
} // }
} catch (error) { // } catch (error) {
console.warn(error); // console.warn(error);
} // }
}, // },
zero_all: function () { zero_all: function () {
for (const axis of "xyzabc") { for (const axis of "xyzabc") {

View File

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