Home all on delta end option

#239
This commit is contained in:
lawgicau
2021-07-20 15:07:00 +10:00
parent b9528c7de4
commit 80dbd2095a
2 changed files with 5 additions and 0 deletions

View File

@ -317,6 +317,7 @@ var accel = `<h4>Base feedrate/speed</h4>
var endGcode = `<h4>Additional end gcode</h4>
<p>If you have additional end commands, tick the box and enter the gcode.</p>
<label>Additional end gcode:<input name="end" type="checkbox" onchange="displayCustom();" value="extraEnd"></label>
<label>Home all axes with G28 at the end (delta)<input name="deltaHome" type="checkbox" value="off"></label>
<div class="endExp">
<p>For the majority of users, you can skip this section. Any gcode entered here will be inserted at the very end of the file.</p>
<textarea name="endgcode"></textarea>

View File

@ -525,6 +525,10 @@ function processGcode(formName) {
if(formName.end.checked == true) {
gcode = gcode.replace(/;customend/, "; custom end gcode\n"+customEnd);
}
if(formName.deltaHome.checked == true) {
gcode = gcode.replace(/G28 X0 ; home X axis/, "G28 ; home all on delta");
}
// process finished gcode file
downloadFile(description+'.gcode', gcode);
}