refactor gcode parser

This commit is contained in:
Stewart Allen 2020-11-09 18:21:59 -05:00
commit 3aa07314c2
3 changed files with 61 additions and 62 deletions

View file

@ -164,7 +164,8 @@ KIRI.worker = {
};
const print = KIRI.newPrint(settings, Object.values(cache));
const tools = settings.device.extruders;
const thin = settings.controller.thinRender || settings.mode !== 'FDM';
const mode = settings.mode;
const thin = settings.controller.thinRender || mode !== 'FDM';
const parsed = print.parseGCode(code, offset, progress => {
send.data({ progress: progress * 0.5 });
@ -173,7 +174,7 @@ KIRI.worker = {
send.data({ progress: 0.5 + progress * 0.5 });
}, { thin, tools });
send.done({parsed: KIRI.codec.encode(layers)});
});
}, { fdm : mode === 'FDM' });
},
clear: function(data, send) {