Commit 723af3c1 authored by sumpfralle's avatar sumpfralle

migrated remaining GCode settings

fixed GCode settings visualization


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1194 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent b840cc29
......@@ -4,6 +4,7 @@
<!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="GCodePreferencesWindow">
<property name="border_width">5</property>
<property name="title" translatable="yes">GCode preferences</property>
<property name="type_hint">normal</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox1">
......
<?xml version="1.0"?>
<interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-naming-policy project-wide -->
<object class="GtkVBox" id="TouchOffBox">
<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">8</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">Probing distance (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="ToolChangeRapidMoveDown">
<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="ToolChangeSlowMoveDown">
<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">Probing 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="ToolChangeSlowMoveSpeed">
<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="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="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>
<child>
<object class="GtkCheckButton" id="TouchOffPauseExecution">
<property name="label" translatable="yes">Pause GCode execution (M0) before and after 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="right_attach">3</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="TouchOffHelp">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="use_stock">True</property>
<property name="xalign">1</property>
<property name="uri">http://sourceforge.net/apps/mediawiki/pycam/index.php?title=TouchOff</property>
</object>
<packing>
<property name="right_attach">3</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="AbsoluteToolChangePositionBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="TouchOffAbsolutePositionWarning">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;span color="#FF0000"&gt;&lt;b&gt;WARNING:&lt;/b&gt; The initial touch off start location needs to be clearly &lt;u&gt;above&lt;/u&gt; the top of the material.&lt;/span&gt;</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox46">
<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="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="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="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="position">1</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>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<object class="GtkAdjustment" id="TouchOffHeightValue">
<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="ToolChangePosYValue">
<property name="lower">-10000</property>
<property name="upper">10000</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="ToolChangeSlowMoveSpeedValue">
<property name="lower">1</property>
<property name="upper">100000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="ToolChangeSlowMoveDownValue">
<property name="lower">0.10000000000000001</property>
<property name="upper">10000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="ToolChangeRapidMoveDownValue">
<property name="upper">10000</property>
<property name="step_increment">1</property>
</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>
</interface>
......@@ -229,787 +229,6 @@
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="GCodePrefTab">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment43">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="vbox30">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkExpander" id="expander3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkAlignment" id="alignment10">
<property name="visible">True</property>
<property name="left_padding">25</property>
<child>
<object class="GtkTable" id="table17">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<child>
<object class="GtkCheckButton" id="GCodeStartStopSpindle">
<property name="label" translatable="yes">Start / Stop Spindle (M3/M5)</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="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="GCodeSpindleDelayLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Delay (in seconds) after start / stop:</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="GCodeSpindleDelay">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="adjustment">GCodeSpindleDelayValue</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="label" translatable="yes">Spindle control</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkExpander" id="expander1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkAlignment" id="alignment29">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="left_padding">22</property>
<child>
<object class="GtkTable" id="table15">
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="column_spacing">3</property>
<property name="row_spacing">3</property>
<child>
<object class="GtkLabel" id="GCodeMinimumStepLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">x-axis:</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="GCodeMinimumStep_x">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="width_chars">10</property>
<property name="adjustment">GCodeMinimumStepValue_x</property>
<property name="digits">8</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="GCodeMinimumStep_y">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="width_chars">10</property>
<property name="adjustment">GCodeMinimumStepValue_y</property>
<property name="digits">8</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="GCodeMinimumStep_z">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="width_chars">10</property>
<property name="adjustment">GCodeMinimumStepValue_z</property>
<property name="digits">8</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"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="GCodeMinimumStepLabel2">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">z-axis:</property>
</object>
<packing>
<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="GCodeMinimumStepLabel1">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">y-axis:</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="GCodeMinimumStepSizeExpanderLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Minimum step width</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkExpander" id="GCodeCornerStyleExpander">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkAlignment" id="alignment44">
<property name="visible">True</property>
<property name="left_padding">25</property>
<child>
<object class="GtkVBox" id="vbox31">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
<object class="GtkHBox" id="hbox27">
<property name="visible">True</property>
<property name="spacing">3</property>
<child>
<object class="GtkLabel" id="GCodePathModeLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Path mode:</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="GCodeCornerStyleControl">
<property name="visible">True</property>
<property name="model">GCodeCornerStyleList</property>
<child>
<object class="GtkCellRendererText" id="GCodeCornerStyleName"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkTable" id="GCodeToleranceTable">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">4</property>
<property name="row_spacing">3</property>
<child>
<object class="GtkSpinButton" id="GCodeCornerStyleCAMTolerance">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="adjustment">GCodeCornerStyleCAMToleranceValue</property>
<property name="digits">3</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="GCodeCornerStyleMotionTolerance">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="adjustment">GCodeCornerStyleMotionToleranceValue</property>
<property name="digits">3</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="GCodeCornerStyleMotionToleranceLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Motion blending tolerance:</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="GCodeCornerStyleCAMToleranceLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Naive CAM tolerance:</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="GCodePathModeHelpLink">
<property name="label" translatable="yes">See the EMC2 manual</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="xalign">1</property>
<property name="uri">http://linuxcnc.org/docs/html/gcode_main.html#sub:G61,-G61.1,-G64:</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="GCodeCornerStyleExpanderLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Corner Style</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</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">8</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">Probing distance (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="ToolChangeRapidMoveDown">
<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="ToolChangeSlowMoveDown">
<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">Probing 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="ToolChangeSlowMoveSpeed">
<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="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>
<child>
<object class="GtkCheckButton" id="TouchOffPauseExecution">
<property name="label" translatable="yes">Pause GCode execution (M0) before and after tool change</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">This setting is supposed to be a workaround for machines with manual spindle control.
Everyone else should use the option for M3/M5 (see above).</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="right_attach">3</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="TouchOffHelp">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="relief">none</property>
<property name="use_stock">True</property>
<property name="xalign">1</property>
<property name="uri">http://sourceforge.net/apps/mediawiki/pycam/index.php?title=TouchOff</property>
</object>
<packing>
<property name="right_attach">3</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="AbsoluteToolChangePositionBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="TouchOffAbsolutePositionWarning">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;span color="#FF0000"&gt;&lt;b&gt;WARNING:&lt;/b&gt; The initial touch off start location needs to be clearly &lt;u&gt;above&lt;/u&gt; the top of the material.&lt;/span&gt;</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox46">
<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="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="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="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="position">1</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>
<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>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">4</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="GCodeFrameLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;GCode settings&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="GCodePreferencesTabLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">GCode</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="ProgramsPrefTab">
<property name="visible">True</property>
......@@ -1178,7 +397,7 @@ Everyone else should use the option for M3/M5 (see above).</property>
</child>
</object>
<packing>
<property name="position">2</property>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
......@@ -1187,7 +406,7 @@ Everyone else should use the option for M3/M5 (see above).</property>
<property name="label" translatable="yes">Programs</property>
</object>
<packing>
<property name="position">2</property>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
......@@ -1379,20 +598,6 @@ You should have received a copy of the GNU General Public License along with thi
<property name="label">Undo latest model change</property>
<property name="stock_id">gtk-undo</property>
</object>
<object class="GtkAdjustment" id="GCodeMinimumStepValue_x">
<property name="upper">100</property>
<property name="step_increment">5.0000000000000002e-05</property>
</object>
<object class="GtkAdjustment" id="GCodeMinimumStepValue_y">
<property name="value">0.00025000000000000001</property>
<property name="upper">100</property>
<property name="step_increment">5.0000000000000002e-05</property>
</object>
<object class="GtkAdjustment" id="GCodeMinimumStepValue_z">
<property name="value">0.00025000000000000001</property>
<property name="upper">100</property>
<property name="step_increment">5.0000000000000002e-05</property>
</object>
<object class="GtkAdjustment" id="ToolChangeRapidMoveDownValue">
<property name="upper">10000</property>
<property name="step_increment">1</property>
......
......@@ -58,11 +58,12 @@ class InputBaseClass(object):
control = self.get_widget()
if not hasattr(self, "_handler_ids"):
self._handler_ids = []
self._handler_ids.append(control.connect(signal, handler))
self._handler_ids.append((control, control.connect(signal, handler)))
def destroy(self):
while hasattr(self, "_handler_ids") and self._handler_ids:
self.get_widget().disconnect(self._handler_ids.pop())
control, handler_id = self._handler_ids.pop()
control.disconnect(handler_id)
self.get_widget().destroy()
def get_widget(self):
......@@ -268,10 +269,10 @@ class ParameterSection(object):
self._table.remove(child)
# add the current controls
for index, widget in enumerate(widgets):
if hasattr(widget, "get_label"):
if hasattr(widget[0], "get_label"):
# checkbox
widget.set_label(widget[1])
self._table.attach(widget, 0, 2, index, index + 1,
widget[0].set_label(widget[1])
self._table.attach(widget[0], 0, 2, index, index + 1,
xoptions=gtk.FILL, yoptions=gtk.FILL)
elif not widget[1]:
self._table.attach(widget[0], 0, 2, index, index + 1,
......
......@@ -525,64 +525,6 @@ class ProjectGui(object):
main_tab.set_sensitive(True)
self.settings.register_event("gui-disable", disable_gui)
self.settings.register_event("gui-enable", enable_gui)
# gcode settings
for objname, setting in (
("GCodeTouchOffOnStartup", "touch_off_on_startup"),
("GCodeTouchOffOnToolChange", "touch_off_on_tool_change")):
obj = self.gui.get_object(objname)
obj.connect("toggled", self.update_gcode_controls)
self.settings.add_item(setting, obj.get_active, obj.set_active)
touch_off_pos_selector = self.gui.get_object("TouchOffLocationSelector")
def get_touch_off_position_type():
index = touch_off_pos_selector.get_active()
if index < 0:
return PREFERENCES_DEFAULTS["touch_off_position_type"]
else:
return touch_off_pos_selector.get_model()[index][0]
def set_touch_off_position_type(new_key):
model = touch_off_pos_selector.get_model()
for index, (key, value) in enumerate(model):
if key == new_key:
touch_off_pos_selector.set_active(index)
break
else:
touch_off_pos_selector.set_active(-1)
touch_off_pos_selector.connect("changed", self.update_gcode_controls)
self.settings.add_item("touch_off_position_type",
get_touch_off_position_type, set_touch_off_position_type)
for axis in "XYZ":
obj = self.gui.get_object("ToolChangePos%s" % axis.upper())
self.settings.add_item("touch_off_position_%s" % axis.lower(),
obj.get_value, obj.set_value)
for objname, setting in (
("ToolChangeRapidMoveDown", "touch_off_rapid_move"),
("ToolChangeSlowMoveDown", "touch_off_slow_move"),
("ToolChangeSlowMoveSpeed", "touch_off_slow_feedrate"),
("TouchOffHeight", "touch_off_height")):
obj = self.gui.get_object(objname)
self.settings.add_item(setting, obj.get_value, obj.set_value)
touch_off_pause = self.gui.get_object("TouchOffPauseExecution")
self.settings.add_item("touch_off_pause_execution",
touch_off_pause.get_active, touch_off_pause.set_active)
gcode_path_mode = self.gui.get_object("GCodeCornerStyleControl")
self.settings.add_item("gcode_path_mode", gcode_path_mode.get_active,
gcode_path_mode.set_active)
gcode_path_mode.connect("changed", self.update_gcode_controls)
gcode_motion_tolerance = self.gui.get_object(
"GCodeCornerStyleMotionTolerance")
self.settings.add_item("gcode_motion_tolerance",
gcode_motion_tolerance.get_value,
gcode_motion_tolerance.set_value)
gcode_naive_tolerance = self.gui.get_object(
"GCodeCornerStyleCAMTolerance")
self.settings.add_item("gcode_naive_tolerance",
gcode_naive_tolerance.get_value,
gcode_naive_tolerance.set_value)
gcode_start_stop_spindle = self.gui.get_object("GCodeStartStopSpindle")
self.settings.add_item("gcode_start_stop_spindle",
gcode_start_stop_spindle.get_active,
gcode_start_stop_spindle.set_active)
gcode_start_stop_spindle.connect("toggled", self.update_gcode_controls)
# configure locations of external programs
for auto_control_name, location_control_name, browse_button, key in (
("ExternalProgramInkscapeAuto",
......@@ -702,46 +644,8 @@ class ProjectGui(object):
self.window.show()
def update_all_controls(self):
self.update_gcode_controls()
self.update_ode_settings()
def update_gcode_controls(self, widget=None):
# path mode
path_mode = self.settings.get("gcode_path_mode")
self.gui.get_object("GCodeToleranceTable").set_sensitive(path_mode == 3)
# spindle delay
sensitive = self.settings.get("gcode_start_stop_spindle")
self.gui.get_object("GCodeSpindleDelayLabel").set_sensitive(sensitive)
self.gui.get_object("GCodeSpindleDelay").set_sensitive(sensitive)
# tool change controls
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_ode_settings(self, widget=None):
if pycam.Utils.threading.is_multiprocessing_enabled() \
or not pycam.Physics.ode_physics.is_ode_available():
......
......@@ -35,25 +35,35 @@ class GCodePreferences(pycam.Plugins.PluginBase):
if self.gui:
import gtk
notebook = self.gui.get_object("GCodePrefsNotebook")
self._pref_items = []
def clear_preferences():
for child in notebook.get_children():
notebook.remove(child)
# we need to clear the whole path down to the "real" item
parent = notebook
while not child in self._pref_items:
parent.remove(child)
parent = child
child = child.get_children()[0]
parent.remove(child)
def add_preferences_item(item, name):
if not item in self._pref_items:
self._pref_items.append(item)
item.unparent()
if not isinstance(item, gtk.Frame):
# create a simple default frame if none was given
frame = gtk.Frame(name)
frame.get_label_widget().set_markup("<b>%s</b>" % name)
frame.set_shadow_type(gtk.SHADOW_NONE)
align = gtk.Alignment()
align.set_padding(5, 0, 12, 0)
align.set_padding(3, 0, 12, 0)
frame.add(align)
frame.show()
item.unparent()
align.add(item)
align.show()
item.show()
item = frame
notebook.append_page(item, gtk.Label(name))
notebook.show_all()
self.core.register_ui_section("gcode_preferences",
add_preferences_item, clear_preferences)
general_widget = pycam.Gui.ControlsGTK.ParameterSection()
......@@ -95,10 +105,10 @@ class GCodeSafetyHeight(pycam.Plugins.PluginBase):
self.safety_height = pycam.Gui.ControlsGTK.InputNumber(digits=0,
change_handler=lambda *args: \
self.core.emit_event("visual-item-updated"))
self.core.register_ui("gcode_general_parameters", "Safety Height",
self.safety_height.get_widget(), weight=20)
# TODO: this should be done via parameter groups based on postprocessors
self.safety_height.get_widget().show()
self.core.register_ui("gcode_general_parameters", "Safety Height",
self.safety_height.get_widget(), weight=20)
self.core.add_item("gcode_safety_height",
self.safety_height.get_value, self.safety_height.set_value)
return True
......@@ -117,11 +127,11 @@ class GCodeFilenameExtension(pycam.Plugins.PluginBase):
def setup(self):
self.filename_extension = pycam.Gui.ControlsGTK.InputString(
max_length=6)
# TODO: this should be done via parameter groups based on postprocessors
self.filename_extension.get_widget().show()
self.core.register_ui("gcode_general_parameters",
"Custom GCode filename extension",
self.filename_extension.get_widget(), weight=80)
# TODO: this should be done via parameter groups based on postprocessors
self.filename_extension.get_widget().show()
self.core.add_item("gcode_filename_extension",
self.filename_extension.get_value,
self.filename_extension.set_value)
......@@ -147,12 +157,12 @@ class GCodeStepWidth(pycam.Plugins.PluginBase):
for key in "xyz":
control = pycam.Gui.ControlsGTK.InputNumber(digits=8, start=0.0001,
increment=0.00005)
# TODO: this should be done via parameter groups based on postprocessors
control.get_widget().show()
self.core.add_item("gcode_minimum_step_%s" % key,
control.get_value, control.set_value)
self.core.register_ui("gcode_step_width", key.upper(),
control.get_widget(), weight="xyz".index(key))
# TODO: this should be done via parameter groups based on postprocessors
control.get_widget().show()
return True
......@@ -168,12 +178,62 @@ class GCodeSpindle(pycam.Plugins.PluginBase):
self.core.register_ui_section("gcode_spindle",
table.add_widget, table.clear_widgets)
self.spindle_delay = pycam.Gui.ControlsGTK.InputNumber(digits=1)
self.core.register_ui("gcode_spindle",
"Delay (in seconds) after start/stop",
self.spindle_delay.get_widget(), weight=20)
# TODO: this should be done via parameter groups based on postprocessors
self.spindle_delay.get_widget().show()
self.core.register_ui("gcode_spindle",
"Delay (in seconds) after start/stop",
self.spindle_delay.get_widget(), weight=50)
self.core.add_item("gcode_spindle_delay",
self.spindle_delay.get_value,
self.spindle_delay.set_value)
self.spindle_enable = pycam.Gui.ControlsGTK.InputCheckBox(
change_handler=self.update_widgets)
self.spindle_enable.get_widget().show()
self.core.register_ui("gcode_spindle", "Start / Stop Spindle (M3/M5)",
self.spindle_enable.get_widget(), weight=10)
self.update_widgets()
return True
def update_widgets(self, widget=None):
widget = self.spindle_delay.get_widget()
widget.set_sensitive(self.spindle_enable.get_value())
class GCodeCornerStyle(pycam.Plugins.PluginBase):
DEPENDS = ["GCodePreferences"]
CATEGORIES = ["GCode"]
def setup(self):
table = pycam.Gui.ControlsGTK.ParameterSection()
self.core.register_ui("gcode_preferences", "Corner style",
table.widget)
self.core.register_ui_section("gcode_corner_style",
table.add_widget, table.clear_widgets)
self.motion_tolerance = pycam.Gui.ControlsGTK.InputNumber(digits=3)
# TODO: this should be done via parameter groups based on postprocessors
self.motion_tolerance.get_widget().show()
self.core.register_ui("gcode_corner_style", "Motion blending tolerance",
self.motion_tolerance.get_widget(), weight=30)
self.naive_tolerance = pycam.Gui.ControlsGTK.InputNumber(digits=3)
self.naive_tolerance.get_widget().show()
self.core.register_ui("gcode_corner_style", "Naive CAM tolerance",
self.naive_tolerance.get_widget(), weight=50)
self.path_mode = pycam.Gui.ControlsGTK.InputChoice((
("Exact path mode (G61)", "exact_path"),
("Exact stop mode (G61.1)", "exact_stop"),
("Continuous with maximum speed (G64)", "optimize_speed"),
("Continuous with tolerance (G64 P/Q)", "optimize_tolerance")))
self.path_mode.get_widget().connect("changed", self.update_widgets)
self.core.register_ui("gcode_corner_style", "Path mode",
self.path_mode.get_widget(), weight=10)
table.widget.show_all()
self.update_widgets()
return True
def update_widgets(self, widget=None):
enable_tolerances = (self.path_mode.get_value() == "optimize_speed")
controls = (self.motion_tolerance, self.naive_tolerance)
for control in controls:
control.get_widget().set_sensitive(enable_tolerances)
# -*- coding: utf-8 -*-
"""
$Id$
Copyright 2011 Lars Kruse <devel@sumpfralle.de>
This file is part of PyCAM.
PyCAM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PyCAM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
"""
import pycam.Plugins
class GCodeTouchOff(pycam.Plugins.PluginBase):
DEPENDS = ["GCodePreferences"]
CATEGORIES = ["GCode"]
UI_FILE = "gcode_touch_off.ui"
def setup(self):
if self.gui:
box = self.gui.get_object("TouchOffBox")
box.unparent()
self.core.register_ui("gcode_preferences", "Touch Off",
box, weight=70)
for objname, setting in (
("GCodeTouchOffOnStartup", "touch_off_on_startup"),
("GCodeTouchOffOnToolChange", "touch_off_on_tool_change")):
self.gui.get_object(objname).connect("toggled",
self.update_widgets)
self.gui.get_object("TouchOffLocationSelector").connect("changed",
self.update_widgets)
self.gui.get_object("TouchOffLocationSelector").set_active(0)
self.update_widgets()
return True
def update_widgets(self, widget=None):
# tool change controls
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]
# 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)
# show or hide the vbox containing the absolute tool change location
absolute_pos_box = self.gui.get_object("AbsoluteToolChangePositionBox")
if (pos_key == "absolute") and touch_off_enabled:
absolute_pos_box.show()
else:
absolute_pos_box.hide()
# 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)()
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