Commit 251dd130 authored by sumpfralle's avatar sumpfralle

dont' show the grid for invalid input

added a tooltip to the grid


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@343 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent f459934b
...@@ -229,9 +229,11 @@ class ProjectGui: ...@@ -229,9 +229,11 @@ class ProjectGui:
# support grid # support grid
self.gui.get_object("SupportGridEnable").connect("clicked", self.update_support_grid_controls) self.gui.get_object("SupportGridEnable").connect("clicked", self.update_support_grid_controls)
grid_distance = self.gui.get_object("SupportGridDistance") grid_distance = self.gui.get_object("SupportGridDistance")
grid_distance.connect("value-changed", self.update_support_grid_controls)
self.settings.add_item("support_grid_distance", self.settings.add_item("support_grid_distance",
grid_distance.get_value, grid_distance.set_value) grid_distance.get_value, grid_distance.set_value)
grid_thickness = self.gui.get_object("SupportGridThickness") grid_thickness = self.gui.get_object("SupportGridThickness")
grid_thickness.connect("value-changed", self.update_support_grid_controls)
self.settings.add_item("support_grid_thickness", self.settings.add_item("support_grid_thickness",
grid_thickness.get_value, grid_thickness.set_value) grid_thickness.get_value, grid_thickness.set_value)
self.settings.set("support_grid_distance", 5.0) self.settings.set("support_grid_distance", 5.0)
...@@ -450,11 +452,14 @@ class ProjectGui: ...@@ -450,11 +452,14 @@ class ProjectGui:
self.gui.get_object("SaveTaskSettings").set_sensitive(not self.last_task_settings_file is None) self.gui.get_object("SaveTaskSettings").set_sensitive(not self.last_task_settings_file is None)
self.gui.get_object("SaveModel").set_sensitive(not self.last_model_file is None) self.gui.get_object("SaveModel").set_sensitive(not self.last_model_file is None)
@gui_activity_guard
def update_support_grid_controls(self, widget=None): def update_support_grid_controls(self, widget=None):
is_enabled = self.gui.get_object("SupportGridEnable").get_active() is_enabled = self.gui.get_object("SupportGridEnable").get_active()
self.gui.get_object("SupportGridDetailsBox").set_visible(is_enabled) details_box = self.gui.get_object("SupportGridDetailsBox")
if is_enabled:
s = self.settings s = self.settings
if is_enabled \
and (s.get("support_grid_thickness") > 0) \
and (s.get("support_grid_distance") > s.get("support_grid_thickness")):
s.set("support_grid", s.set("support_grid",
pycam.Toolpath.SupportGrid.get_support_grid(s.get("minx"), pycam.Toolpath.SupportGrid.get_support_grid(s.get("minx"),
s.get("maxx"), s.get("miny"), s.get("maxy"), s.get("maxx"), s.get("miny"), s.get("maxy"),
...@@ -463,6 +468,10 @@ class ProjectGui: ...@@ -463,6 +468,10 @@ class ProjectGui:
s.get("support_grid_thickness"))) s.get("support_grid_thickness")))
else: else:
self.settings.set("support_grid", None) self.settings.set("support_grid", None)
if is_enabled:
details_box.show()
else:
details_box.hide()
self.update_view() self.update_view()
def update_tasklist_controls(self, widget=None, data=None): def update_tasklist_controls(self, widget=None, data=None):
......
...@@ -1110,6 +1110,12 @@ ...@@ -1110,6 +1110,12 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">A support grid (also called "live bridges") is additional material that
is left behind around the model. This material is supposed to keep
the object at its current position during the machining process.
This is especially useful for very small objects or if you don't use a
vacuum table.
</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</object> </object>
<packing> <packing>
......
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