Commit c74f3163 authored by sumpfralle's avatar sumpfralle

added GUI items for tool change (and touch off) settings


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1001 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 431618e7
......@@ -276,6 +276,24 @@
</row>
</data>
</object>
<object class="GtkListStore" id="TouchOffLocationModel">
<columns>
<!-- column-name key -->
<column type="gchararray"/>
<!-- column-name name -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">startup</col>
<col id="1" translatable="yes">Initial location (at startup)</col>
</row>
<row>
<col id="0" translatable="yes">absolute</col>
<col id="1" translatable="yes">Fixed location (absolute)</col>
</row>
</data>
</object>
<object class="GtkWindow" id="ProjectWindow">
<property name="title" translatable="yes">PyCAM</property>
<property name="destroy_with_parent">True</property>
......@@ -1848,6 +1866,7 @@ The projection plane is usually at z=0. Only in case of models completely above
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
......@@ -1861,6 +1880,7 @@ The projection plane is usually at z=0. Only in case of models completely above
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
......@@ -1874,6 +1894,7 @@ The projection plane is usually at z=0. Only in case of models completely above
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
......@@ -1887,6 +1908,7 @@ The projection plane is usually at z=0. Only in case of models completely above
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
......@@ -2228,7 +2250,7 @@ The projection plane is usually at z=0. Only in case of models completely above
</object>
</child>
<child>
<object class="GtkLabel" id="SpeedLimitsUnitValue">
<object class="GtkLabel" id="SpeedUnit1">
<property name="visible">True</property>
<property name="label" translatable="yes">inches/minute</property>
</object>
......@@ -2363,6 +2385,7 @@ The projection plane is usually at z=0. Only in case of models completely above
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
......@@ -2376,6 +2399,7 @@ The projection plane is usually at z=0. Only in case of models completely above
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
......@@ -2389,6 +2413,7 @@ The projection plane is usually at z=0. Only in case of models completely above
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
......@@ -2402,6 +2427,7 @@ The projection plane is usually at z=0. Only in case of models completely above
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
......@@ -3074,6 +3100,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
......@@ -3087,6 +3114,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
......@@ -3100,6 +3128,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
......@@ -3113,6 +3142,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
......@@ -3833,6 +3863,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
......@@ -3847,6 +3878,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
......@@ -3860,6 +3892,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
......@@ -3873,6 +3906,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
......@@ -3886,6 +3920,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
......@@ -3899,6 +3934,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">5</property>
</packing>
</child>
......@@ -4257,6 +4293,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
......@@ -4270,6 +4307,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
......@@ -4284,6 +4322,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
......@@ -4298,6 +4337,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
......@@ -4312,6 +4352,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
......@@ -4326,6 +4367,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">5</property>
</packing>
</child>
......@@ -5337,7 +5379,7 @@ Choose a small value to minimize rapid moves up and down.</property>
<child>
<object class="GtkHBox" id="hbox27">
<property name="visible">True</property>
<property name="spacing">4</property>
<property name="spacing">3</property>
<child>
<object class="GtkLabel" id="GCodePathModeLabel">
<property name="visible">True</property>
......@@ -5471,6 +5513,343 @@ Choose a small value to minimize rapid moves up and down.</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkExpander" id="expander2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkAlignment" id="alignment5">
<property name="visible">True</property>
<property name="left_padding">25</property>
<child>
<object class="GtkVBox" id="vbox6">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="GCodeTouchOffOnStartup">
<property name="label" translatable="yes">Touch off on startup (initializes coordinate system for Z)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="GCodeTouchOffOnToolChange">
<property name="label" translatable="yes">Measure and compensate tool length on tool change</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkTable" id="TouchOffLocationTable">
<property name="visible">True</property>
<property name="n_rows">6</property>
<property name="n_columns">3</property>
<property name="column_spacing">3</property>
<property name="row_spacing">3</property>
<child>
<object class="GtkComboBox" id="TouchOffLocationSelector">
<property name="visible">True</property>
<property name="model">TouchOffLocationModel</property>
<property name="active">0</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext8"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Touch probe position:</property>
</object>
<packing>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Rapid move down:</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Measure move down (limit):</property>
</object>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="adjustment">ToolChangeRapidMoveDownValue</property>
<property name="digits">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="adjustment">ToolChangeSlowMoveDownValue</property>
<property name="digits">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Measure move speed:</property>
</object>
<packing>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="spinbutton3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="adjustment">ToolChangeSlowMoveSpeedValue</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="LengthUnit1">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">mm</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="LengthUnit2">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">mm</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="SpeedUnit2">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">mm/minute</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="AbsoluteToolChangePositionBox">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Absolute touch off start position:</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="ToolChangePosX">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">X</property>
<property name="invisible_char">&#x25CF;</property>
<property name="width_chars">6</property>
<property name="adjustment">ToolChangePosXValue</property>
<property name="digits">3</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="ToolChangePosY">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Y</property>
<property name="invisible_char">&#x25CF;</property>
<property name="width_chars">6</property>
<property name="adjustment">ToolChangePosYValue</property>
<property name="digits">3</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="ToolChangePosZ">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Z</property>
<property name="invisible_char">&#x25CF;</property>
<property name="width_chars">6</property>
<property name="adjustment">ToolChangePosZValue</property>
<property name="digits">3</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="right_attach">3</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="TouchOffHeightLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Z level of touch probe:</property>
</object>
<packing>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="TouchOffHeight">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">This value specifies the desired height (Z) of the touch plate.
The current coordinate system of the GCode interprete will
be shifted accordingly.</property>
<property name="invisible_char">&#x25CF;</property>
<property name="adjustment">TouchOffHeightValue</property>
<property name="digits">3</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="LengthUnitTouchOffHeight">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">mm</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="GCodeTouchOffLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Touch off and tool length measurement</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">4</property>
</packing>
</child>
</object>
</child>
</object>
......@@ -8513,4 +8892,40 @@ upon interesting bugs and weird results.</property>
<property name="visible">True</property>
<property name="stock">gtk-execute</property>
</object>
<object class="GtkAdjustment" id="ToolChangeRapidMoveDownValue">
<property name="upper">10000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="ToolChangeSlowMoveDownValue">
<property name="value">1</property>
<property name="lower">0.10000000000000001</property>
<property name="upper">10000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="ToolChangeSlowMoveSpeedValue">
<property name="value">20</property>
<property name="lower">1</property>
<property name="upper">100000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="ToolChangePosXValue">
<property name="lower">-10000</property>
<property name="upper">10000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="ToolChangePosYValue">
<property name="lower">-10000</property>
<property name="upper">10000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="ToolChangePosZValue">
<property name="lower">-10000</property>
<property name="upper">10000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="TouchOffHeightValue">
<property name="lower">-10000</property>
<property name="upper">10000</property>
<property name="step_increment">1</property>
</object>
</interface>
......@@ -920,6 +920,11 @@ class ProjectGui:
gcode_safety_height = self.gui.get_object("SafetyHeightControl")
self.settings.add_item("gcode_safety_height",
gcode_safety_height.get_value, gcode_safety_height.set_value)
for event, objname in (("toggled", "GCodeTouchOffOnStartup"),
("toggled", "GCodeTouchOffOnToolChange"),
("changed", "TouchOffLocationSelector")):
self.gui.get_object(objname).connect(event,
self.update_gcode_tool_change_controls)
# redraw the toolpath if safety height changed
gcode_safety_height.connect("value-changed", self.update_view)
gcode_path_mode = self.gui.get_object("GCodeCornerStyleControl")
......@@ -1089,6 +1094,36 @@ class ProjectGui:
self.update_ode_settings()
self.update_parallel_processes_settings()
self.update_model_type_related_controls()
self.update_gcode_tool_change_controls()
def update_gcode_tool_change_controls(self, widget=None):
pos_control = self.gui.get_object("TouchOffLocationSelector")
tool_change_pos_model = pos_control.get_model()
active_pos_index = pos_control.get_active()
if active_pos_index < 0:
pos_key = None
else:
pos_key = tool_change_pos_model[active_pos_index][0]
# show or hide the vbox containing the absolute tool change location
absolute_pos_box = self.gui.get_object("AbsoluteToolChangePositionBox")
if pos_key == "absolute":
absolute_pos_box.show()
else:
absolute_pos_box.hide()
# disable/enable the touch off position controls
position_controls_table = self.gui.get_object("TouchOffLocationTable")
touch_off_enabled = any([self.gui.get_object(objname).get_active()
for objname in ("GCodeTouchOffOnStartup",
"GCodeTouchOffOnToolChange")])
position_controls_table.set_sensitive(touch_off_enabled)
# disable/enable touch probe height
if self.gui.get_object("GCodeTouchOffOnStartup").get_active():
update_func = "show"
else:
update_func = "hide"
for objname in ("TouchOffHeight", "TouchOffHeightLabel",
"LengthUnitTouchOffHeight"):
getattr(self.gui.get_object(objname), update_func)()
def update_model_type_related_controls(self):
is_reversible = (not self.model is None) \
......@@ -2503,12 +2538,15 @@ class ProjectGui:
self.update_view()
def update_unit_labels(self, widget=None, data=None):
# we can't just use the "unit" setting, since we need the plural of "inch"
# don't use the "unit" setting, since we need the plural of "inch"
if self.settings.get("unit") == "mm":
base_unit = "mm"
else:
base_unit = "inches"
self.gui.get_object("SpeedLimitsUnitValue").set_text("%s/minute" % base_unit)
for key in ("SpeedUnit1", "SpeedUnit2"):
self.gui.get_object(key).set_text("%s/minute" % base_unit)
for key in ("LengthUnit1", "LengthUnit2", "LengthUnitTouchOffHeight"):
self.gui.get_object(key).set_text(base_unit)
def get_filename_with_suffix(self, filename, type_filter):
# use the first extension provided by the filter as the default
......
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