mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06: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
1 changed files with 15 additions and 2 deletions
|
@ -72,6 +72,15 @@ class FilamentChange(Script):
|
||||||
"type": "float",
|
"type": "float",
|
||||||
"default_value": 0,
|
"default_value": 0,
|
||||||
"enabled": "not firmware_config"
|
"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")
|
later_retract = self.getSettingValueByKey("later_retract")
|
||||||
x_pos = self.getSettingValueByKey("x_position")
|
x_pos = self.getSettingValueByKey("x_position")
|
||||||
y_pos = self.getSettingValueByKey("y_position")
|
y_pos = self.getSettingValueByKey("y_position")
|
||||||
|
z_pos = self.getSettingValueByKey("z_position")
|
||||||
firmware_config = self.getSettingValueByKey("firmware_config")
|
firmware_config = self.getSettingValueByKey("firmware_config")
|
||||||
|
|
||||||
color_change = "M600"
|
color_change = "M600"
|
||||||
|
@ -104,6 +114,9 @@ class FilamentChange(Script):
|
||||||
if y_pos is not None:
|
if y_pos is not None:
|
||||||
color_change = color_change + (" Y%.2f" % y_pos)
|
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"
|
color_change = color_change + " ; Generated by FilamentChange plugin\n"
|
||||||
|
|
||||||
layer_targets = layer_nums.split(",")
|
layer_targets = layer_nums.split(",")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue