Fix situation where _calculateMoveFromWallRadius could cause exception

This commit is contained in:
Jaime van Kessel 2019-06-07 17:21:28 +02:00
parent 4018c24b4c
commit f842769c1d
2 changed files with 6 additions and 3 deletions

View file

@ -1118,7 +1118,9 @@ class BuildVolume(SceneNode):
def _calculateMoveFromWallRadius(self, used_extruders):
move_from_wall_radius = 0 # Moves that start from outer wall.
move_from_wall_radius = max(move_from_wall_radius, max(self._getSettingFromAllExtruders("infill_wipe_dist")))
all_values = [move_from_wall_radius]
all_values.extend(self._getSettingFromAllExtruders("infill_wipe_dist"))
move_from_wall_radius = max(all_values)
avoid_enabled_per_extruder = [stack.getProperty("travel_avoid_other_parts", "value") for stack in used_extruders]
travel_avoid_distance_per_extruder = [stack.getProperty("travel_avoid_distance", "value") for stack in used_extruders]
for avoid_other_parts_enabled, avoid_distance in zip(avoid_enabled_per_extruder, travel_avoid_distance_per_extruder): # For each extruder (or just global).

View file

@ -255,9 +255,10 @@ class TestGetEdgeDisallowedSize:
def test_unknownAdhesion(self, build_volume: BuildVolume):
build_volume._global_container_stack = self.createMockedStack()
with patch("cura.Settings.ExtruderManager.ExtruderManager.getInstance"):
with pytest.raises(Exception):
#with pytest.raises(Exception):
# Since we don't have any adhesion set, this should break.
build_volume.getEdgeDisallowedSize()
build_volume.getEdgeDisallowedSize()
def test_oneAtATime(self, build_volume: BuildVolume):
build_volume._global_container_stack = self.createMockedStack()