same fix for T0/T1/G90/G91/G92

This commit is contained in:
Stewart Allen 2021-03-11 10:36:51 -05:00
commit 6f4afa0cbe

View file

@ -190,8 +190,8 @@
let t1 = false;
for (let i=0; i<device.gcodePre.length; i++) {
let line = device.gcodePre[i];
if (line.indexOf('T0') >= 0) t0 = true; else
if (line.indexOf('T1') >= 0) t1 = true; else
if (line.indexOf('T0') === 0) t0 = true; else
if (line.indexOf('T1') === 0) t1 = true; else
if (line.indexOf('M82') === 0) {
extrudeAbs = true;
extrudeSet = true;
@ -200,8 +200,8 @@
extrudeAbs = false;
extrudeSet = true;
} else
if (line.indexOf('G90') >= 0 && !extrudeSet) extrudeAbs = true; else
if (line.indexOf('G91') >= 0 && !extrudeSet) extrudeAbs = false; else
if (line.indexOf('G90') === 0 && !extrudeSet) extrudeAbs = true; else
if (line.indexOf('G91') === 0 && !extrudeSet) extrudeAbs = false; else
if (line.indexOf('G92') === 0) {
line.split(";")[0].split(' ').forEach(function (tok) {
let val = parseFloat(tok.substring(1) || 0) || 0;