diff --git a/js/kiri-driver-fdm.js b/js/kiri-driver-fdm.js index fd867b9f..023eb315 100644 --- a/js/kiri-driver-fdm.js +++ b/js/kiri-driver-fdm.js @@ -901,7 +901,6 @@ let gs_kiri_fdm = exports; // look for extruder change and recalc emit factor if (out.tool !== undefined && out.tool !== tool) { - appendAllSub(extruder.extSelect); tool = out.tool; subst.nozzle = subst.tool = tool; extruder = extruders[tool]; @@ -912,6 +911,7 @@ let gs_kiri_fdm = exports; extruder.extFilament, path.layer === 0 ? (process.firstSliceHeight || process.sliceHeight) : path.height); + appendAllSub(extruder.extSelect); } // if no point in output, it's a dwell command diff --git a/js/kiri-print.js b/js/kiri-print.js index ae9bcd4b..63c9480a 100644 --- a/js/kiri-print.js +++ b/js/kiri-print.js @@ -132,12 +132,25 @@ let gs_kiri_print = exports; X: offset ? offset.x || 0 : 0, Y: offset ? offset.y || 0 : 0, Z: offset ? offset.z || 0 : 0 + }, + xoff = { + X: 0, + Y: 0, + Z: 0 }; lines.forEach(function(line) { line = line.split(";")[0].split(" "); - if (line.length < 2) return; - switch (line.shift()) { + let cmd = line.shift(); + if (cmd.charAt(0) === 'T') { + let ext = scope.settings.device.extruders; + let pos = parseInt(cmd.charAt(1)); + if (ext && ext[pos]) { + xoff.X = -ext[pos].extOffsetX; + xoff.Y = -ext[pos].extOffsetY; + } + } + switch (cmd) { case 'G90': // absolute positioning abs = true; @@ -165,7 +178,11 @@ let gs_kiri_print = exports; } addOutput( seq, - {x:pos.X + off.X, y:pos.Y + off.Y, z:pos.Z + off.Z}, + { + x:pos.X + off.X + xoff.X, + y:pos.Y + off.Y + xoff.Y, + z:pos.Z + off.Z + xoff.Z + }, !move, pos.F, tool @@ -389,7 +406,6 @@ let gs_kiri_print = exports; move.push(sp.projectOnSlope(ao2, 0.5)); } } else { - if (out.emit) DBUG.log("first point is emit"); z = point.z; } last = point; diff --git a/js/kiri.js b/js/kiri.js index c8917d4f..53a00d26 100644 --- a/js/kiri.js +++ b/js/kiri.js @@ -1088,10 +1088,10 @@ self.kiri.copyright = exports.COPYRIGHT; } // called after all new widgets are loaded to update group positions - function platformGroupDone() { + function platformGroupDone(skipLayout) { grouping = false; Widget.Groups.loadDone(); - if (layoutOnAdd) platform.layout(); + if (layoutOnAdd && !skipLayout) platform.layout(); } function platformAdd(widget, shift, nolayout) { @@ -1488,7 +1488,7 @@ self.kiri.copyright = exports.COPYRIGHT; if (isgcode) loadCode(e.target.result, 'gcode'); if (issvg) loadCode(e.target.result, 'svg'); if (isset) settingsImport(e.target.result, true); - if (--loaded === 0) platform.group_done(); + if (--loaded === 0) platform.group_done(isgcode); }; reader.readAsBinaryString(reader.file); } diff --git a/web/kiri/style.css b/web/kiri/style.css index 33bc344f..a749f129 100644 --- a/web/kiri/style.css +++ b/web/kiri/style.css @@ -743,7 +743,6 @@ button[import="1"] { display: flex; justify-content: center; align-items: center; - min-width: 25%; max-width: 50%; background-color: rgba(230,245,255,0.8); border: 3px solid rgba(200,215,255,0.6);