0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-11-22 09:17:56 +01:00

{if heatedBed} variable

This commit is contained in:
peteruithoven 2013-12-18 17:43:57 +01:00
parent f077fdd484
commit f2f4727482
2 changed files with 8 additions and 3 deletions

View File

@ -200,6 +200,7 @@ function subsituteVariables(gcode) {
var preheatTemperature = settings["printer.heatup.temperature"]; var preheatTemperature = settings["printer.heatup.temperature"];
var preheatBedTemperature = settings["printer.heatup.bed.temperature"]; var preheatBedTemperature = settings["printer.heatup.bed.temperature"];
var printerType = settings["printer.type"]; var printerType = settings["printer.type"];
var heatedbed = settings["printer.heatedbed"];
switch (printerType) { switch (printerType) {
case "makerbot_replicator2": printerType = "r2"; break; case "makerbot_replicator2": printerType = "r2"; break;
@ -207,13 +208,15 @@ function subsituteVariables(gcode) {
case "makerbot_thingomatic": printerType = "t6"; break; case "makerbot_thingomatic": printerType = "t6"; break;
case "makerbot_generic": printerType = "r2"; break; case "makerbot_generic": printerType = "r2"; break;
} }
var heatedBedReplacement = (heatedbed)? "" : ";";
gcode = gcode.replace(/{printingTemp}/gi ,temperature); gcode = gcode.replace(/{printingTemp}/gi ,temperature);
gcode = gcode.replace(/{printingBedTemp}/gi ,bedTemperature); gcode = gcode.replace(/{printingBedTemp}/gi ,bedTemperature);
gcode = gcode.replace(/{preheatTemp}/gi ,preheatTemperature); gcode = gcode.replace(/{preheatTemp}/gi ,preheatTemperature);
gcode = gcode.replace(/{preheatBedTemp}/gi ,preheatBedTemperature); gcode = gcode.replace(/{preheatBedTemp}/gi ,preheatBedTemperature);
gcode = gcode.replace(/{printerType}/gi ,printerType); gcode = gcode.replace(/{printerType}/gi ,printerType);
gcode = gcode.replace(/{if heatedBed}/gi ,heatedBedReplacement);
return gcode; return gcode;
} }

View File

@ -52,14 +52,14 @@
<option value="marlin_generic">Generic Marlin Printer</option> <option value="marlin_generic">Generic Marlin Printer</option>
<option value="makerbot_generic">Generic Makerbot Printer</option> <option value="makerbot_generic">Generic Makerbot Printer</option>
</select> --><br/> </select> --><br/>
<label for="printerDimensionsX">Dimensions:</label> <label for="printerDimensionsX">Dimensions:</label>
x:<input id="printerDimensionsX" type="number" class="small" name="printer.dimensions.x" placeholder="x">mm<br> x:<input id="printerDimensionsX" type="number" class="small" name="printer.dimensions.x" placeholder="x">mm<br>
<label for="printerDimensionsY"></label> <label for="printerDimensionsY"></label>
y:<input id="printerDimensionsY" type="number" class="small" name="printer.dimensions.y" placeholder="y">mm<br> y:<input id="printerDimensionsY" type="number" class="small" name="printer.dimensions.y" placeholder="y">mm<br>
<label for="printerDimensionsZ"></label> <label for="printerDimensionsZ"></label>
z:<input id="printerDimensionsZ" type="number" class="small" name="printer.dimensions.z" placeholder="z">mm<br> z:<input id="printerDimensionsZ" type="number" class="small" name="printer.dimensions.z" placeholder="z">mm<br>
<label for="heatedBed">Heated bed:</label><input id="heatedBed" type="checkbox" name="printer.heatedbed" value="heatedbed"><br>
<fieldset id="gcodePanel"> <fieldset id="gcodePanel">
<legend>GCODE settings</legend> <legend>GCODE settings</legend>
<div> <div>
@ -79,6 +79,8 @@
<dt>{preheatTemp}</dt><dd>Preheat temperature</dd> <dt>{preheatTemp}</dt><dd>Preheat temperature</dd>
<dt>{preheatBedTemp}</dt><dd>Preheat bed temperature</dd> <dt>{preheatBedTemp}</dt><dd>Preheat bed temperature</dd>
<dt>{printerType}</dt><dd>Printer type</dd> <dt>{printerType}</dt><dd>Printer type</dd>
<dt>{if heatedBed}</dt><dd>Enable line if printer has heated bed</dd>
</dl> </dl>
</small> </small>
</div> </div>