mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-23 14:19:37 +08:00
Add Z Position parameter to FilamentChange (#9658)
* Add Z Position * PR Comment: Add minimum value for z_position Co-authored-by: Konstantinos Karmas <konskarm@gmail.com>
This commit is contained in:
parent
0e95a4612a
commit
21baf90ec8
@ -72,6 +72,15 @@ class FilamentChange(Script):
|
||||
"type": "float",
|
||||
"default_value": 0,
|
||||
"enabled": "not firmware_config"
|
||||
},
|
||||
"z_position":
|
||||
{
|
||||
"label": "Z Position (relative)",
|
||||
"description": "Extruder relative Z position. Move the print head up for filament change.",
|
||||
"unit": "mm",
|
||||
"type": "float",
|
||||
"default_value": 0,
|
||||
"minimum_value": 0
|
||||
}
|
||||
}
|
||||
}"""
|
||||
@ -87,6 +96,7 @@ class FilamentChange(Script):
|
||||
later_retract = self.getSettingValueByKey("later_retract")
|
||||
x_pos = self.getSettingValueByKey("x_position")
|
||||
y_pos = self.getSettingValueByKey("y_position")
|
||||
z_pos = self.getSettingValueByKey("z_position")
|
||||
firmware_config = self.getSettingValueByKey("firmware_config")
|
||||
|
||||
color_change = "M600"
|
||||
@ -104,6 +114,9 @@ class FilamentChange(Script):
|
||||
if y_pos is not None:
|
||||
color_change = color_change + (" Y%.2f" % y_pos)
|
||||
|
||||
if z_pos is not None and z_pos > 0.:
|
||||
color_change = color_change + (" Z%.2f" % z_pos)
|
||||
|
||||
color_change = color_change + " ; Generated by FilamentChange plugin\n"
|
||||
|
||||
layer_targets = layer_nums.split(",")
|
||||
|
Loading…
x
Reference in New Issue
Block a user