From 2715a209225b74fdbcb7993f04838ebc89994c86 Mon Sep 17 00:00:00 2001 From: Wayne Porter Date: Mon, 10 Sep 2018 12:25:01 -0700 Subject: [PATCH 01/10] Add insert gcode at layer change to PostProcessingPlugin --- .../InsertAtLayerChange.py | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 plugins/PostProcessingPlugin/InsertAtLayerChange.py diff --git a/plugins/PostProcessingPlugin/InsertAtLayerChange.py b/plugins/PostProcessingPlugin/InsertAtLayerChange.py new file mode 100644 index 0000000000..df045e1490 --- /dev/null +++ b/plugins/PostProcessingPlugin/InsertAtLayerChange.py @@ -0,0 +1,55 @@ +# Created by Wayne Porter + +from ..Script import Script + +class InsertAtLayerChange(Script): + def __init__(self): + super().__init__() + + def getSettingDataString(self): + return """{ + "name": "Insert at layer change", + "key": "InsertAtLayerChange", + "metadata": {}, + "version": 2, + "settings": + { + "insert_loc": + { + "label": "When to insert", + "description": "Whether to insert code before or after layer change.", + "type": "enum", + "options": {"before": "Before", "after": "After"}, + "default_value": "before" + }, + "gcode_to_add": + { + "label": "GCODE to insert.", + "description": "GCODE to add before or after layer change.", + "type": "str", + "default_value": "" + } + } + }""" + + def execute(self, data): + in_layer = False + gcode_to_add = self.getSettingValueByKey("gcode_to_add") + "\n" + for layer in data: + # Check that a layer is being printed + lines = layer.split("\n") + if ";LAYER:" in lines[0]: + in_layer = True + else: + in_layer = False + + if in_layer: + index = data.index(layer) + if self.getSettingValueByKey("insert_loc") == "before": + layer = gcode_to_add + layer + else: + layer = layer + gcode_to_add + + data[index] = layer + + return data From 74a6d31c7466bbb1bbe0ac015f4be0a6c58102a4 Mon Sep 17 00:00:00 2001 From: Wayne Porter Date: Mon, 10 Sep 2018 15:30:52 -0700 Subject: [PATCH 02/10] Add time lapse post processing plugin --- plugins/PostProcessingPlugin/TimeLapse.py | 86 +++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 plugins/PostProcessingPlugin/TimeLapse.py diff --git a/plugins/PostProcessingPlugin/TimeLapse.py b/plugins/PostProcessingPlugin/TimeLapse.py new file mode 100644 index 0000000000..0a7c893fef --- /dev/null +++ b/plugins/PostProcessingPlugin/TimeLapse.py @@ -0,0 +1,86 @@ +# Created by Wayne Porter + +from ..Script import Script + +class TimeLapse(Script): + def __init__(self): + super().__init__() + + def getSettingDataString(self): + return """{ + "name": "Time Lapse", + "key": "TimeLapse", + "metadata": {}, + "version": 2, + "settings": + { + "trigger_cmd": + { + "label": "Trigger camera command", + "description": "Gcode command used to trigger camera.", + "type": "str", + "default_value": "M240" + }, + "pause_length": + { + "label": "Pause length", + "description": "How long to wait (in ms) after camera was triggered.", + "type": "int", + "default_value": 700, + "minimum_value": 0, + "unit": "ms" + }, + "head_park_x": + { + "label": "Park Print Head X", + "description": "What X location does the head move to for photo.", + "unit": "mm", + "type": "float", + "default_value": 0 + }, + "head_park_y": + { + "label": "Park Print Head Y", + "description": "What Y location does the head move to for photo.", + "unit": "mm", + "type": "float", + "default_value": 190 + }, + "park_feed_rate": + { + "label": "Park Feed Rate", + "description": "How fast does the head move to the park coordinates.", + "unit": "mm/s", + "type": "float", + "default_value": 9000 + } + } + }""" + + def execute(self, data): + in_layer = False + feed_rate = self.getSettingValueByKey("park_feed_rate") + x_park = self.getSettingValueByKey("head_park_x") + y_park = self.getSettingValueByKey("head_park_y") + trigger_cmd = self.getSettingValueByKey("trigger_cmd") + pause_length = self.getSettingValueByKey("pause_length") + + gcode_to_append = self.putValue(G = 90) + ";Absolute positioning\n" + gcode_to_append += self.putValue(G = 1, F = feed_rate, X = x_park, Y = y_park) + ";Move into position\n" + gcode_to_append += trigger_cmd + ";Snap Photo\n" + gcode_to_append += self.putValue(G = 4, P = pause_length) + ";Wait for camera\n" + for layer in data: + # Check that a layer is being printed + lines = layer.split("\n") + if ";LAYER:" in lines[0]: + in_layer = True + else: + in_layer = False + + if in_layer: + index = data.index(layer) + layer += gcode_to_append + + data[index] = layer + + return data From 256aef30c9c7e1e52878ca388595efcdeb1e118c Mon Sep 17 00:00:00 2001 From: Wayne Porter Date: Tue, 11 Sep 2018 08:03:26 -0700 Subject: [PATCH 03/10] Move post processing scripts to correct location --- .../{ => scripts}/InsertAtLayerChange.py | 110 +++++------ .../{ => scripts}/TimeLapse.py | 172 +++++++++--------- 2 files changed, 141 insertions(+), 141 deletions(-) rename plugins/PostProcessingPlugin/{ => scripts}/InsertAtLayerChange.py (96%) rename plugins/PostProcessingPlugin/{ => scripts}/TimeLapse.py (97%) diff --git a/plugins/PostProcessingPlugin/InsertAtLayerChange.py b/plugins/PostProcessingPlugin/scripts/InsertAtLayerChange.py similarity index 96% rename from plugins/PostProcessingPlugin/InsertAtLayerChange.py rename to plugins/PostProcessingPlugin/scripts/InsertAtLayerChange.py index df045e1490..04c0a3badf 100644 --- a/plugins/PostProcessingPlugin/InsertAtLayerChange.py +++ b/plugins/PostProcessingPlugin/scripts/InsertAtLayerChange.py @@ -1,55 +1,55 @@ -# Created by Wayne Porter - -from ..Script import Script - -class InsertAtLayerChange(Script): - def __init__(self): - super().__init__() - - def getSettingDataString(self): - return """{ - "name": "Insert at layer change", - "key": "InsertAtLayerChange", - "metadata": {}, - "version": 2, - "settings": - { - "insert_loc": - { - "label": "When to insert", - "description": "Whether to insert code before or after layer change.", - "type": "enum", - "options": {"before": "Before", "after": "After"}, - "default_value": "before" - }, - "gcode_to_add": - { - "label": "GCODE to insert.", - "description": "GCODE to add before or after layer change.", - "type": "str", - "default_value": "" - } - } - }""" - - def execute(self, data): - in_layer = False - gcode_to_add = self.getSettingValueByKey("gcode_to_add") + "\n" - for layer in data: - # Check that a layer is being printed - lines = layer.split("\n") - if ";LAYER:" in lines[0]: - in_layer = True - else: - in_layer = False - - if in_layer: - index = data.index(layer) - if self.getSettingValueByKey("insert_loc") == "before": - layer = gcode_to_add + layer - else: - layer = layer + gcode_to_add - - data[index] = layer - - return data +# Created by Wayne Porter + +from ..Script import Script + +class InsertAtLayerChange(Script): + def __init__(self): + super().__init__() + + def getSettingDataString(self): + return """{ + "name": "Insert at layer change", + "key": "InsertAtLayerChange", + "metadata": {}, + "version": 2, + "settings": + { + "insert_loc": + { + "label": "When to insert", + "description": "Whether to insert code before or after layer change.", + "type": "enum", + "options": {"before": "Before", "after": "After"}, + "default_value": "before" + }, + "gcode_to_add": + { + "label": "GCODE to insert.", + "description": "GCODE to add before or after layer change.", + "type": "str", + "default_value": "" + } + } + }""" + + def execute(self, data): + in_layer = False + gcode_to_add = self.getSettingValueByKey("gcode_to_add") + "\n" + for layer in data: + # Check that a layer is being printed + lines = layer.split("\n") + if ";LAYER:" in lines[0]: + in_layer = True + else: + in_layer = False + + if in_layer: + index = data.index(layer) + if self.getSettingValueByKey("insert_loc") == "before": + layer = gcode_to_add + layer + else: + layer = layer + gcode_to_add + + data[index] = layer + + return data diff --git a/plugins/PostProcessingPlugin/TimeLapse.py b/plugins/PostProcessingPlugin/scripts/TimeLapse.py similarity index 97% rename from plugins/PostProcessingPlugin/TimeLapse.py rename to plugins/PostProcessingPlugin/scripts/TimeLapse.py index 0a7c893fef..731983088a 100644 --- a/plugins/PostProcessingPlugin/TimeLapse.py +++ b/plugins/PostProcessingPlugin/scripts/TimeLapse.py @@ -1,86 +1,86 @@ -# Created by Wayne Porter - -from ..Script import Script - -class TimeLapse(Script): - def __init__(self): - super().__init__() - - def getSettingDataString(self): - return """{ - "name": "Time Lapse", - "key": "TimeLapse", - "metadata": {}, - "version": 2, - "settings": - { - "trigger_cmd": - { - "label": "Trigger camera command", - "description": "Gcode command used to trigger camera.", - "type": "str", - "default_value": "M240" - }, - "pause_length": - { - "label": "Pause length", - "description": "How long to wait (in ms) after camera was triggered.", - "type": "int", - "default_value": 700, - "minimum_value": 0, - "unit": "ms" - }, - "head_park_x": - { - "label": "Park Print Head X", - "description": "What X location does the head move to for photo.", - "unit": "mm", - "type": "float", - "default_value": 0 - }, - "head_park_y": - { - "label": "Park Print Head Y", - "description": "What Y location does the head move to for photo.", - "unit": "mm", - "type": "float", - "default_value": 190 - }, - "park_feed_rate": - { - "label": "Park Feed Rate", - "description": "How fast does the head move to the park coordinates.", - "unit": "mm/s", - "type": "float", - "default_value": 9000 - } - } - }""" - - def execute(self, data): - in_layer = False - feed_rate = self.getSettingValueByKey("park_feed_rate") - x_park = self.getSettingValueByKey("head_park_x") - y_park = self.getSettingValueByKey("head_park_y") - trigger_cmd = self.getSettingValueByKey("trigger_cmd") - pause_length = self.getSettingValueByKey("pause_length") - - gcode_to_append = self.putValue(G = 90) + ";Absolute positioning\n" - gcode_to_append += self.putValue(G = 1, F = feed_rate, X = x_park, Y = y_park) + ";Move into position\n" - gcode_to_append += trigger_cmd + ";Snap Photo\n" - gcode_to_append += self.putValue(G = 4, P = pause_length) + ";Wait for camera\n" - for layer in data: - # Check that a layer is being printed - lines = layer.split("\n") - if ";LAYER:" in lines[0]: - in_layer = True - else: - in_layer = False - - if in_layer: - index = data.index(layer) - layer += gcode_to_append - - data[index] = layer - - return data +# Created by Wayne Porter + +from ..Script import Script + +class TimeLapse(Script): + def __init__(self): + super().__init__() + + def getSettingDataString(self): + return """{ + "name": "Time Lapse", + "key": "TimeLapse", + "metadata": {}, + "version": 2, + "settings": + { + "trigger_cmd": + { + "label": "Trigger camera command", + "description": "Gcode command used to trigger camera.", + "type": "str", + "default_value": "M240" + }, + "pause_length": + { + "label": "Pause length", + "description": "How long to wait (in ms) after camera was triggered.", + "type": "int", + "default_value": 700, + "minimum_value": 0, + "unit": "ms" + }, + "head_park_x": + { + "label": "Park Print Head X", + "description": "What X location does the head move to for photo.", + "unit": "mm", + "type": "float", + "default_value": 0 + }, + "head_park_y": + { + "label": "Park Print Head Y", + "description": "What Y location does the head move to for photo.", + "unit": "mm", + "type": "float", + "default_value": 190 + }, + "park_feed_rate": + { + "label": "Park Feed Rate", + "description": "How fast does the head move to the park coordinates.", + "unit": "mm/s", + "type": "float", + "default_value": 9000 + } + } + }""" + + def execute(self, data): + in_layer = False + feed_rate = self.getSettingValueByKey("park_feed_rate") + x_park = self.getSettingValueByKey("head_park_x") + y_park = self.getSettingValueByKey("head_park_y") + trigger_cmd = self.getSettingValueByKey("trigger_cmd") + pause_length = self.getSettingValueByKey("pause_length") + + gcode_to_append = self.putValue(G = 90) + ";Absolute positioning\n" + gcode_to_append += self.putValue(G = 1, F = feed_rate, X = x_park, Y = y_park) + ";Move into position\n" + gcode_to_append += trigger_cmd + ";Snap Photo\n" + gcode_to_append += self.putValue(G = 4, P = pause_length) + ";Wait for camera\n" + for layer in data: + # Check that a layer is being printed + lines = layer.split("\n") + if ";LAYER:" in lines[0]: + in_layer = True + else: + in_layer = False + + if in_layer: + index = data.index(layer) + layer += gcode_to_append + + data[index] = layer + + return data From eb3670dd935818daf46a23aa5a7906139b4d5776 Mon Sep 17 00:00:00 2001 From: Wayne Porter Date: Tue, 11 Sep 2018 08:28:55 -0700 Subject: [PATCH 04/10] Make timelapse head parking optional --- .../PostProcessingPlugin/scripts/TimeLapse.py | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/plugins/PostProcessingPlugin/scripts/TimeLapse.py b/plugins/PostProcessingPlugin/scripts/TimeLapse.py index 731983088a..ee58b89fe2 100644 --- a/plugins/PostProcessingPlugin/scripts/TimeLapse.py +++ b/plugins/PostProcessingPlugin/scripts/TimeLapse.py @@ -30,13 +30,21 @@ class TimeLapse(Script): "minimum_value": 0, "unit": "ms" }, + "park_print_head": + { + "label": "Park Print Head", + "description": "Park the print head out of the way", + "type": "bool", + "default_value": true + }, "head_park_x": { "label": "Park Print Head X", "description": "What X location does the head move to for photo.", "unit": "mm", "type": "float", - "default_value": 0 + "default_value": 0, + "enabled": "park_print_head" }, "head_park_y": { @@ -44,7 +52,8 @@ class TimeLapse(Script): "description": "What Y location does the head move to for photo.", "unit": "mm", "type": "float", - "default_value": 190 + "default_value": 190, + "enabled": "park_print_head" }, "park_feed_rate": { @@ -52,7 +61,8 @@ class TimeLapse(Script): "description": "How fast does the head move to the park coordinates.", "unit": "mm/s", "type": "float", - "default_value": 9000 + "default_value": 9000, + "enabled": "park_print_head" } } }""" @@ -60,13 +70,15 @@ class TimeLapse(Script): def execute(self, data): in_layer = False feed_rate = self.getSettingValueByKey("park_feed_rate") + park_print_head = self.getSettingValueByKey("park_print_head") x_park = self.getSettingValueByKey("head_park_x") y_park = self.getSettingValueByKey("head_park_y") trigger_cmd = self.getSettingValueByKey("trigger_cmd") pause_length = self.getSettingValueByKey("pause_length") - gcode_to_append = self.putValue(G = 90) + ";Absolute positioning\n" - gcode_to_append += self.putValue(G = 1, F = feed_rate, X = x_park, Y = y_park) + ";Move into position\n" + if park_print_head: + gcode_to_append = self.putValue(G = 90) + ";Absolute positioning\n" + gcode_to_append += self.putValue(G = 1, F = feed_rate, X = x_park, Y = y_park) + ";Park print head\n" gcode_to_append += trigger_cmd + ";Snap Photo\n" gcode_to_append += self.putValue(G = 4, P = pause_length) + ";Wait for camera\n" for layer in data: From 2e77293204a2ed286beb2447f0b467587cbeedeb Mon Sep 17 00:00:00 2001 From: Wayne Porter Date: Tue, 11 Sep 2018 13:19:40 -0700 Subject: [PATCH 05/10] Add wait for moves to finish to timelapse script --- plugins/PostProcessingPlugin/scripts/TimeLapse.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/PostProcessingPlugin/scripts/TimeLapse.py b/plugins/PostProcessingPlugin/scripts/TimeLapse.py index ee58b89fe2..7420e0895f 100644 --- a/plugins/PostProcessingPlugin/scripts/TimeLapse.py +++ b/plugins/PostProcessingPlugin/scripts/TimeLapse.py @@ -76,6 +76,7 @@ class TimeLapse(Script): trigger_cmd = self.getSettingValueByKey("trigger_cmd") pause_length = self.getSettingValueByKey("pause_length") + gcode_to_append = self.putValue(M = 400) + ";Wait for moves to finish\n" if park_print_head: gcode_to_append = self.putValue(G = 90) + ";Absolute positioning\n" gcode_to_append += self.putValue(G = 1, F = feed_rate, X = x_park, Y = y_park) + ";Park print head\n" From 2502d474139c6907eb3c90cc62ad63c60f339840 Mon Sep 17 00:00:00 2001 From: Wayne Porter Date: Wed, 26 Sep 2018 11:24:26 -0700 Subject: [PATCH 06/10] Fix tab/space mixing Signed-off-by: Wayne Porter --- plugins/PostProcessingPlugin/scripts/TimeLapse.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/PostProcessingPlugin/scripts/TimeLapse.py b/plugins/PostProcessingPlugin/scripts/TimeLapse.py index 7420e0895f..0402d3eaf8 100644 --- a/plugins/PostProcessingPlugin/scripts/TimeLapse.py +++ b/plugins/PostProcessingPlugin/scripts/TimeLapse.py @@ -32,10 +32,10 @@ class TimeLapse(Script): }, "park_print_head": { - "label": "Park Print Head", - "description": "Park the print head out of the way", - "type": "bool", - "default_value": true + "label": "Park Print Head", + "description": "Park the print head out of the way", + "type": "bool", + "default_value": true }, "head_park_x": { @@ -78,8 +78,8 @@ class TimeLapse(Script): gcode_to_append = self.putValue(M = 400) + ";Wait for moves to finish\n" if park_print_head: - gcode_to_append = self.putValue(G = 90) + ";Absolute positioning\n" - gcode_to_append += self.putValue(G = 1, F = feed_rate, X = x_park, Y = y_park) + ";Park print head\n" + gcode_to_append = self.putValue(G = 90) + ";Absolute positioning\n" + gcode_to_append += self.putValue(G = 1, F = feed_rate, X = x_park, Y = y_park) + ";Park print head\n" gcode_to_append += trigger_cmd + ";Snap Photo\n" gcode_to_append += self.putValue(G = 4, P = pause_length) + ";Wait for camera\n" for layer in data: From 26bbf3ef0ebf9d53192ec39de5d9e1faab95c3a3 Mon Sep 17 00:00:00 2001 From: Wayne Porter Date: Wed, 26 Sep 2018 13:33:28 -0700 Subject: [PATCH 07/10] Fix bug when parking nozzle Signed-off-by: Wayne Porter --- plugins/PostProcessingPlugin/scripts/TimeLapse.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/PostProcessingPlugin/scripts/TimeLapse.py b/plugins/PostProcessingPlugin/scripts/TimeLapse.py index 0402d3eaf8..ccfca9c2a8 100644 --- a/plugins/PostProcessingPlugin/scripts/TimeLapse.py +++ b/plugins/PostProcessingPlugin/scripts/TimeLapse.py @@ -75,11 +75,12 @@ class TimeLapse(Script): y_park = self.getSettingValueByKey("head_park_y") trigger_cmd = self.getSettingValueByKey("trigger_cmd") pause_length = self.getSettingValueByKey("pause_length") + gcode_to_append = "" - gcode_to_append = self.putValue(M = 400) + ";Wait for moves to finish\n" if park_print_head: - gcode_to_append = self.putValue(G = 90) + ";Absolute positioning\n" + gcode_to_append += self.putValue(G = 90) + ";Absolute positioning\n" gcode_to_append += self.putValue(G = 1, F = feed_rate, X = x_park, Y = y_park) + ";Park print head\n" + gcode_to_append += self.putValue(M = 400) + ";Wait for moves to finish\n" gcode_to_append += trigger_cmd + ";Snap Photo\n" gcode_to_append += self.putValue(G = 4, P = pause_length) + ";Wait for camera\n" for layer in data: From 03c0faaeca78280b29ba44af2ad17f1735f8aa56 Mon Sep 17 00:00:00 2001 From: Wayne Porter Date: Wed, 26 Sep 2018 13:39:55 -0700 Subject: [PATCH 08/10] Add beginning and end gcode comments Signed-off-by: Wayne Porter --- plugins/PostProcessingPlugin/scripts/TimeLapse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/PostProcessingPlugin/scripts/TimeLapse.py b/plugins/PostProcessingPlugin/scripts/TimeLapse.py index ccfca9c2a8..4160e3e2fc 100644 --- a/plugins/PostProcessingPlugin/scripts/TimeLapse.py +++ b/plugins/PostProcessingPlugin/scripts/TimeLapse.py @@ -75,7 +75,7 @@ class TimeLapse(Script): y_park = self.getSettingValueByKey("head_park_y") trigger_cmd = self.getSettingValueByKey("trigger_cmd") pause_length = self.getSettingValueByKey("pause_length") - gcode_to_append = "" + gcode_to_append = ";TimeLapse Begin" if park_print_head: gcode_to_append += self.putValue(G = 90) + ";Absolute positioning\n" @@ -83,6 +83,7 @@ class TimeLapse(Script): gcode_to_append += self.putValue(M = 400) + ";Wait for moves to finish\n" gcode_to_append += trigger_cmd + ";Snap Photo\n" gcode_to_append += self.putValue(G = 4, P = pause_length) + ";Wait for camera\n" + gcode_to_append += ";TimeLapse End" for layer in data: # Check that a layer is being printed lines = layer.split("\n") From f3ad17af85d8f989487cc65cc5961b7e04ab3710 Mon Sep 17 00:00:00 2001 From: Wayne Porter Date: Wed, 26 Sep 2018 13:54:09 -0700 Subject: [PATCH 09/10] Remove G90 and assume absolute positioning Signed-off-by: Wayne Porter --- plugins/PostProcessingPlugin/scripts/TimeLapse.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/PostProcessingPlugin/scripts/TimeLapse.py b/plugins/PostProcessingPlugin/scripts/TimeLapse.py index 4160e3e2fc..00f22786ec 100644 --- a/plugins/PostProcessingPlugin/scripts/TimeLapse.py +++ b/plugins/PostProcessingPlugin/scripts/TimeLapse.py @@ -33,7 +33,7 @@ class TimeLapse(Script): "park_print_head": { "label": "Park Print Head", - "description": "Park the print head out of the way", + "description": "Park the print head out of the way. Assumes absolute positioning.", "type": "bool", "default_value": true }, @@ -78,7 +78,6 @@ class TimeLapse(Script): gcode_to_append = ";TimeLapse Begin" if park_print_head: - gcode_to_append += self.putValue(G = 90) + ";Absolute positioning\n" gcode_to_append += self.putValue(G = 1, F = feed_rate, X = x_park, Y = y_park) + ";Park print head\n" gcode_to_append += self.putValue(M = 400) + ";Wait for moves to finish\n" gcode_to_append += trigger_cmd + ";Snap Photo\n" From 821a4dea67a4f60a398dd275912a07c9690821c6 Mon Sep 17 00:00:00 2001 From: Wayne Porter Date: Wed, 26 Sep 2018 14:00:36 -0700 Subject: [PATCH 10/10] Fix begin and end comments Signed-off-by: Wayne Porter --- plugins/PostProcessingPlugin/scripts/TimeLapse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/PostProcessingPlugin/scripts/TimeLapse.py b/plugins/PostProcessingPlugin/scripts/TimeLapse.py index 00f22786ec..a4b0996075 100644 --- a/plugins/PostProcessingPlugin/scripts/TimeLapse.py +++ b/plugins/PostProcessingPlugin/scripts/TimeLapse.py @@ -75,14 +75,14 @@ class TimeLapse(Script): y_park = self.getSettingValueByKey("head_park_y") trigger_cmd = self.getSettingValueByKey("trigger_cmd") pause_length = self.getSettingValueByKey("pause_length") - gcode_to_append = ";TimeLapse Begin" + gcode_to_append = ";TimeLapse Begin\n" if park_print_head: gcode_to_append += self.putValue(G = 1, F = feed_rate, X = x_park, Y = y_park) + ";Park print head\n" gcode_to_append += self.putValue(M = 400) + ";Wait for moves to finish\n" gcode_to_append += trigger_cmd + ";Snap Photo\n" gcode_to_append += self.putValue(G = 4, P = pause_length) + ";Wait for camera\n" - gcode_to_append += ";TimeLapse End" + gcode_to_append += ";TimeLapse End\n" for layer in data: # Check that a layer is being printed lines = layer.split("\n")