handle comments w/ Exx in prefix

This commit is contained in:
Stewart Allen 2017-11-11 13:19:15 -05:00
commit 3eecf09f12

View file

@ -338,9 +338,11 @@ var gs_kiri_fdm = exports;
for (var i=0; i<device.gcodePre.length; i++) {
var line = device.gcodePre[i];
if (device.extrudeAbs && line.indexOf('E') > 0) {
line.split(' ').forEach(function (tok) {
line.split(";")[0].split(' ').forEach(function (tok) {
// use max E position from gcode-preamble
if (tok[0] == 'E') outputLength = Math.max(outputLength, parseFloat(tok.substring(1)));
if (tok[0] == 'E') {
outputLength = Math.max(outputLength, parseFloat(tok.substring(1)) || 0);
}
});
}
append(constReplace(line, consts));