From f2f4727482196a515739223798e9eb7fdad8db9b Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Wed, 18 Dec 2013 17:43:57 +0100 Subject: [PATCH] {if heatedBed} variable --- js_src/gcodeGenerating.js | 5 ++++- www/settings.html | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/js_src/gcodeGenerating.js b/js_src/gcodeGenerating.js index 321c217..670952c 100644 --- a/js_src/gcodeGenerating.js +++ b/js_src/gcodeGenerating.js @@ -200,6 +200,7 @@ function subsituteVariables(gcode) { var preheatTemperature = settings["printer.heatup.temperature"]; var preheatBedTemperature = settings["printer.heatup.bed.temperature"]; var printerType = settings["printer.type"]; + var heatedbed = settings["printer.heatedbed"]; switch (printerType) { case "makerbot_replicator2": printerType = "r2"; break; @@ -207,13 +208,15 @@ function subsituteVariables(gcode) { case "makerbot_thingomatic": printerType = "t6"; break; case "makerbot_generic": printerType = "r2"; break; } + var heatedBedReplacement = (heatedbed)? "" : ";"; gcode = gcode.replace(/{printingTemp}/gi ,temperature); gcode = gcode.replace(/{printingBedTemp}/gi ,bedTemperature); gcode = gcode.replace(/{preheatTemp}/gi ,preheatTemperature); gcode = gcode.replace(/{preheatBedTemp}/gi ,preheatBedTemperature); gcode = gcode.replace(/{printerType}/gi ,printerType); - + gcode = gcode.replace(/{if heatedBed}/gi ,heatedBedReplacement); + return gcode; } diff --git a/www/settings.html b/www/settings.html index 79d2b5f..2e73284 100644 --- a/www/settings.html +++ b/www/settings.html @@ -52,14 +52,14 @@ -->
- + x:mm
y:mm
z:mm
- +
GCODE settings
@@ -79,6 +79,8 @@
{preheatTemp}
Preheat temperature
{preheatBedTemp}
Preheat bed temperature
{printerType}
Printer type
+
{if heatedBed}
Enable line if printer has heated bed
+