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.
This commit is contained in:
Claude
2026-04-30 17:37:49 +02:00
parent 23f22105a8
commit 7d5949f5fc
2 changed files with 46 additions and 0 deletions

View File

@@ -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) { show_set_position: function (axis) {
SvelteComponents.showDialog("SetAxisPosition", { axis }); SvelteComponents.showDialog("SetAxisPosition", { axis });
}, },

View File

@@ -107,6 +107,35 @@ script#control-view-template(type="text/x-template")
button(:style="getJogIncrStyle('large')", @click="jog_incr = 'large'") button(:style="getJogIncrStyle('large')", @click="jog_incr = 'large'")
span {{jog_incr_amounts[display_units].large}}#[span.jog-units {{metric ? 'mm' : 'in'}}] 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") tr(v-if="state['2an'] == 3")
td(style="height:100px", align="center", colspan="1") td(style="height:100px", align="center", colspan="1")
button(@click="show_probe_dialog=true") button(@click="show_probe_dialog=true")