From 7d5949f5fc30200ef26f1a4eded5fc317c8d3efe Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 30 Apr 2026 17:37:49 +0200 Subject: [PATCH] UI: add W jog row (W- / W Origin / W+ / Home W) under the XYZ jog grid Mirrors the 4-column rotary A row that appears when 2an==3, so the same fine/small/medium/large increment selector that drives XYZ jogging now also drives W jogging. New control-view methods: - aux_jog_incr(sign) - PUTs aux/jog with the current jog_incr amount converted to mm (handles imperial display units) - aux_move_zero() - PUTs aux/move {mm:0}, the absolute counterpart to aux_set_zero (which redefines the current pos as zero without moving) Row is hidden when w.enabled is false, so users without the auxcnc controller see no change. --- src/js/control-view.js | 17 +++++++++++++++++ src/pug/templates/control-view.pug | 29 +++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/js/control-view.js b/src/js/control-view.js index 0fc9e3b..b134bcc 100644 --- a/src/js/control-view.js +++ b/src/js/control-view.js @@ -783,6 +783,23 @@ module.exports = { }); }, + // Use the same fine/small/medium/large increment buttons as the XYZ + // jog grid. sign=+1 for W+, -1 for W-. + aux_jog_incr: function (sign) { + const amount = + this.jog_incr_amounts[this.display_units][this.jog_incr]; + const delta_mm = sign * (this.metric ? amount : amount * 25.4); + this.aux_jog(delta_mm); + }, + + // "W Origin" - move W to 0 (absolute). Distinct from aux_set_zero, + // which sets the *current* position as the new zero without moving. + aux_move_zero: function () { + api.put("aux/move", { mm: 0 }).catch(function (err) { + console.error("W move-to-zero failed:", err); + }); + }, + show_set_position: function (axis) { SvelteComponents.showDialog("SetAxisPosition", { axis }); }, diff --git a/src/pug/templates/control-view.pug b/src/pug/templates/control-view.pug index cdc42dc..ee0df14 100644 --- a/src/pug/templates/control-view.pug +++ b/src/pug/templates/control-view.pug @@ -107,6 +107,35 @@ script#control-view-template(type="text/x-template") button(:style="getJogIncrStyle('large')", @click="jog_incr = 'large'") span {{jog_incr_amounts[display_units].large}}#[span.jog-units {{metric ? 'mm' : 'in'}}] + // W axis jog row (auxcnc). Only shown when the aux controller + // is enabled in aux.json. + tr(v-if="w.enabled") + td(style="height:100px", align="center", colspan="1") + button(@click="aux_jog_incr(-1)", + :disabled="!w.enabled", + style="display:grid;justify-content:center;align-items:center;padding:14px;") + | W- + .fa.fa-arrow-down + + td(style="height:100px", align="center", colspan="1") + button(@click="aux_move_zero()", :disabled="!w.enabled") + | W + br + | Origin + + td(style="height:100px", align="center", colspan="1") + button(@click="aux_jog_incr(+1)", + :disabled="!w.enabled", + style="display:grid;justify-content:center;align-items:center;padding:14px;") + | W+ + .fa.fa-arrow-up + + td(style="height:100px", align="center", colspan="1") + button(@click="aux_home()", :disabled="!w.enabled") + | Home + br + | W + tr(v-if="state['2an'] == 3") td(style="height:100px", align="center", colspan="1") button(@click="show_probe_dialog=true")