add laser output operators and device settings in CAM mode

This commit is contained in:
Stewart Allen 2022-10-18 19:51:53 -04:00
commit 234b8c0a6e
9 changed files with 147 additions and 32 deletions

View file

@ -527,6 +527,12 @@ const conf = exports({
camRegisterThru: 5,
camFlipAxis: "X",
camFlipOther: "",
camLaserEnable: "M321",
camLaserDisable: "M322",
camLaserOn: "M3",
camLaserOff: "M5",
camLaserSpeed: 100,
camLaserPower: 1,
// camDrillReg: "none",
camTabsWidth: 5,
camTabsHeight: 5,

View file

@ -34,7 +34,7 @@ class Print {
this.nextType = type;
}
addOutput(array, point, emit, speed, tool) {
addOutput(array, point, emit, speed, tool, type) {
let { lastPoint, lastEmit, lastOut } = this;
// drop duplicates (usually intruced by FDM bisections)
if (lastPoint && point) {
@ -47,7 +47,7 @@ class Print {
// if (emit && emit < 1) console.log(emit);
this.lastPoint = point;
this.lastEmit = emit;
this.lastOut = lastOut = new Output(point, emit, speed, tool, this.nextType);
this.lastOut = lastOut = new Output(point, emit, speed, tool, type || this.nextType);
if (tool !== undefined) {
this.tools[tool] = true;
}

View file

@ -141,6 +141,10 @@ async function path(levels, update, opts = {}) {
let emits = 0;
level.forEach(out => {
// skip cam op records
if (out.op) {
return;
}
if (retracted && out.emit) {
retracted = false;
engages.push(lastOut.point);