remove whole line for heated bed instead of making comment

This commit is contained in:
Casper Lamboo 2018-04-23 11:56:41 +02:00
parent 0957d53b41
commit 808d585f2a

View File

@ -133,8 +133,8 @@ export default class GCode {
addGCode(gcode, { temperature, bedTemperature, heatedBed }) {
gcode = gcode
.replace(/{temperature}/gi, temperature)
.replace(/{bedTemperature}/gi, bedTemperature)
.replace(/{if heatedBed}/gi, heatedBed ? '' : ';');
.replace(/{if heatedBed}.*?\n/g, str => heatedBed ? str.replace(/{if heatedBed}/g, '') : '')
.replace(/{bedTemperature}/gi, bedTemperature);
this._addGCode(gcode);
}