resolve gcode as array/text

This commit is contained in:
Stewart Allen 2022-10-18 21:57:27 -04:00
commit 91514aeb86
6 changed files with 44 additions and 19 deletions

View file

@ -120,6 +120,8 @@ function prepEach(widget, settings, print, firstPoint, update) {
};
}) : zmax;
newOutput.push(layerOut);
function newLayer() {
if (layerOut.length < 2) {
return;
@ -134,6 +136,9 @@ function prepEach(widget, settings, print, firstPoint, update) {
if (!text || text.length === 0) {
return;
}
if (Array.isArray(text)) {
text = text.join('\r\n');
}
newOutput.push(text);
if (layerOut.length) {
layerOut = [];
@ -420,7 +425,8 @@ function prepEach(widget, settings, print, firstPoint, update) {
nextIsMove = true;
lastMode = op.op.type;
let weight = op.weight();
layerOut.push({ op });
newLayer();
layerOut.push({ op: op.op });
op.prepare(ops, (progress, message) => {
update((opSum + (progress * weight)) / opTot, message || op.type(), message);
});