move axis reset macro to device

This commit is contained in:
Stewart Allen 2025-12-10 20:08:57 -05:00
commit cc8dbbc908
8 changed files with 21 additions and 11 deletions

View file

@ -350,7 +350,6 @@ export function createPopOps() {
linear: 'camLatheLinear',
offStart: 'camLatheOffStart',
offEnd: 'camLatheOffEnd',
axisreset: 'camLatheAxisReset'
}).inputs = {
tool: UC.newSelect(LANG.cc_tool, {}, "tools"),
sep: UC.newBlank({ class: "pop-sep" }),
@ -367,7 +366,6 @@ export function createPopOps() {
leave: UC.newInput(LANG.cf_leav_s, { title: LANG.cf_leav_l, convert: toFloat, bound: UC.bound(0, 100) }),
sep: UC.newBlank({ class: "pop-sep" }),
linear: UC.newBoolean(LANG.ci_line_s, undefined, { title: LANG.ci_line_l }),
axisreset: UC.newRow([ UC.newButton("axis reset", gcodeEditor('Rotary (A) Axis Reset Macro', 'axisreset')) ], { class: "ext-buttons f-row" })
};
function canDogBones() {

View file

@ -19,6 +19,8 @@ const ptyp = clib.PolyType;
const cfil = clib.PolyFillType;
const ts_off = 0.01;
// todo: review tool_shadow. offset both directions for travel inside and outside / between?
class OpArea extends CamOp {
constructor(state, op) {
super(state, op);

View file

@ -53,11 +53,9 @@ class OpLathe extends CamOp {
}
prepare(ops, progress) {
let { op, slices, topo } = this;
let { axisreset } = op;
let { slices, state, topo } = this;
let { camOut, newLayer, setContouring, setNextIsMove, zSafe } = ops;
let rez = topo.resolution;
let { gcodeResetA } = state.settings.device;
// start top center, X = 0, Y = 0 closest to 4th axis chuck
camOut(newPoint(0, 0, zSafe).setA(0), 0);
@ -81,7 +79,7 @@ class OpLathe extends CamOp {
// move to safe height and reset A axis
newLayer();
ops.addGCode([`G0 Z${zSafe.round(2)}`, axisreset.join('\n') ?? "G92.4 A0 R0"]);
ops.addGCode([`G0 Z${zSafe.round(2)}`, gcodeResetA.join('\n') ?? "G92.4 A0 R0"]);
}
}