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):
bounds = self.get_selected()
if not bounds:
return
models = bounds["parameters"]["Models"]
models = [m.model for m in bounds["parameters"]["Models"]]
if self.gui.get_object("TypeRelativeMargin").get_active():
# no models are currently selected
func_low = lambda value, axis: 0
......@@ -293,7 +293,7 @@ class Bounds(pycam.Plugins.ListPluginBase):
bounds = self.get_selected()
if not bounds:
return
models = bounds["parameters"]["Models"]
models = [m.model for m in bounds["parameters"]["Models"]]
# calculate the model bounds
low, high = pycam.Geometry.Model.get_combined_bounds(models)
if None in low or None in high:
......@@ -334,7 +334,7 @@ class Bounds(pycam.Plugins.ListPluginBase):
bounds["parameters"]["BoundaryHigh%s" % axis.upper()] += change_factor * 10
else:
# 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)
if None in model_low or None in model_high:
return
......@@ -456,8 +456,8 @@ class BoundsDict(pycam.Plugins.ObjectWithAttributes):
low.append(get_low_value(axis))
high.append(get_high_value(axis))
tool_limit = _BOUNDARY_MODES[self["parameters"]["ToolLimit"]]
# apply inside/along/outside
if tool_limit != "along":
# apply inside/along/outside if a tool is given
if tool and (tool_limit != "along"):
tool_radius = tool["parameters"]["radius"]
if tool_limit == "inside":
offset = -tool_radius
......
......@@ -191,7 +191,7 @@ class ModelExportContour(pycam.Plugins.PluginBase):
self.log.error("Failed to save model file: %s" % err_msg)
else:
self.log.info(("Successfully stored '%s' as " + \
"'%s'.") % (filename, model_name))
"'%s'.") % (filename, model["name"]))
removal_list.reverse()
for index in removal_list:
models.pop(index)
......
......@@ -246,7 +246,7 @@ class OpenGLWindow(pycam.Plugins.PluginBase):
self.unregister_gtk_handlers(self._gtk_handlers)
self.unregister_event_handlers(self._event_handlers)
# 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.clear_state_items()
......@@ -345,7 +345,7 @@ class OpenGLWindow(pycam.Plugins.PluginBase):
if not name in self._color_settings:
self.log.debug("Failed to unregister unknown color item: %s" % name)
return
wrappers = self._color_settings[name]
wrappers = self._color_settings[name]["wrappers"]
self.unregister_state_item(name, *wrappers)
del self._color_settings[name]
self._rebuild_color_settings()
......
......@@ -320,7 +320,7 @@ class PathParamTraceModel(pycam.Plugins.PluginBase):
choices = []
models = self.core.get("models")
for model in models:
if hasattr(model, "get_polygons"):
if hasattr(model.model, "get_polygons"):
choices.append((model["name"], model))
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