Fixed cases where getValue was still used.

We now use getProperty instead

CURA-1278
This commit is contained in:
Jaime van Kessel 2016-05-18 16:29:57 +02:00
parent afb7a45bb0
commit a5f8546d69
2 changed files with 22 additions and 22 deletions

View file

@ -161,12 +161,12 @@ class BuildVolume(SceneNode):
self._active_container_stack = Application.getInstance().getGlobalContainerStack() self._active_container_stack = Application.getInstance().getGlobalContainerStack()
if self._active_container_stack: if self._active_container_stack:
self._width = self._active_container_stack.getValue("machine_width") self._width = self._active_container_stack.getProperty("machine_width", "value")
if self._active_container_stack.getValue("print_sequence") == "one_at_a_time": if self._active_container_stack.getProperty("print_sequence", "value") == "one_at_a_time":
self._height = self._active_container_stack.getValue("gantry_height") self._height = self._active_container_stack.getProperty("gantry_height", "value")
else: else:
self._height = self._active_container_stack.getValue("machine_height") self._height = self._active_container_stack.getProperty("machine_height", "value")
self._depth = self._active_container_stack.getValue("machine_depth") self._depth = self._active_container_stack.getProperty("machine_depth", "value")
self._updateDisallowedAreas() self._updateDisallowedAreas()
@ -174,10 +174,10 @@ class BuildVolume(SceneNode):
def _onSettingValueChanged(self, setting_key): def _onSettingValueChanged(self, setting_key):
if setting_key == "print_sequence": if setting_key == "print_sequence":
if Application.getInstance().getGlobalContainerStack().getValue("print_sequence") == "one_at_a_time": if Application.getInstance().getGlobalContainerStack().getProperty("print_sequence", "value") == "one_at_a_time":
self._height = self._active_container_stack.getValue("gantry_height") self._height = self._active_container_stack.getProperty("gantry_height", "value")
else: else:
self._height = self._active_container_stack.getValue("machine_depth") self._height = self._active_container_stack.getProperty("machine_depth", "value")
self.rebuild() self.rebuild()
if setting_key in self._skirt_settings: if setting_key in self._skirt_settings:
self._updateDisallowedAreas() self._updateDisallowedAreas()
@ -187,7 +187,7 @@ class BuildVolume(SceneNode):
if not self._active_container_stack: if not self._active_container_stack:
return return
disallowed_areas = self._active_container_stack.getValue("machine_disallowed_areas") disallowed_areas = self._active_container_stack.getProperty("machine_disallowed_areas", "value")
areas = [] areas = []
skirt_size = 0.0 skirt_size = 0.0
@ -212,8 +212,8 @@ class BuildVolume(SceneNode):
# Add the skirt areas around the borders of the build plate. # Add the skirt areas around the borders of the build plate.
if skirt_size > 0: if skirt_size > 0:
half_machine_width = self._active_container_stack.getValue("machine_width") / 2 half_machine_width = self._active_container_stack.getProperty("machine_width", "value") / 2
half_machine_depth = self._active_container_stack.getValue("machine_depth") / 2 half_machine_depth = self._active_container_stack.getProperty("machine_depth", "value") / 2
areas.append(Polygon(numpy.array([ areas.append(Polygon(numpy.array([
[-half_machine_width, -half_machine_depth], [-half_machine_width, -half_machine_depth],
@ -249,21 +249,21 @@ class BuildVolume(SceneNode):
def _getSkirtSize(self, container_stack): def _getSkirtSize(self, container_stack):
skirt_size = 0.0 skirt_size = 0.0
adhesion_type = container_stack.getValue("adhesion_type") adhesion_type = container_stack.getProperty("adhesion_type", "value")
if adhesion_type == "skirt": if adhesion_type == "skirt":
skirt_distance = container_stack.getValue("skirt_gap") skirt_distance = container_stack.getProperty("skirt_gap", "value")
skirt_line_count = container_stack.getValue("skirt_line_count") skirt_line_count = container_stack.getProperty("skirt_line_count", "value")
skirt_size = skirt_distance + (skirt_line_count * container_stack.getValue("skirt_line_width")) skirt_size = skirt_distance + (skirt_line_count * container_stack.getProperty("skirt_line_width", "value"))
elif adhesion_type == "brim": elif adhesion_type == "brim":
skirt_size = container_stack.getValue("brim_line_count") * container_stack.getValue("skirt_line_width") skirt_size = container_stack.getProperty("brim_line_count", "value") * container_stack.getProperty("skirt_line_width", "value")
elif adhesion_type == "raft": elif adhesion_type == "raft":
skirt_size = container_stack.getValue("raft_margin") skirt_size = container_stack.getProperty("raft_margin", "value")
if container_stack.getValue("draft_shield_enabled"): if container_stack.getProperty("draft_shield_enabled", "value"):
skirt_size += container_stack.getValue("draft_shield_dist") skirt_size += container_stack.getProperty("draft_shield_dist", "value")
if container_stack.getValue("xy_offset"): if container_stack.getProperty("xy_offset", "value"):
skirt_size += container_stack.getValue("xy_offset") skirt_size += container_stack.getProperty("xy_offset", "value")
return skirt_size return skirt_size

View file

@ -37,7 +37,7 @@ class SolidView(View):
if Application.getInstance().getGlobalContainerStack(): if Application.getInstance().getGlobalContainerStack():
if Preferences.getInstance().getValue("view/show_overhang"): if Preferences.getInstance().getValue("view/show_overhang"):
angle = Application.getInstance().getGlobalContainerStack().getValue("support_angle") angle = Application.getInstance().getGlobalContainerStack().getProperty("support_angle", "value")
if angle is not None: if angle is not None:
self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(90 - angle))) self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(90 - angle)))
else: else: