Make timelapse head parking optional

This commit is contained in:
Wayne Porter 2018-09-11 08:28:55 -07:00
parent 256aef30c9
commit eb3670dd93

View file

@ -30,13 +30,21 @@ class TimeLapse(Script):
"minimum_value": 0, "minimum_value": 0,
"unit": "ms" "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": "head_park_x":
{ {
"label": "Park Print Head X", "label": "Park Print Head X",
"description": "What X location does the head move to for photo.", "description": "What X location does the head move to for photo.",
"unit": "mm", "unit": "mm",
"type": "float", "type": "float",
"default_value": 0 "default_value": 0,
"enabled": "park_print_head"
}, },
"head_park_y": "head_park_y":
{ {
@ -44,7 +52,8 @@ class TimeLapse(Script):
"description": "What Y location does the head move to for photo.", "description": "What Y location does the head move to for photo.",
"unit": "mm", "unit": "mm",
"type": "float", "type": "float",
"default_value": 190 "default_value": 190,
"enabled": "park_print_head"
}, },
"park_feed_rate": "park_feed_rate":
{ {
@ -52,7 +61,8 @@ class TimeLapse(Script):
"description": "How fast does the head move to the park coordinates.", "description": "How fast does the head move to the park coordinates.",
"unit": "mm/s", "unit": "mm/s",
"type": "float", "type": "float",
"default_value": 9000 "default_value": 9000,
"enabled": "park_print_head"
} }
} }
}""" }"""
@ -60,13 +70,15 @@ class TimeLapse(Script):
def execute(self, data): def execute(self, data):
in_layer = False in_layer = False
feed_rate = self.getSettingValueByKey("park_feed_rate") feed_rate = self.getSettingValueByKey("park_feed_rate")
park_print_head = self.getSettingValueByKey("park_print_head")
x_park = self.getSettingValueByKey("head_park_x") x_park = self.getSettingValueByKey("head_park_x")
y_park = self.getSettingValueByKey("head_park_y") y_park = self.getSettingValueByKey("head_park_y")
trigger_cmd = self.getSettingValueByKey("trigger_cmd") trigger_cmd = self.getSettingValueByKey("trigger_cmd")
pause_length = self.getSettingValueByKey("pause_length") pause_length = self.getSettingValueByKey("pause_length")
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) + ";Move into position\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 += trigger_cmd + ";Snap Photo\n"
gcode_to_append += self.putValue(G = 4, P = pause_length) + ";Wait for camera\n" gcode_to_append += self.putValue(G = 4, P = pause_length) + ";Wait for camera\n"
for layer in data: for layer in data: