mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-23 11:33:49 +01:00
update settings
This commit is contained in:
parent
b65541ff54
commit
8b9b1af612
@ -11,47 +11,48 @@ export default class {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
startCode () {
|
startCode () {
|
||||||
var gcode = this.config["startCode"];
|
const { startCode } = this.config;
|
||||||
|
const gcode = this._subsituteVariables(startCode);
|
||||||
gcode = this._subsituteVariables(gcode);
|
|
||||||
|
|
||||||
return gcode;
|
return gcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
endCode () {
|
endCode () {
|
||||||
var gcode = this.config["endCode"];
|
const { endCode } = this.config;
|
||||||
|
const gcode = this._subsituteVariables(endCode);
|
||||||
gcode = this._subsituteVariables(gcode);
|
|
||||||
|
|
||||||
return gcode;
|
return gcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
_subsituteVariables (gcode) {
|
_subsituteVariables (gcode) {
|
||||||
var temperature = this.config["temperature"];
|
let {
|
||||||
var bedTemperature = this.config["bedTemperature"];
|
temperature,
|
||||||
var preheatTemperature = this.config["heatupTemperature"];
|
bedTemperature,
|
||||||
var preheatBedTemperature = this.config["heatupBedTemperature"];
|
heatTemperature,
|
||||||
var travelSpeed = this.config["travelSpeed"] * 60;
|
heatBedTemperature,
|
||||||
var printerType = this.config["type"];
|
travelSpeed,
|
||||||
var heatedbed = this.config["heatedbed"];
|
printerType,
|
||||||
|
heatedbed
|
||||||
|
} = this.config;
|
||||||
|
|
||||||
|
travelSpeed *= 60;
|
||||||
|
|
||||||
switch (printerType) {
|
switch (printerType) {
|
||||||
case "makerbot_replicator2": printerType = "r2"; break;
|
case 'makerbot_replicator2': printerType = 'r2'; break;
|
||||||
case "makerbot_replicator2x": printerType = "r2x"; break;
|
case 'makerbot_replicator2x': printerType = 'r2x'; break;
|
||||||
case "makerbot_thingomatic": printerType = "t6"; break;
|
case 'makerbot_thingomatic': printerType = 't6'; break;
|
||||||
case "makerbot_generic": printerType = "r2"; break;
|
case 'makerbot_generic': printerType = 'r2'; break;
|
||||||
case "_3Dison_plus": printerType = "r2"; break;
|
case '_3Dison_plus': printerType = 'r2'; break;
|
||||||
}
|
}
|
||||||
var heatedBedReplacement = heatedbed ? "" : ";";
|
|
||||||
|
|
||||||
gcode = gcode.replace(/{printingTemp}/gi, temperature);
|
const heatedBedReplacement = heatedbed ? '' : ';';
|
||||||
gcode = gcode.replace(/{printingBedTemp}/gi, bedTemperature);
|
|
||||||
gcode = gcode.replace(/{preheatTemp}/gi, preheatTemperature);
|
gcode = gcode.replace(/{ printingTemp }/gi, temperature);
|
||||||
gcode = gcode.replace(/{preheatBedTemp}/gi, preheatBedTemperature);
|
gcode = gcode.replace(/{ printingBedTemp }/gi, bedTemperature);
|
||||||
gcode = gcode.replace(/{printerType}/gi, printerType);
|
gcode = gcode.replace(/{ preheatTemp }/gi, heatTemperature);
|
||||||
gcode = gcode.replace(/{travelSpeed}/gi, travelSpeed);
|
gcode = gcode.replace(/{ preheatBedTemp }/gi, heatBedTemperature);
|
||||||
gcode = gcode.replace(/{if heatedBed}/gi, heatedBedReplacement);
|
gcode = gcode.replace(/{ printerType }/gi, printerType);
|
||||||
|
gcode = gcode.replace(/{ travelSpeed }/gi, travelSpeed);
|
||||||
|
gcode = gcode.replace(/{ if heatedBed }/gi, heatedBedReplacement);
|
||||||
|
|
||||||
return gcode;
|
return gcode;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user