Add tick box for M80 PSU command at the start of gcode

This commit is contained in:
lawgicau
2020-08-24 15:57:55 +10:00
parent 3cb3cf2c7a
commit 292560d93b
7 changed files with 29 additions and 5 deletions

View File

@ -173,6 +173,7 @@
<h4>Additional start gcode</h4>
<p>If you have additional start commands, tick the box and enter the gcode. This will be inserted after temperatures are set and homing/ABL is complete. This can be used to add a hot end purge command. For the majority of users, you can skip this section.</p>
<label>Additional start gcode:<input name="start" type="checkbox" onchange="toggle(!this.checked, '#firstlayerStart')" value="extraStart"></label>
<label>Add M80 to turn PSU on:<input name="psuon" type="checkbox" value="on"></label>
<textarea id="firstlayerStart" name="startgcode"></textarea>
<script>
if(document.firstlayerForm.start.checked == false){
@ -240,6 +241,7 @@
<h4>Additional start gcode</h4>
<p>If you have additional start commands, tick the box and enter the gcode. This will be inserted after temperatures are set and homing/ABL is complete. This can be used to add a hot end purge command. For the majority of users, you can skip this section.</p>
<label>Additional start gcode:<input name="start" type="checkbox" onchange="toggle(!this.checked, '#baselineStart')" value="extraStart"></label>
<label>Add M80 to turn PSU on:<input name="psuon" type="checkbox" value="on"></label>
<textarea id="baselineStart" name="startgcode"></textarea>
<script>
if(document.baselineForm.start.checked == false){
@ -654,6 +656,7 @@
<h4>Additional start gcode</h4>
<p>If you have additional start commands, tick the box and enter the gcode. This will be inserted after temperatures are set and homing/ABL is complete. This can be used to add a hot end purge command. For the majority of users, you can skip this section.</p>
<label>Additional start gcode:<input name="start" type="checkbox" onchange="toggle(!this.checked, '#retractionStart')" value="extraStart"></label>
<label>Add M80 to turn PSU on:<input name="psuon" type="checkbox" value="on"></label>
<textarea id="retractionStart" name="startgcode"></textarea>
<script>
if(document.retractionForm.start.checked == false){
@ -794,6 +797,7 @@
<h4>Additional start gcode</h4>
<p>If you have additional start commands, tick the box and enter the gcode. This will be inserted after temperatures are set and homing/ABL is complete. This can be used to add a hot end purge command. For the majority of users, you can skip this section.</p>
<label>Additional start gcode:<input name="start" type="checkbox" onchange="toggle(!this.checked, '#temperatureStart')" value="extraStart"></label>
<label>Add M80 to turn PSU on:<input name="psuon" type="checkbox" value="on"></label>
<textarea id="temperatureStart" name="startgcode"></textarea>
<script>
if(document.temperatureForm.start.checked == false){
@ -974,6 +978,7 @@
<h4>Additional start gcode</h4>
<p>If you have additional start commands, tick the box and enter the gcode. This will be inserted after temperatures are set and homing/ABL is complete. This can be used to add a hot end purge command. For the majority of users, you can skip this section.</p>
<label>Additional start gcode:<input name="start" type="checkbox" onchange="toggle(!this.checked, '#accelerationStart')" value="extraStart"></label>
<label>Add M80 to turn PSU on:<input name="psuon" type="checkbox" value="on"></label>
<textarea id="accelerationStart" name="startgcode"></textarea>
<script>
if(document.accelerationForm.start.checked == false){

View File

@ -1,4 +1,5 @@
var originalAcceleration = `; G-Code originally generated by Simplify3D(R) Version 4.1.2
;M80 ; power supply on
G90
M82
M106 S0

View File

@ -1,4 +1,5 @@
var originalBaseline = `; G-Code originally generated by Simplify3D(R) Version 4.1.2
;M80 ; power supply on
G90
M82
M106 S0

View File

@ -1,4 +1,5 @@
var originalFirstlayerStart = `; G-Code originally generated by Simplify3D(R) Version 4.1.2, based on proposeed code by vector76
;M80 ; power supply on
G90
M82
M106 S0

View File

@ -211,6 +211,9 @@ function processFirstlayer(){
var firstlayer = firstlayerStart+skirts+squares+firstlayerEnd;
firstlayer = firstlayer.replace(/G1 E-5.0000 F2400/g, "G1 E-"+retDist+" F"+retSpeed+" ; custom retraction");
firstlayer = firstlayer.replace(/G1 E0.0000 F2400/g, "G1 E0.0000 F"+retSpeed+" ; custom un-retraction/prime");
if(document.firstlayerForm.psuon.checked == true) {
firstlayer = firstlayer.replace(/;M80/, "M80");
}
if(document.firstlayerForm.start.checked == true) {
firstlayer = firstlayer.replace(/;customstart/, "; custom start gcode\n"+customStart);
}
@ -328,6 +331,9 @@ function processBaseline(){
baseline = baselineArray.join("\n");
}
}
if(document.baselineForm.psuon.checked == true) {
baseline = baseline.replace(/;M80/, "M80");
}
if(document.baselineForm.start.checked == true) {
baseline = baseline.replace(/;customstart/, "; custom start gcode\n"+customStart);
}
@ -504,12 +510,14 @@ function processRetraction(){
// F section
retraction = retraction.replace(/;retractionF/g, "G1 E-"+f1+" F"+f2+" ; custom retraction - F");
retraction = retraction.replace(/;unretractionF/g, "G1 E"+f3+" F"+f4+" ; custom un-retraction/prime - F");
if(document.retractionForm.start.checked == true) {
retraction = retraction.replace(/;customstart/, "; custom start gcode\n"+customStart);
if(f5 > 0){
retraction = retraction.replace(/;zhopupF/g, "G91\nG1 Z"+f5+" F1200 ; custom z hop - F\nG90");
}
if(document.retractionForm.psuon.checked == true) {
retraction = retraction.replace(/;M80/, "M80");
}
if(document.retractionForm.start.checked == true) {
retraction = retraction.replace(/;customstart/, "; custom start gcode\n"+customStart);
}
downloadFile('retraction.gcode', retraction);
}
@ -637,6 +645,9 @@ function processTemperature(){
temperature = temperature.replace(/temp3/, "M104 S"+c1+" T0 ; custom hot end temp - C");
temperature = temperature.replace(/temp4/, "M104 S"+d1+" T0 ; custom hot end temp - D");
temperature = temperature.replace(/temp5/, "M104 S"+e1+" T0 ; custom hot end temp - E");
if(document.temperatureForm.psuon.checked == true) {
temperature = temperature.replace(/;M80/, "M80");
}
if(document.temperatureForm.start.checked == true) {
temperature = temperature.replace(/;customstart/, "; custom start gcode\n"+customStart);
}
@ -808,6 +819,9 @@ function processAcceleration(){
acceleration = acceleration.replace(/j5/g, "M205 J"+e4+" ; custom junction deviation - E");
acceleration = acceleration.replace(/j6/g, "M205 J"+f4+" ; custom junction deviation - F");
}
if(document.accelerationForm.psuon.checked == true) {
acceleration = acceleration.replace(/;M80/, "M80");
}
if(document.accelerationForm.start.checked == true) {
acceleration = acceleration.replace(/;customstart/, "; custom start gcode\n"+customStart);
}

View File

@ -1,4 +1,5 @@
var originalRetraction = `; G-Code originally generated by Simplify3D(R) Version 4.1.2
;M80 ; power supply on
G90
M82
M106 S0

View File

@ -1,4 +1,5 @@
var originalTemperature = `; G-Code originally generated by Simplify3D(R) Version 4.1.2
;M80 ; power supply on
G90
M82
M106 S0