CURA-4400 fix for change in fdmprinter: move -1 from default_value to value

This commit is contained in:
Jack Ha 2018-03-12 13:30:31 +01:00
parent aa3cd8ba9d
commit e0e2d3362b

View file

@ -278,12 +278,12 @@ class StartSliceJob(Job):
# \return A dictionary of replacement tokens to the values they should be
# replaced with.
def _buildReplacementTokens(self, stack) -> dict:
default_extruder_position = Application.getInstance().getMachineManager().defaultExtruderPosition
default_extruder_position = int(Application.getInstance().getMachineManager().defaultExtruderPosition)
result = {}
for key in stack.getAllKeys():
setting_type = stack.getProperty(key, "type")
value = stack.getProperty(key, "value")
if setting_type == "extruder" and value == "-1":
if setting_type == "extruder" and value == -1:
# replace with the default value
value = default_extruder_position
result[key] = value