diff --git a/src/js/control-view.js b/src/js/control-view.js index b5c67f5..3603216 100644 --- a/src/js/control-view.js +++ b/src/js/control-view.js @@ -255,6 +255,21 @@ module.exports = { }); }, + // Home every enabled axis at once (legacy Onefinity behavior). + // The XYZ home is fired first via the standard /api/home endpoint, + // then the W axis is homed if it is enabled. The two cycles run + // in parallel — W is on the auxcnc ESP and doesn't share motors + // with the AVR — so the user sees one click homing everything. + home_all: function () { + this.ask_home = false; + api.put("home"); + if (this.w && this.w.enabled) { + api.put("aux/home").catch(function (err) { + console.error("W home failed:", err); + }); + } + }, + aux_jog: function (delta_mm) { api.put("aux/jog", { mm: delta_mm }).catch(function (err) { console.error("W jog failed:", err); diff --git a/src/pug/templates/control-view.pug b/src/pug/templates/control-view.pug index 1d78e01..6af83d3 100644 --- a/src/pug/templates/control-view.pug +++ b/src/pug/templates/control-view.pug @@ -213,7 +213,14 @@ script#control-view-template(type="text/x-template") div Offset div State div Toolpath - div(style="text-align:right") Actions + .actions-cell + // Master Home All. Each row's Actions cell has a per-axis + // home button; this header-level button homes every + // enabled axis (legacy Onefinity behavior). Auto-includes + // the W axis when it is enabled. + button.icon-btn(:disabled="!is_idle", + title="Home all axes.", @click="home_all()") + .fa.fa-house-chimney // Per-axis rows — keep unit-value + bindings from axis-vars each axis in 'xyzabc'