setting load_position only if the offset is zero

This commit is contained in:
sanjayk03-dev
2024-07-24 22:40:31 +05:30
parent 54ce6c8185
commit ace321b363
2 changed files with 5 additions and 1 deletions

View File

@@ -165,6 +165,10 @@ module.exports = {
// return this.is_idle || this.is_paused;
},
can_load_origin: function (axis) {
return this.is_idle && this.state["offset_" + axis] == 0;
},
message: function () {
if (this.mach_state == "ESTOPPED") {
return this.state.er;

View File

@@ -163,7 +163,7 @@ script#control-view-template(type="text/x-template")
title=`Home {{'${axis}' | upper}} axis.`, style="height:60px;width:60px")
.fa.fa-home
button.pure-button(:disabled="!is_idle", @click=`load_position('${axis}')`,
button.pure-button(:disabled="!can_load_origin", @click=`load_position('${axis}')`,
title=`Load {{'${axis}' | upper}} origin.`, style="height:60px;width:60px")
.fa.fa-map-pin