From b0765f7512a92d5ca1f1a5df579b764499ed8d41 Mon Sep 17 00:00:00 2001 From: lawgicau Date: Tue, 13 Jul 2021 15:36:45 +1000 Subject: [PATCH] Add custom end gcode #208 --- calibration.html | 61 ++++++++++++++++++++++++++++++++++++++++++- js/commongcode.js | 3 ++- js/gcodeprocessing.js | 20 ++++++++++++++ 3 files changed, 82 insertions(+), 2 deletions(-) diff --git a/calibration.html b/calibration.html index b3b3ccb..df61b07 100644 --- a/calibration.html +++ b/calibration.html @@ -235,7 +235,18 @@

- +

Additional end gcode

+

If you have additional end commands, tick the box and enter the gcode.

+ +
+

For the majority of users, you can skip this section. Any gcode entered here will be inserted at the very end of the file.

+ +
+

@@ -322,6 +333,18 @@

+

Additional end gcode

+

If you have additional end commands, tick the box and enter the gcode.

+ +
+

For the majority of users, you can skip this section. Any gcode entered here will be inserted at the very end of the file.

+ +
+

@@ -851,6 +874,18 @@ +

Additional end gcode

+

If you have additional end commands, tick the box and enter the gcode.

+ +
+

For the majority of users, you can skip this section. Any gcode entered here will be inserted at the very end of the file.

+ +
+

@@ -987,6 +1022,18 @@ +

Additional end gcode

+

If you have additional end commands, tick the box and enter the gcode.

+ +
+

For the majority of users, you can skip this section. Any gcode entered here will be inserted at the very end of the file.

+ +
+

@@ -1215,6 +1262,18 @@ +

Additional end gcode

+

If you have additional end commands, tick the box and enter the gcode.

+ +
+

For the majority of users, you can skip this section. Any gcode entered here will be inserted at the very end of the file.

+ +
+

diff --git a/js/commongcode.js b/js/commongcode.js index 866f68b..0178dfe 100644 --- a/js/commongcode.js +++ b/js/commongcode.js @@ -19,4 +19,5 @@ M106 S0 ; turn off cooling fan M104 S0 ; turn off extruder M140 S0 ; turn off bed M84 ; disable motors -M501 ; restore previous EEPROM values` \ No newline at end of file +M501 ; restore previous EEPROM values +;customend` \ No newline at end of file diff --git a/js/gcodeprocessing.js b/js/gcodeprocessing.js index 6e31597..7e60e40 100644 --- a/js/gcodeprocessing.js +++ b/js/gcodeprocessing.js @@ -117,6 +117,7 @@ function processFirstlayer(){ var zhop = document.firstlayerForm.zhop.value; var abl = document.firstlayerForm.abl.value; var customStart = document.firstlayerForm.startgcode.value; + var customEnd = document.firstlayerForm.endgcode.value; var firstlayerStart = commonStart; var skirts = ""; var squares = ""; @@ -228,6 +229,9 @@ function processFirstlayer(){ if(document.firstlayerForm.start.checked == true) { firstlayer = firstlayer.replace(/;customstart/, "; custom start gcode\n"+customStart); } + if(document.firstlayerForm.end.checked == true) { + firstlayer = firstlayer.replace(/;customend/, "; custom end gcode\n"+customEnd); + } downloadFile('firstlayer.gcode', firstlayer); } @@ -247,6 +251,7 @@ function processBaseline(){ var fanPercentage = document.baselineForm.fanSpeed.value; var fanSpeed = Math.round(fanPercentage*2.55); var customStart = document.baselineForm.startgcode.value; + var customEnd = document.baselineForm.endgcode.value; var baseline = commonStart; switch(nozzleLayer){ case '40_20': @@ -359,6 +364,9 @@ function processBaseline(){ if(document.baselineForm.start.checked == true) { baseline = baseline.replace(/;customstart/, "; custom start gcode\n"+customStart); } + if(document.baselineForm.end.checked == true) { + baseline = baseline.replace(/;customend/, "; custom end gcode\n"+customEnd); + } downloadFile('baseline.gcode', baseline); } @@ -404,6 +412,7 @@ function processRetraction(){ var f4 = document.retractionForm.ret_f4.value*60; var f5 = document.retractionForm.ret_f5.value; var customStart = document.retractionForm.startgcode.value; + var customEnd = document.retractionForm.endgcode.value; var retraction = commonStart; switch(nozzleLayer){ case "40_20": @@ -554,6 +563,9 @@ function processRetraction(){ if(document.retractionForm.start.checked == true) { retraction = retraction.replace(/;customstart/, "; custom start gcode\n"+customStart); } + if(document.retractionForm.end.checked == true) { + retraction = retraction.replace(/;customend/, "; custom end gcode\n"+customEnd); + } downloadFile('retraction.gcode', retraction); } @@ -578,6 +590,7 @@ function processTemperature(){ var d1 = document.temperatureForm.temp_d1.value; var e1 = document.temperatureForm.temp_e1.value; var customStart = document.temperatureForm.startgcode.value; + var customEnd = document.temperatureForm.endgcode.value; var temperature = commonStart; switch(nozzleLayer){ case '40_20': @@ -698,6 +711,9 @@ function processTemperature(){ if(document.temperatureForm.start.checked == true) { temperature = temperature.replace(/;customstart/, "; custom start gcode\n"+customStart); } + if(document.temperatureForm.end.checked == true) { + temperature = temperature.replace(/;customend/, "; custom end gcode\n"+customEnd); + } downloadFile('temperature.gcode', temperature); } @@ -743,6 +759,7 @@ function processAcceleration(){ var f3 = document.accelerationForm.accel_f3.value; var f4 = document.accelerationForm.accel_f4.value; var customStart = document.accelerationForm.startgcode.value; + var customEnd = document.accelerationForm.endgcode.value; var acceleration = commonStart; switch(nozzleLayer){ case '40_20': @@ -882,6 +899,9 @@ function processAcceleration(){ if(document.accelerationForm.start.checked == true) { acceleration = acceleration.replace(/;customstart/, "; custom start gcode\n"+customStart); } + if(document.accelerationForm.end.checked == true) { + acceleration = acceleration.replace(/;customend/, "; custom end gcode\n"+customEnd); + } downloadFile('acceleration.gcode', acceleration); }