mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Make suggested changes to post processing scripts
Contributes to CURA-5713.
This commit is contained in:
parent
b913dd9702
commit
9396628170
2 changed files with 5 additions and 17 deletions
|
@ -14,7 +14,7 @@ class TimeLapse(Script):
|
|||
"version": 2,
|
||||
"settings":
|
||||
{
|
||||
"trigger_cmd":
|
||||
"trigger_command":
|
||||
{
|
||||
"label": "Trigger camera command",
|
||||
"description": "Gcode command used to trigger camera.",
|
||||
|
@ -68,30 +68,24 @@ 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")
|
||||
trigger_command = self.getSettingValueByKey("trigger_command")
|
||||
pause_length = self.getSettingValueByKey("pause_length")
|
||||
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 += trigger_command + ";Snap Photo\n"
|
||||
gcode_to_append += self.putValue(G = 4, P = pause_length) + ";Wait for camera\n"
|
||||
gcode_to_append += ";TimeLapse End\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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue