Commit 8ed64b23 authored by sumpfralle's avatar sumpfralle

fixed various small mistakes of the latest Model-type migration


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1205 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent d480e8e1
...@@ -250,7 +250,7 @@ class Bounds(pycam.Plugins.ListPluginBase): ...@@ -250,7 +250,7 @@ class Bounds(pycam.Plugins.ListPluginBase):
bounds = self.get_selected() bounds = self.get_selected()
if not bounds: if not bounds:
return return
models = bounds["parameters"]["Models"] models = [m.model for m in bounds["parameters"]["Models"]]
if self.gui.get_object("TypeRelativeMargin").get_active(): if self.gui.get_object("TypeRelativeMargin").get_active():
# no models are currently selected # no models are currently selected
func_low = lambda value, axis: 0 func_low = lambda value, axis: 0
...@@ -293,7 +293,7 @@ class Bounds(pycam.Plugins.ListPluginBase): ...@@ -293,7 +293,7 @@ class Bounds(pycam.Plugins.ListPluginBase):
bounds = self.get_selected() bounds = self.get_selected()
if not bounds: if not bounds:
return return
models = bounds["parameters"]["Models"] models = [m.model for m in bounds["parameters"]["Models"]]
# calculate the model bounds # calculate the model bounds
low, high = pycam.Geometry.Model.get_combined_bounds(models) low, high = pycam.Geometry.Model.get_combined_bounds(models)
if None in low or None in high: if None in low or None in high:
...@@ -334,7 +334,7 @@ class Bounds(pycam.Plugins.ListPluginBase): ...@@ -334,7 +334,7 @@ class Bounds(pycam.Plugins.ListPluginBase):
bounds["parameters"]["BoundaryHigh%s" % axis.upper()] += change_factor * 10 bounds["parameters"]["BoundaryHigh%s" % axis.upper()] += change_factor * 10
else: else:
# absolute margin # absolute margin
models = self.get_selected_models() models = [m.model for m in self.get_selected_models()]
model_low, model_high = pycam.Geometry.Model.get_combined_bounds(models) model_low, model_high = pycam.Geometry.Model.get_combined_bounds(models)
if None in model_low or None in model_high: if None in model_low or None in model_high:
return return
...@@ -456,8 +456,8 @@ class BoundsDict(pycam.Plugins.ObjectWithAttributes): ...@@ -456,8 +456,8 @@ class BoundsDict(pycam.Plugins.ObjectWithAttributes):
low.append(get_low_value(axis)) low.append(get_low_value(axis))
high.append(get_high_value(axis)) high.append(get_high_value(axis))
tool_limit = _BOUNDARY_MODES[self["parameters"]["ToolLimit"]] tool_limit = _BOUNDARY_MODES[self["parameters"]["ToolLimit"]]
# apply inside/along/outside # apply inside/along/outside if a tool is given
if tool_limit != "along": if tool and (tool_limit != "along"):
tool_radius = tool["parameters"]["radius"] tool_radius = tool["parameters"]["radius"]
if tool_limit == "inside": if tool_limit == "inside":
offset = -tool_radius offset = -tool_radius
......
...@@ -191,7 +191,7 @@ class ModelExportContour(pycam.Plugins.PluginBase): ...@@ -191,7 +191,7 @@ class ModelExportContour(pycam.Plugins.PluginBase):
self.log.error("Failed to save model file: %s" % err_msg) self.log.error("Failed to save model file: %s" % err_msg)
else: else:
self.log.info(("Successfully stored '%s' as " + \ self.log.info(("Successfully stored '%s' as " + \
"'%s'.") % (filename, model_name)) "'%s'.") % (filename, model["name"]))
removal_list.reverse() removal_list.reverse()
for index in removal_list: for index in removal_list:
models.pop(index) models.pop(index)
......
...@@ -246,7 +246,7 @@ class OpenGLWindow(pycam.Plugins.PluginBase): ...@@ -246,7 +246,7 @@ class OpenGLWindow(pycam.Plugins.PluginBase):
self.unregister_gtk_handlers(self._gtk_handlers) self.unregister_gtk_handlers(self._gtk_handlers)
self.unregister_event_handlers(self._event_handlers) self.unregister_event_handlers(self._event_handlers)
# the area will be created during setup again # the area will be created during setup again
self.container.remove(self.area) self.gui.get_object("OpenGLBox").remove(self.area)
self.area = None self.area = None
self.clear_state_items() self.clear_state_items()
...@@ -345,7 +345,7 @@ class OpenGLWindow(pycam.Plugins.PluginBase): ...@@ -345,7 +345,7 @@ class OpenGLWindow(pycam.Plugins.PluginBase):
if not name in self._color_settings: if not name in self._color_settings:
self.log.debug("Failed to unregister unknown color item: %s" % name) self.log.debug("Failed to unregister unknown color item: %s" % name)
return return
wrappers = self._color_settings[name] wrappers = self._color_settings[name]["wrappers"]
self.unregister_state_item(name, *wrappers) self.unregister_state_item(name, *wrappers)
del self._color_settings[name] del self._color_settings[name]
self._rebuild_color_settings() self._rebuild_color_settings()
......
...@@ -320,7 +320,7 @@ class PathParamTraceModel(pycam.Plugins.PluginBase): ...@@ -320,7 +320,7 @@ class PathParamTraceModel(pycam.Plugins.PluginBase):
choices = [] choices = []
models = self.core.get("models") models = self.core.get("models")
for model in models: for model in models:
if hasattr(model, "get_polygons"): if hasattr(model.model, "get_polygons"):
choices.append((model["name"], model)) choices.append((model["name"], model))
self.control.update_choices(choices) self.control.update_choices(choices)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment