Commit 2a87c8ca authored by sumpfralle's avatar sumpfralle

moved bounds handling to a separate plugin (still quite broken)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1118 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent b5e69ecc
<?xml version="1.0"?>
<interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-naming-policy project-wide -->
<object class="GtkListStore" id="RelativeUnitModel">
<columns>
<!-- column-name name -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">%</col>
</row>
<row>
<col id="0" translatable="yes">mm/inch</col>
</row>
</data>
</object>
<object class="GtkListStore" id="BoundsModelsList">
<columns>
<!-- column-name ref_model -->
<column type="guint"/>
</columns>
</object>
<object class="GtkListStore" id="ToolLimitModeList">
<columns>
<!-- column-name description -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">move inside limits</col>
</row>
<row>
<col id="0" translatable="yes">move along limits</col>
</row>
<row>
<col id="0" translatable="yes">move around limits</col>
</row>
</data>
</object>
<object class="GtkListStore" id="BoundsList">
<columns>
<!-- column-name ref -->
<column type="gulong"/>
<!-- column-name name -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkAdjustment" id="BoundaryLowXValue">
<property name="lower">-2000</property>
<property name="upper">2000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="BoundaryLowYValue">
<property name="lower">-2000</property>
<property name="upper">2000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="BoundaryLowZValue">
<property name="lower">-2000</property>
<property name="upper">2000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="BoundaryHighXValue">
<property name="lower">-2000</property>
<property name="upper">2000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="BoundaryHighYValue">
<property name="lower">-2000</property>
<property name="upper">2000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="BoundaryHighZValue">
<property name="lower">-2000</property>
<property name="upper">2000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkVPaned" id="BoundsBox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkHBox" id="hbox21">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow7">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">etched-in</property>
<child>
<object class="GtkTreeView" id="BoundsEditTable">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">BoundsList</property>
<property name="headers_clickable">False</property>
<property name="search_column">0</property>
<child>
<object class="GtkTreeViewColumn" id="DescriptionColumn">
<property name="title">Name</property>
<child>
<object class="GtkCellRendererText" id="NameCell">
<property name="editable">True</property>
</object>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox22">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkVButtonBox" id="vbuttonbox3">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="layout_style">center</property>
<child>
<object class="GtkButton" id="BoundsNew">
<property name="label">gtk-new</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="BoundsDelete">
<property name="label">gtk-delete</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="BoundsMoveUp">
<property name="label">gtk-go-up</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="BoundsMoveDown">
<property name="label">gtk-go-down</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVButtonBox" id="vbuttonbox7">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="layout_style">end</property>
<child>
<object class="GtkLinkButton" id="BoundsHelp">
<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="uri">http://sourceforge.net/apps/mediawiki/pycam/index.php?title=BoundsSettings</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="resize">True</property>
<property name="shrink">False</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="BoundsSettingsControlsBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<object class="GtkVBox" id="vbox11">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<object class="GtkHBox" id="hbox23">
<property name="visible">True</property>
<property name="spacing">3</property>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<object class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVButtonBox" id="vbuttonbox1">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="layout_style">start</property>
<child>
<object class="GtkRadioButton" id="TypeRelativeMargin">
<property name="label" translatable="yes">Relative margin</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="TypeCustom">
<property name="label" translatable="yes">Custom</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<property name="group">TypeRelativeMargin</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Type&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHSeparator" id="hseparator1">
<property name="visible">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<object class="GtkComboBox" id="ToolLimit">
<property name="visible">True</property>
<property name="model">ToolLimitModeList</property>
<property name="active">0</property>
<child>
<object class="GtkCellRendererText" id="BoundaryModeColumn"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Tool move limit&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVSeparator" id="vseparator11">
<property name="visible">True</property>
<property name="orientation">vertical</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="n_rows">4</property>
<property name="n_columns">4</property>
<property name="column_spacing">3</property>
<property name="row_spacing">3</property>
<child>
<object class="GtkSpinButton" id="BoundaryLowX">
<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">BoundaryLowXValue</property>
<property name="digits">2</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="BoundaryHighY">
<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">BoundaryHighYValue</property>
<property name="digits">2</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="GtkSpinButton" id="BoundaryLowZ">
<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">BoundaryLowZValue</property>
<property name="digits">2</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="GtkSpinButton" id="BoundaryHighZ">
<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">BoundaryHighZValue</property>
<property name="digits">2</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="GtkSpinButton" id="BoundaryLowY">
<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">BoundaryLowYValue</property>
<property name="digits">2</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="BoundaryHighX">
<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">BoundaryHighXValue</property>
<property name="digits">2</property>
</object>
<packing>
<property name="left_attach">2</property>
<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>
<child>
<object class="GtkLabel" id="z label">
<property name="visible">True</property>
<property name="label" translatable="yes">z:</property>
<property name="width_chars">2</property>
</object>
<packing>
<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="y label">
<property name="visible">True</property>
<property name="label" translatable="yes">y:</property>
<property name="width_chars">2</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="max label">
<property name="visible">True</property>
<property name="label" translatable="yes">upper</property>
</object>
<packing>
<property name="left_attach">2</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="x label">
<property name="visible">True</property>
<property name="label" translatable="yes">x:</property>
<property name="width_chars">2</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>
<child>
<object class="GtkLabel" id="min label">
<property name="visible">True</property>
<property name="label" translatable="yes">lower</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="GtkAlignment" id="alignment34">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="RelativeUnit">
<property name="visible">True</property>
<property name="model">RelativeUnitModel</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext1">
<property name="alignment">center</property>
</object>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="spacing">3</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkButton" id="MarginIncreaseX">
<property name="label" translatable="yes">+</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="MarginResetX">
<property name="label" translatable="yes">0</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="MarginDecreaseX">
<property name="label" translatable="yes">-</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="spacing">3</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkButton" id="MarginIncreaseY">
<property name="label" translatable="yes">+</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="MarginResetY">
<property name="label" translatable="yes">0</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="MarginDecreaseY">
<property name="label" translatable="yes">-</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="spacing">3</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkButton" id="MarginIncreaseZ">
<property name="label" translatable="yes">+</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="MarginResetZ">
<property name="label" translatable="yes">0</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="MarginDecreaseZ">
<property name="label" translatable="yes">-</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="ModelsTableFrame">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkViewport" id="viewport1">
<property name="visible">True</property>
<property name="resize_mode">queue</property>
<property name="shadow_type">etched-in</property>
<child>
<object class="GtkHBox" id="hbox5">
<property name="visible">True</property>
<property name="spacing">3</property>
<child>
<object class="GtkTreeView" id="BoundsModelsTable">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">BoundsModelsList</property>
<property name="headers_visible">False</property>
<property name="headers_clickable">False</property>
<property name="search_column">0</property>
<child>
<object class="GtkTreeViewColumn" id="ModelDescriptionColumn">
<property name="title">Model</property>
<child>
<object class="GtkCellRendererText" id="ModelNameCell"/>
</child>
</object>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="MarginTypeRelativeLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="xpad">2</property>
<property name="label" translatable="yes">&lt;i&gt;Relative margins are given in percent respectively mm/inch relative to the size of the selected models. Positive values create a margin around the model. Negative values create a bounding box that is smaller than the models.&lt;/i&gt;</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
<property name="width_chars">30</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Referenced Models&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="MarginTypeCustomLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="xpad">2</property>
<property name="label" translatable="yes">&lt;i&gt;These values are absolute coordinates of the processing bounding box. They do not depend on any model.&lt;/i&gt;</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="resize">False</property>
<property name="shrink">False</property>
</packing>
</child>
</object>
</interface>
......@@ -49,28 +49,6 @@
</row>
</data>
</object>
<object class="GtkListStore" id="BoundaryModeList">
<columns>
<!-- column-name offset -->
<column type="gint"/>
<!-- column-name description -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0">-1</col>
<col id="1" translatable="yes">move inside limits</col>
</row>
<row>
<col id="0">0</col>
<col id="1" translatable="yes">move along limits</col>
</row>
<row>
<col id="0">1</col>
<col id="1" translatable="yes">move around limits</col>
</row>
</data>
</object>
<object class="GtkListStore" id="ToolPathListModel">
<columns>
<!-- column-name index -->
......@@ -117,20 +95,6 @@
</row>
</data>
</object>
<object class="GtkListStore" id="BoundsList">
<columns>
<!-- column-name index -->
<column type="guint"/>
<!-- column-name description -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0">0</col>
<col id="1" translatable="yes">No margin</col>
</row>
</data>
</object>
<object class="GtkListStore" id="TaskList">
<columns>
<!-- column-name index -->
......@@ -671,36 +635,6 @@
</object>
</child>
</object>
<object class="GtkAdjustment" id="min-x">
<property name="lower">-2000</property>
<property name="upper">2000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="min-y">
<property name="lower">-2000</property>
<property name="upper">2000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="min-z">
<property name="lower">-2000</property>
<property name="upper">2000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="max-x">
<property name="lower">-2000</property>
<property name="upper">2000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="max-y">
<property name="lower">-2000</property>
<property name="upper">2000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="max-z">
<property name="lower">-2000</property>
<property name="upper">2000</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="DrillProgressMaxFPS">
<property name="lower">1</property>
<property name="upper">25</property>
......@@ -839,7 +773,6 @@ ODE can't be used in combination with parallel processing or server mode.</prope
<child>
<object class="GtkTable" id="table8">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">5</property>
<property name="row_spacing">3</property>
......@@ -850,8 +783,6 @@ ODE can't be used in combination with parallel processing or server mode.</prope
<property name="label" translatable="yes">Unit (for all dimensions):</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>
......@@ -868,38 +799,6 @@ ODE can't be used in combination with parallel processing or server mode.</prope
</attributes>
</child>
</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="GtkLabel" id="BoundaryModeLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Boundary mode:</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="BoundaryModeControl">
<property name="visible">True</property>
<property name="model">BoundaryModeList</property>
<property name="active">0</property>
<child>
<object class="GtkCellRendererText" id="BoundaryModeColumn"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
......@@ -4272,958 +4171,180 @@ upon interesting bugs and weird results.</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkFrame" id="BoundsTab">
<object class="GtkVBox" id="TasksTab">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<object class="GtkAlignment" id="alignment31">
<object class="GtkFrame" id="TaskListFrame">
<property name="visible">True</property>
<property name="left_padding">12</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkVBox" id="vbox25">
<object class="GtkAlignment" id="alignment13">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<property name="left_padding">12</property>
<child>
<object class="GtkHBox" id="hbox21">
<object class="GtkVBox" id="vbox18">
<property name="visible">True</property>
<property name="spacing">2</property>
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow7">
<object class="GtkHBox" id="hbox19">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">etched-in</property>
<property name="spacing">2</property>
<child>
<object class="GtkTreeView" id="BoundsEditorTable">
<object class="GtkScrolledWindow" id="scrolledwindow3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">BoundsList</property>
<property name="headers_clickable">False</property>
<property name="search_column">0</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">etched-in</property>
<child>
<object class="GtkTreeViewColumn" id="BoundsTableDescriptionColumn">
<property name="title">Name</property>
<object class="GtkTreeView" id="TaskListTable">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">TaskList</property>
<property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="search_column">0</property>
<child>
<object class="GtkCellRendererText" id="BoundsNameCell"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
<object class="GtkTreeViewColumn" id="task_enabled">
<property name="title">Enabled</property>
<child>
<object class="GtkCellRendererToggle" id="tasklist_enabled"/>
<attributes>
<attribute name="active">2</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="tasklist_name">
<property name="title">Name</property>
<child>
<object class="GtkCellRendererText" id="tasklist_name_cell"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox22">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkVButtonBox" id="vbuttonbox3">
<object class="GtkVBox" id="vbox35">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="layout_style">center</property>
<child>
<object class="GtkButton" id="BoundsListAdd">
<property name="label">gtk-new</property>
<object class="GtkVButtonBox" id="vbuttonbox4">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<property name="orientation">vertical</property>
<property name="layout_style">center</property>
<child>
<object class="GtkButton" id="GenerateToolPathButton">
<property name="label" translatable="yes">_Generate Toolpath</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">GenerateOneToolPathIcon</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="GenerateAllToolPathsButton">
<property name="label" translatable="yes">Generate _All</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="TaskListAdd">
<property name="label">gtk-new</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="TaskListDelete">
<property name="label">gtk-delete</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="TaskListMoveUp">
<property name="label">gtk-go-up</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkButton" id="TaskListMoveDown">
<property name="label">gtk-go-down</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">5</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="GtkButton" id="BoundsListDelete">
<property name="label">gtk-delete</property>
<object class="GtkLinkButton" id="TaskHelp">
<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>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="BoundsListMoveUp">
<property name="label">gtk-go-up</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="BoundsListMoveDown">
<property name="label">gtk-go-down</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVButtonBox" id="vbuttonbox7">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="layout_style">end</property>
<child>
<object class="GtkLinkButton" id="BoundsHelp">
<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="uri">http://sourceforge.net/apps/mediawiki/pycam/index.php?title=BoundsSettings</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="BoundsSettingsControlsBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<object class="GtkHSeparator" id="hseparator3">
<property name="visible">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox22">
<property name="visible">True</property>
<property name="spacing">3</property>
<child>
<object class="GtkLabel" id="BoundsNameLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Name:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="BoundsName">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<property name="width_chars">30</property>
</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="position">1</property>
</packing>
</child>
<child>
<object class="GtkHSeparator" id="hseparator12">
<property name="visible">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="BoundsMarginTypeFrame">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment32">
<property name="visible">True</property>
<property name="top_padding">2</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="vbox11">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkHBox" id="hbox23">
<property name="visible">True</property>
<property name="spacing">3</property>
<child>
<object class="GtkVBox" id="vbox27">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
<object class="GtkRadioButton" id="BoundsTypeRelativeMargin">
<property name="label" translatable="yes">Relative margin</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="BoundsTypeFixedMargin">
<property name="label" translatable="yes">Fixed margin</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<property name="group">BoundsTypeRelativeMargin</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="BoundsTypeCustom">
<property name="label" translatable="yes">Custom</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<property name="group">BoundsTypeRelativeMargin</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVSeparator" id="vseparator11">
<property name="visible">True</property>
<property name="orientation">vertical</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="n_rows">4</property>
<property name="n_columns">6</property>
<property name="column_spacing">3</property>
<property name="row_spacing">3</property>
<child>
<object class="GtkSpinButton" id="boundary_x_low">
<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">min-x</property>
<property name="digits">2</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="boundary_y_high">
<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">max-y</property>
<property name="digits">2</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="GtkSpinButton" id="boundary_z_low">
<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">min-z</property>
<property name="digits">2</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="GtkSpinButton" id="boundary_z_high">
<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">max-z</property>
<property name="digits">2</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="GtkSpinButton" id="boundary_y_low">
<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">min-y</property>
<property name="digits">2</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="boundary_x_high">
<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">max-x</property>
<property name="digits">2</property>
</object>
<packing>
<property name="left_attach">2</property>
<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>
<child>
<object class="GtkLabel" id="z label">
<property name="visible">True</property>
<property name="label" translatable="yes">z:</property>
<property name="width_chars">2</property>
</object>
<packing>
<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="y label">
<property name="visible">True</property>
<property name="label" translatable="yes">y:</property>
<property name="width_chars">2</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="max label">
<property name="visible">True</property>
<property name="label" translatable="yes">upper</property>
</object>
<packing>
<property name="left_attach">2</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="x label">
<property name="visible">True</property>
<property name="label" translatable="yes">x:</property>
<property name="width_chars">2</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>
<child>
<object class="GtkButton" id="BoundsMarginIncreaseX">
<property name="label" translatable="yes">+</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</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="GtkButton" id="BoundsMarginIncreaseY">
<property name="label" translatable="yes">+</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</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="GtkButton" id="BoundsMarginIncreaseZ">
<property name="label" translatable="yes">+</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</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="GtkAlignment" id="alignment35">
<property name="width_request">30</property>
<property name="visible">True</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment36">
<property name="width_request">30</property>
<property name="visible">True</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">5</property>
<property name="right_attach">6</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkButton" id="BoundsMarginDecreaseX">
<property name="label" translatable="yes">-</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">5</property>
<property name="right_attach">6</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="GtkButton" id="BoundsMarginDecreaseY">
<property name="label" translatable="yes">-</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">5</property>
<property name="right_attach">6</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="GtkButton" id="BoundsMarginDecreaseZ">
<property name="label" translatable="yes">-</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">5</property>
<property name="right_attach">6</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="GtkButton" id="BoundsMarginResetX">
<property name="label" translatable="yes">0</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">4</property>
<property name="right_attach">5</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="GtkButton" id="BoundsMarginResetY">
<property name="label" translatable="yes">0</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">4</property>
<property name="right_attach">5</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="GtkButton" id="BoundsMarginResetZ">
<property name="label" translatable="yes">0</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">4</property>
<property name="right_attach">5</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="GtkAlignment" id="alignment16">
<property name="width_request">30</property>
<property name="visible">True</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">4</property>
<property name="right_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="min label">
<property name="visible">True</property>
<property name="label" translatable="yes">lower</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="GtkAlignment" id="alignment34">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<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>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox26">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="BoundsMarginTypeRelativeLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="xpad">2</property>
<property name="label" translatable="yes">&lt;i&gt;Relative margins are given in percent relative to the corresponding model size. Positive values create a margin around the model. Negative values create a bounding box that is smaller than the model.&lt;/i&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="GtkLabel" id="BoundsMarginTypeFixedLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="xpad">2</property>
<property name="label" translatable="yes">&lt;i&gt;Fixed margins are given in mm/inches. Positive values create a margin around the model. Negative values create a bounding box that is smaller than the model.&lt;/i&gt;</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="BoundsMarginTypeCustomLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="xpad">2</property>
<property name="label" translatable="yes">&lt;i&gt;These values are absolute coordinates of the processing bounding box. Changes of the model size have no effect upon the bounding box.&lt;/i&gt;</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="BoundMarginTypeFrameLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Margin Settings&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="BoundsFrameLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Processing boundaries&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
</child>
<child type="tab">
<object class="GtkLabel" id="BoundsTabLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Bounds</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="TasksTab">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<object class="GtkFrame" id="TaskListFrame">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment13">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
<object class="GtkVBox" id="vbox18">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<child>
<object class="GtkHBox" id="hbox19">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property>
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">etched-in</property>
<child>
<object class="GtkTreeView" id="TaskListTable">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">TaskList</property>
<property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="search_column">0</property>
<child>
<object class="GtkTreeViewColumn" id="task_enabled">
<property name="title">Enabled</property>
<child>
<object class="GtkCellRendererToggle" id="tasklist_enabled"/>
<attributes>
<attribute name="active">2</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="tasklist_name">
<property name="title">Name</property>
<child>
<object class="GtkCellRendererText" id="tasklist_name_cell"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox35">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkVButtonBox" id="vbuttonbox4">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="layout_style">center</property>
<child>
<object class="GtkButton" id="GenerateToolPathButton">
<property name="label" translatable="yes">_Generate Toolpath</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">GenerateOneToolPathIcon</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="GenerateAllToolPathsButton">
<property name="label" translatable="yes">Generate _All</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="TaskListAdd">
<property name="label">gtk-new</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="TaskListDelete">
<property name="label">gtk-delete</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="TaskListMoveUp">
<property name="label">gtk-go-up</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkButton" id="TaskListMoveDown">
<property name="label">gtk-go-down</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">5</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="TaskHelp">
<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="uri">http://sourceforge.net/apps/mediawiki/pycam/index.php?title=TaskSettings</property>
<property name="uri">http://sourceforge.net/apps/mediawiki/pycam/index.php?title=TaskSettings</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -5337,7 +4458,6 @@ upon interesting bugs and weird results.</property>
<child>
<object class="GtkComboBox" id="TaskBoundsSelector">
<property name="visible">True</property>
<property name="model">BoundsList</property>
<child>
<object class="GtkCellRendererText" id="BoundsListCell"/>
<attributes>
......@@ -5539,9 +4659,6 @@ upon interesting bugs and weird results.</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="TasksTabLabel">
......@@ -5549,7 +4666,6 @@ upon interesting bugs and weird results.</property>
<property name="label" translatable="yes">Tasks</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
......@@ -5808,7 +4924,7 @@ upon interesting bugs and weird results.</property>
</child>
</object>
<packing>
<property name="position">2</property>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
......@@ -5817,7 +4933,7 @@ upon interesting bugs and weird results.</property>
<property name="label" translatable="yes">Toolpaths</property>
</object>
<packing>
<property name="position">2</property>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
......
......@@ -51,6 +51,25 @@ except ImportError:
log = pycam.Utils.log.get_logger()
def get_combined_bounds(models):
low = [None, None, None]
high = [None, None, None]
for model in models:
if (low[0] is None) or (model.minx < low[0]):
low[0] = model.minx
if (low[1] is None) or (model.miny < low[1]):
low[1] = model.miny
if (low[2] is None) or (model.minz < low[2]):
low[2] = model.minz
if (high[0] is None) or (model.maxx > high[0]):
high[0] = model.maxx
if (high[1] is None) or (model.maxy > high[1]):
high[1] = model.maxy
if (high[2] is None) or (model.maxz > high[2]):
high[2] = model.maxz
return low, high
class BaseModel(TransformableContainer):
id = 0
......
......@@ -304,16 +304,6 @@ class EventCore(pycam.Gui.Settings.Settings):
class ProjectGui(object):
BOUNDARY_MODES = {
"inside": -1,
"along": 0,
"around": 1}
# mapping of boundary types and GUI control elements
BOUNDARY_TYPES = {
Bounds.TYPE_RELATIVE_MARGIN: "BoundsTypeRelativeMargin",
Bounds.TYPE_FIXED_MARGIN: "BoundsTypeFixedMargin",
Bounds.TYPE_CUSTOM: "BoundsTypeCustom"}
META_DATA_PREFIX = "PYCAM-META-DATA:"
def __init__(self, no_dialog=False):
......@@ -420,7 +410,6 @@ class ProjectGui(object):
self.settings.register_event("model-change-before", self._store_undo_state)
self.settings.register_event("model-change-after", self.update_model_dimensions)
self.settings.register_event("model-change-after", self.update_save_actions)
self.settings.register_event("model-change-after", self.update_model_type_related_controls)
self.settings.register_event("model-change-after", self.update_view)
self.settings.register_event("visual-item-updated", self.update_view)
self.settings.register_event("visual-item-updated", self.update_model_dimensions)
......@@ -429,7 +418,7 @@ class ProjectGui(object):
self.gui.get_object("ExportEMCToolDefinition").set_sensitive(tool_num > 0)
self.settings.register_event("tool-selection-changed", update_emc_tool_button)
self.settings.set("load_model", self.load_model)
self.settings.register_event("boundary-updated", self.update_view)
self.settings.register_event("bounds-changed", self.update_view)
# configure drag-n-drop for config files and models
self.configure_drag_and_drop(self.window)
# other events
......@@ -472,8 +461,6 @@ class ProjectGui(object):
# set defaults
self.toolpath = pycam.Toolpath.ToolpathList()
self.cutter = None
self.process_list = []
self.bounds_list = []
self.task_list = []
self._last_unit = None
self._toolpath_for_grid_data = {}
......@@ -487,7 +474,7 @@ class ProjectGui(object):
def add_main_tab_item(item, name):
main_tab.append_page(item, gtk.Label(name))
# TODO: move these to plugins, as well
tab_names = ("Bounds", "Tasks", "Toolpaths")
tab_names = ("Tasks", "Toolpaths")
for name in tab_names:
item = self.gui.get_object(name + "Tab")
item.unparent()
......@@ -550,48 +537,6 @@ class ProjectGui(object):
autoload_box)
self.settings.add_item("default_task_settings_file",
get_autoload_task_file, set_autoload_task_file)
# boundary mode (move inside/along/around the boundaries)
boundary_mode_control = self.gui.get_object("BoundaryModeControl")
def set_boundary_mode(value):
# we assume, that the items in the list are (-1, 0, +1)
boundary_mode_control.set_active(value + 1)
def get_boundary_mode():
return boundary_mode_control.get_active() - 1
self.settings.add_item("boundary_mode", get_boundary_mode,
set_boundary_mode)
# Trigger a re-calculation of the bounds values after changing its type.
for objname in ("BoundsTypeRelativeMargin", "BoundsTypeFixedMargin",
"BoundsTypeCustom"):
self.gui.get_object(objname).connect("toggled",
self.switch_bounds_type)
# Calculate the "minx, ..." settings based on a (potentially) selected
# bounds setting.
def get_absolute_limit(key):
models = self.settings.get("models").get_visible()
if not models:
# avoid problems if no model is visible
return 0
bounds = self.settings.get("current_bounds")
if key.startswith("min"):
func = min
else:
func = max
if bounds is None:
return func([getattr(model, key) for model in models])
lows, highs = [], []
index = "xyz".index(key[-1])
for model in models:
low, high = bounds.get_absolute_limits(reference=model.get_bounds())
lows.append(low[index])
highs.append(high[index])
if key.startswith("min"):
return func(lows)
else:
return func(highs)
for key in ("minx", "maxx", "miny", "maxy", "minz", "maxz"):
# create a new variable "key" to avoid re-using the same object "key"
# (due to the lambda name scope)
self.settings.add_item(key, lambda key=key: get_absolute_limit(key))
# toolpath grid pattern
for objname in ("GridYCount", "GridXCount", "GridYDistance",
"GridXDistance"):
......@@ -690,36 +635,6 @@ class ProjectGui(object):
# update all controls related the (possibly changed) item
if item_list is self.task_list:
self.append_to_queue(self.switch_tasklist_table_selection)
# the boundary manager
self.settings.add_item("current_bounds",
lambda: get_current_item(self.bounds_editor_table, self.bounds_list) or (self.bounds_list and self.bounds_list[0]),
lambda bounds: set_current_item(self.bounds_editor_table, self.bounds_list, bounds))
self.bounds_editor_table = self.gui.get_object("BoundsEditorTable")
self.bounds_editor_table.get_selection().connect("changed", self.switch_bounds_table_selection)
self.gui.get_object("BoundsListMoveUp").connect("clicked", self.handle_bounds_table_event, "move_up")
self.gui.get_object("BoundsListMoveDown").connect("clicked", self.handle_bounds_table_event, "move_down")
self.gui.get_object("BoundsListAdd").connect("clicked", self.handle_bounds_table_event, "add")
self.gui.get_object("BoundsListDelete").connect("clicked", self.handle_bounds_table_event, "delete")
self.gui.get_object("BoundsMarginIncreaseX").connect("clicked", self.adjust_bounds, "x", "+")
self.gui.get_object("BoundsMarginIncreaseY").connect("clicked", self.adjust_bounds, "y", "+")
self.gui.get_object("BoundsMarginIncreaseZ").connect("clicked", self.adjust_bounds, "z", "+")
self.gui.get_object("BoundsMarginDecreaseX").connect("clicked", self.adjust_bounds, "x", "-")
self.gui.get_object("BoundsMarginDecreaseY").connect("clicked", self.adjust_bounds, "y", "-")
self.gui.get_object("BoundsMarginDecreaseZ").connect("clicked", self.adjust_bounds, "z", "-")
self.gui.get_object("BoundsMarginResetX").connect("clicked", self.adjust_bounds, "x", "0")
self.gui.get_object("BoundsMarginResetY").connect("clicked", self.adjust_bounds, "y", "0")
self.gui.get_object("BoundsMarginResetZ").connect("clicked", self.adjust_bounds, "z", "0")
# connect change handler for boundary settings
self.gui.get_object("BoundsName").connect("changed",
self.handle_bounds_settings_change)
for objname in ("boundary_x_low", "boundary_x_high", "boundary_y_low",
"boundary_y_high", "boundary_z_low", "boundary_z_high"):
self.gui.get_object(objname).connect("value-changed",
self.handle_bounds_settings_change)
# the process manager
self.settings.add_item("current_process",
lambda: get_current_item(self.process_editor_table, self.process_list),
lambda process: set_current_item(self.process_editor_table, self.process_list, process))
# make sure that the toolpath settings are consistent
self.toolpath_table = self.gui.get_object("ToolPathTable")
self.toolpath_table.get_selection().connect("changed", self.toolpath_table_event, "update_buttons")
......@@ -987,7 +902,6 @@ class ProjectGui(object):
def update_all_controls(self):
self.update_toolpath_table()
self.update_bounds_table()
self.update_tasklist_table()
self.update_save_actions()
self.update_unit_labels()
......@@ -995,7 +909,6 @@ class ProjectGui(object):
self.update_gcode_controls()
self.update_ode_settings()
self.update_parallel_processes_settings()
self.update_model_type_related_controls()
self.update_toolpath_related_controls()
def update_gcode_controls(self, widget=None):
......@@ -1035,21 +948,6 @@ class ProjectGui(object):
"LengthUnitTouchOffHeight"):
getattr(self.gui.get_object(objname), update_func)()
def update_model_type_related_controls(self):
# disable the lower boundary for contour models
models = self.settings.get("models").get_selected()
if not models:
return
# TODO: choose the right model
model = models[0]
is_contour = isinstance(model, pycam.Geometry.Model.ContourModel)
margin_type = self._load_bounds_settings_from_gui().get_type()
z_low_control = self.gui.get_object("boundary_z_low")
if is_contour and (margin_type != Bounds.TYPE_CUSTOM):
z_low_control.set_sensitive(False)
else:
z_low_control.set_sensitive(True)
def update_ode_settings(self, widget=None):
if pycam.Utils.threading.is_multiprocessing_enabled() \
or not pycam.Physics.ode_physics.is_ode_available():
......@@ -1267,69 +1165,6 @@ class ProjectGui(object):
# store the new setting
self.settings.set("external_program_%s" % key, location)
@gui_activity_guard
def adjust_bounds(self, widget, axis, change):
bounds = self.settings.get("current_bounds")
# TODO: choose the right model
model = self.settings.get("models")[0]
abs_bounds_low, abs_bounds_high = bounds.get_absolute_limits(
reference=model.get_bounds())
# calculate the "change" for +/- (10% of this axis' model dimension)
if bounds is None:
return
if axis == "x":
change_value = (model.maxx - model.minx) * 0.1
elif axis == "y":
change_value = (model.maxy - model.miny) * 0.1
elif axis == "z":
change_value = (model.maxz - model.minz) * 0.1
else:
# not allowed
return
# calculate the new bounds
axis_index = "xyz".index(axis)
if change == "0":
abs_bounds_low[axis_index] = getattr(model, "min%s" % axis)
abs_bounds_high[axis_index] = getattr(model, "max%s" % axis)
elif change == "+":
abs_bounds_low[axis_index] -= change_value
abs_bounds_high[axis_index] += change_value
elif change == "-":
abs_bounds_low[axis_index] += change_value
abs_bounds_high[axis_index] -= change_value
else:
# not allowed
return
# transfer the new bounds values to the old settings
bounds.adjust_bounds_to_absolute_limits(abs_bounds_low, abs_bounds_high,
reference=model.get_bounds())
# update the controls
self._put_bounds_settings_to_gui(bounds)
# update the visualization
self.settings.emit_event("boundary-updated")
@gui_activity_guard
def switch_bounds_type(self, widget=None):
bounds = self.settings.get("current_bounds")
# TODO: choose the right model
model = self.settings.get("models")[0]
new_type = self._load_bounds_settings_from_gui().get_type()
if new_type == bounds.get_type():
# no change
return
# calculate the absolute bounds of the previous configuration
abs_bounds_low, abs_bounds_high = bounds.get_absolute_limits(
reference=model.get_bounds())
bounds.set_type(new_type)
bounds.adjust_bounds_to_absolute_limits(abs_bounds_low, abs_bounds_high,
reference=model.get_bounds())
self._put_bounds_settings_to_gui(bounds)
# update the descriptive label for each margin type
self.update_bounds_controls()
# update the sensitivity of the lower z margin for contour models
self.update_model_type_related_controls()
self.settings.emit_event("boundary-updated")
def update_tasklist_controls(self):
# en/disable some buttons
index = self._treeview_get_active_index(self.tasklist_table, self.task_list)
......@@ -1341,8 +1176,8 @@ class ProjectGui(object):
# "add" is only allowed, if there are any tools, processes and bounds
self.gui.get_object("TaskListAdd").set_sensitive(
(len(self.settings.get("tools")) > 0) \
and (len(self.process_list) > 0) \
and (len(self.bounds_list) > 0))
and (len(self.settings.get("processes")) > 0) \
and (len(self.settings.get("bounds")) > 0))
details_box = self.gui.get_object("TaskDetails")
if selection_active:
details_box.show()
......@@ -1367,9 +1202,9 @@ class ProjectGui(object):
tool = task["tool"]
self.gui.get_object("TaskToolSelector").set_active(self.settings.get("tools").index(tool))
process = task["process"]
self.gui.get_object("TaskProcessSelector").set_active(self.process_list.index(process))
self.gui.get_object("TaskProcessSelector").set_active(self.settings.get("processes").index(process))
bounds = task["bounds"]
self.gui.get_object("TaskBoundsSelector").set_active(self.bounds_list.index(bounds))
self.gui.get_object("TaskBoundsSelector").set_active(self.settings.get("bounds").index(bounds))
# unblock the signals again
for obj, signal_handler in self._task_property_signals:
obj.handler_unblock(signal_handler)
......@@ -1406,8 +1241,8 @@ class ProjectGui(object):
# remove broken tasks from the list (tool or process was deleted)
self.task_list = [task for task in self.task_list
if (task["tool"] in self.settings.get("tools")) \
and (task["process"] in self.process_list) \
and (task["bounds"] in self.bounds_list)]
and (task["process"] in self.settings.get("processes")) \
and (task["bounds"] in self.settings.get("bounds"))]
counter = 0
for task in self.task_list:
tasklist_model.append((counter, task["name"], task["enabled"]))
......@@ -1421,8 +1256,7 @@ class ProjectGui(object):
if not current_task is None:
self.settings.get("tools").select(current_task["tool"])
self.settings.get("processes").select(current_task["process"])
self.settings.set("current_bounds", current_task["bounds"])
self.update_bounds_table(skip_model_update=True)
self.settings.get("bounds").select(current_task["bounds"])
self.update_tasklist_controls()
@gui_activity_guard
......@@ -1439,13 +1273,13 @@ class ProjectGui(object):
tool_id = self.gui.get_object("TaskToolSelector").get_active()
task["tool"] = self.settings.get("tools")[tool_id]
process_id = self.gui.get_object("TaskProcessSelector").get_active()
task["process"] = self.process_list[process_id]
task["process"] = self.settings.get("processes")[process_id]
bounds_id = self.gui.get_object("TaskBoundsSelector").get_active()
old_bounds_id = self.bounds_list.index(task["bounds"])
task["bounds"] = self.bounds_list[bounds_id]
# update the current boundary limit, if it was changed
if bounds_id != old_bounds_id:
self.settings.emit_event("boundary-updated")
self.settings.emit_event("bounds-changed")
# update the tasklist table (especially for name changes)
self.update_tasklist_table()
# the task_name input control seems to loose focus somehow
......@@ -1473,8 +1307,8 @@ class ProjectGui(object):
index += 1
new_task["name"] = "%s%d" % (prefix, index)
new_task["tool"] = self.settings.get("tools")[0]
new_task["process"] = self.process_list[0]
new_task["bounds"] = self.bounds_list[0]
new_task["process"] = self.settings.get("processes")[0]
new_task["bounds"] = self.settings.get("bounds")[0]
new_task["enabled"] = True
self.task_list.append(new_task)
self.update_tasklist_table(self.task_list.index(new_task))
......@@ -1701,10 +1535,7 @@ class ProjectGui(object):
item = datalist[index]
# Check if we need to remove items that depended on the currently
# deleted one.
if not datalist in (self.process_list, self.bounds_list):
# tasks do not depend on this list - just continue
pass
elif len(datalist) == 1:
if len(datalist) == 1:
# There are no replacements available for this item.
# Thus we need to remove _all_ tasks.
while len(self.task_list) > 0:
......@@ -1717,7 +1548,7 @@ class ProjectGui(object):
# Replace all references to the to-be-deleted item with the
# alternative.
for task in self.task_list:
for sublist in ("process", "bounds"):
for sublist in ("tool", "process", "bounds"):
if item is task[sublist]:
task[sublist] = alternative
# Delete the object. Maybe this is not necessary, if it was the
......@@ -1737,20 +1568,16 @@ class ProjectGui(object):
if not future_selection_index is None:
if datalist is self.settings.get("tools"):
self.settings.get("tools").select(future_selection_index)
elif datalist is self.process_list:
self.settings.set("current_process",
self.process_list[future_selection_index])
self.switch_process_table_selection()
elif datalist is self.bounds_list:
self.settings.set("current_bounds",
self.bounds_list[future_selection_index])
self.switch_bounds_table_selection()
elif datalist is self.settings.get("processes"):
self.settings.get("processes").select(future_selection_index)
elif datalist is self.settings.get("bounds"):
self.settings.get("bounds").select(future_selection_index)
else:
pass
# any new item can influence the "New task" button
self.append_to_queue(self.update_tasklist_controls)
# removing or adding "bounds" may change the visualization
self.settings.emit_event("boundary-updated")
self.settings.emit_event("bounds-changed")
update_func(new_index=future_selection_index,
skip_model_update=skip_model_update)
......@@ -1808,14 +1635,14 @@ class ProjectGui(object):
progress.finish()
if self.gui.get_object("UnitChangeProcesses").get_active():
# scale the process settings
for process in self.processes:
for process in self.settings.get("processes"):
for key in ("MaterialAllowanceControl",
"MaxStepDownControl",
"EngraveOffsetControl"):
process[key] *= factor
if self.gui.get_object("UnitChangeBounds").get_active():
# scale the boundaries and keep their center
for bounds in self.bounds_list:
for bounds in self.settings.get("bounds"):
low, high = bounds.get_bounds()
if bounds.get_type() == Bounds.TYPE_FIXED_MARGIN:
low[0] *= factor
......@@ -1848,8 +1675,6 @@ class ProjectGui(object):
# update all labels containing the unit size
self.update_unit_labels()
# update all controls and redraw the boundaries
self.switch_process_table_selection()
self.switch_bounds_table_selection()
self.switch_tasklist_table_selection()
# redraw the model
self.settings.emit_event("model-change-after")
......@@ -2008,20 +1833,15 @@ class ProjectGui(object):
return
# model corners in 3D view
values = {}
for model in models:
for coord in ("minx", "miny", "minz", "maxx", "maxy", "maxz"):
if not coord in values:
values[coord] = []
values[coord].append(getattr(model, coord))
for attr, label_suffix in (("minx", "XMin"), ("miny", "YMin"),
("minz", "ZMin"), ("maxx", "XMax"), ("maxy", "YMax"),
("maxz", "ZMax")):
if attr.startswith("min"):
func = min
else:
func = max
low, high = pycam.Geometry.Model.get_combined_bounds(models)
if None in low or None in high:
# all models are empty
return
for value, label_suffix in ((low[0], "XMin"), (low[1], "YMin"),
(low[2], "ZMin"), (high[0], "XMax"), (high[1], "YMax"),
(high[2], "ZMax")):
label_name = "ModelCorner%s" % label_suffix
value = "%.3f" % func(values[attr])
value = "%.3f" % value
self.gui.get_object(label_name).set_label(value)
def destroy(self, widget=None, data=None):
......@@ -2184,247 +2004,13 @@ class ProjectGui(object):
if not filename is None:
settings.load_file(filename)
# flush all tables (without re-assigning new objects)
for one_list in (self.settings.get("tools"), self.settings.get("processes"), self.bounds_list, self.task_list):
for one_list in (self.settings.get("tools"), self.settings.get("processes"), self.settings.get("bounds"), self.task_list):
while len(one_list) > 0:
one_list.pop()
#self.settings.get("tools").extend(settings.get_tools())
self.bounds_list.extend(settings.get_bounds())
# TODO: load default tools/processes/bounds
self.task_list.extend(settings.get_tasks())
self.update_bounds_table()
self.update_tasklist_table()
def _put_bounds_settings_to_gui(self, settings):
self.gui.get_object("BoundsName").set_text(settings.get_name())
self.gui.get_object(self.BOUNDARY_TYPES[settings.get_type()]).set_active(True)
low, high = settings.get_bounds()
# relative margins are given in percent
if settings.get_type() == Bounds.TYPE_RELATIVE_MARGIN:
factor = 100
else:
factor = 1
for index, axis in enumerate("xyz"):
self.gui.get_object("boundary_%s_low" % axis).set_value(low[index] * factor)
self.gui.get_object("boundary_%s_high" % axis).set_value(high[index] * factor)
def _load_bounds_settings_from_gui(self, settings=None):
def get_boundary_type_from_gui():
for key, objname in self.BOUNDARY_TYPES.items():
if self.gui.get_object(objname).get_active():
return key
if settings is None:
settings = pycam.Toolpath.Bounds()
settings.set_name(self.gui.get_object("BoundsName").get_text())
settings.set_type(get_boundary_type_from_gui())
low = [None] * 3
high = [None] * 3
# relative margins are given in percent
if settings.get_type() == Bounds.TYPE_RELATIVE_MARGIN:
factor = 0.01
else:
factor = 1
for index, axis in enumerate("xyz"):
low[index] = self.gui.get_object(
"boundary_%s_low" % axis).get_value() * factor
high[index] = self.gui.get_object(
"boundary_%s_high" % axis).get_value() * factor
settings.set_bounds(low, high)
return settings
@gui_activity_guard
def handle_bounds_settings_change(self, widget=None, data=None):
current_index = self._treeview_get_active_index(
self.bounds_editor_table, self.bounds_list)
if not current_index is None:
self._load_bounds_settings_from_gui(self.bounds_list[current_index])
self.update_bounds_table()
self.settings.emit_event("boundary-updated")
def update_bounds_controls(self):
current_index = self._treeview_get_active_index(
self.bounds_editor_table, self.bounds_list)
if current_index is None:
# no bounds setting is active
return
# show the proper descriptive label for the current margin type
current_settings = self._load_bounds_settings_from_gui()
current_type = current_settings.get_type()
type_labels = {
Bounds.TYPE_RELATIVE_MARGIN: "BoundsMarginTypeRelativeLabel",
Bounds.TYPE_FIXED_MARGIN: "BoundsMarginTypeFixedLabel",
Bounds.TYPE_CUSTOM: "BoundsMarginTypeCustomLabel",
}
for type_key, label_name in type_labels.items():
is_active = type_key == current_type
if is_active:
self.gui.get_object(label_name).show()
else:
self.gui.get_object(label_name).hide()
# return the control for one of the axes (low/high)
def get_control(index, side):
return self.gui.get_object("boundary_%s_%s" % ("xyz"[index], side))
# disable each zero-dimension in relative margin mode
# TODO: select the specific model
model = self.settings.get("models").get_visible()[0]
if current_type == Bounds.TYPE_RELATIVE_MARGIN:
model_dims = (model.maxx - model.minx,
model.maxy - model.miny,
model.maxz - model.minz)
# disable the low/high controls for each zero-dimension
for index in range(3):
# enabled, if dimension is non-zero
state = model_dims[index] != 0
get_control(index, "high").set_sensitive(state)
if (index == 2) and isinstance(model,
pycam.Geometry.Model.ContourModel):
# disable lower z for contour models
state = False
get_control(index, "low").set_sensitive(state)
else:
# non-relative margins: enable all controls
for index in range(3):
get_control(index, "high").set_sensitive(True)
if (index == 2) and isinstance(model,
pycam.Geometry.Model.ContourModel) and \
(current_type != Bounds.TYPE_CUSTOM):
# disable lower z for contour models
state = False
else:
state = True
get_control(index, "low").set_sensitive(state)
def update_bounds_table(self, new_index=None, skip_model_update=False):
# reset the model data and the selection
if new_index is None:
# keep the old selection - this may return "None" if nothing is selected
new_index = self._treeview_get_active_index(self.bounds_editor_table, self.bounds_list)
if not skip_model_update:
# update the TreeModel data
model = self.gui.get_object("BoundsList")
model.clear()
# columns: index, description
for index, bounds in enumerate(self.bounds_list):
items = (index, bounds.get_name())
model.append(items)
if not new_index is None:
self._treeview_set_active_index(self.bounds_editor_table, new_index)
selection_active = not new_index is None
# enable/disable the modification buttons
self.gui.get_object("BoundsListMoveUp").set_sensitive(selection_active \
and (new_index > 0))
self.gui.get_object("BoundsListDelete").set_sensitive(selection_active)
self.gui.get_object("BoundsListMoveDown").set_sensitive(
selection_active and (new_index + 1 < len(self.bounds_list)))
# hide all controls if no bound is defined
if selection_active:
self.gui.get_object("BoundsSettingsControlsBox").show()
else:
self.gui.get_object("BoundsSettingsControlsBox").hide()
self.update_bounds_controls()
# remove any broken tasks and update changed names
self.update_task_description()
@gui_activity_guard
def switch_bounds_table_selection(self, widget=None, data=None):
bounds = self.settings.get("current_bounds")
if not bounds is None:
self.gui.get_object("BoundsSettingsControlsBox").show()
self._put_bounds_settings_to_gui(bounds)
self.update_bounds_table()
else:
self.gui.get_object("BoundsSettingsControlsBox").hide()
self.settings.emit_event("boundary-updated")
@gui_activity_guard
def handle_bounds_table_event(self, widget, data, action=None):
# "toggle" uses two parameters - all other actions have only one
if action is None:
action = data
self._treeview_button_event(self.bounds_editor_table, self.bounds_list,
action, self.update_bounds_table)
# do some post-processing ...
if action == "add":
# look for the first unused default name
prefix = "New Bounds "
index = 1
# loop while the current name is in use
while [True for bounds in self.bounds_list
if bounds.get_name() == "%s%d" % (prefix, index)]:
index += 1
new_settings = self._load_bounds_settings_from_gui()
new_settings.set_name("%s%d" % (prefix, index))
self.bounds_list.append(new_settings)
self.update_bounds_table(self.bounds_list.index(new_settings))
self._put_bounds_settings_to_gui(new_settings)
elif action == "delete":
self.append_to_queue(self.switch_bounds_table_selection)
# TODO: PROCESS-PLUGIN
def _load_process_settings_from_gui(self, settings=None):
if settings is None:
settings = {}
settings["name"] = self.gui.get_object("ProcessSettingName").get_text()
# path generator
for key in ("PushRemoveStrategy", "ContourPolygonStrategy",
"ContourFollowStrategy", "SurfaceStrategy", "EngraveStrategy"):
if self.gui.get_object(key).get_active():
strategy = key
break
settings["path_strategy"] = strategy
# path direction
for obj, value in (("GridDirectionX", "x"), ("GridDirectionY", "y"),
("GridDirectionXY", "xy")):
if self.gui.get_object(obj).get_active():
direction = value
break
# milling style
for obj, value in (("MillingStyleConventional", "conventional"),
("MillingStyleClimb", "climb"),
("MillingStyleIgnore", "ignore")):
if self.gui.get_object(obj).get_active():
milling_style = value
break
# post_processor and reverse
settings["milling_style"] = milling_style
settings["path_direction"] = direction
for objname, key in (("OverlapPercentControl", "overlap_percent"),
("MaterialAllowanceControl", "material_allowance"),
("MaxStepDownControl", "step_down"),
("EngraveOffsetControl", "engrave_offset")):
settings[key] = self.gui.get_object(objname).get_value()
settings["pocketing_type"] = POCKETING_TYPES[
self.gui.get_object("PocketingControl").get_active()]
return settings
# TODO: PROCESS-PLUGIN
def _put_process_settings_to_gui(self, settings):
self.gui.get_object("ProcessSettingName").set_text(settings["name"])
# path direction
def set_path_direction(direction):
for obj, value in (("GridDirectionX", "x"), ("GridDirectionY", "y"),
("GridDirectionXY", "xy")):
if value == direction:
self.gui.get_object(obj).set_active(True)
return
set_path_direction(settings["path_direction"])
def set_path_strategy(value):
self.gui.get_object(value).set_active(True)
set_path_strategy(settings["path_strategy"])
# milling style
def set_milling_style(style):
STYLES = {"conventional": "MillingStyleConventional",
"climb": "MillingStyleClimb",
"ignore": "MillingStyleIgnore"}
self.gui.get_object(STYLES[style]).set_active(True)
set_milling_style(settings["milling_style"])
for objname, key in (("OverlapPercentControl", "overlap_percent"),
("MaterialAllowanceControl", "material_allowance"),
("MaxStepDownControl", "step_down"),
("EngraveOffsetControl", "engrave_offset")):
self.gui.get_object(objname).set_value(settings[key])
if settings["pocketing_type"] in POCKETING_TYPES:
self.gui.get_object("PocketingControl").set_active(
POCKETING_TYPES.index(settings["pocketing_type"]))
@gui_activity_guard
def toolpath_table_event(self, widget, data, action=None):
# "toggle" uses two parameters - all other actions have only one
......@@ -2589,7 +2175,8 @@ class ProjectGui(object):
return
settings = pycam.Gui.Settings.ProcessSettings()
if not settings.write_to_file(filename, self.settings.get("tools"),
self.process_list, self.bounds_list, self.task_list):
self.settings.get("processes"), self.settings.get("bounds"),
self.task_list):
log.error("Failed to save settings file")
else:
log.info("Task settings written to %s" % filename)
......@@ -2829,36 +2416,17 @@ class ProjectGui(object):
def get_toolpath_settings(self, tool_settings, process_settings, bounds):
toolpath_settings = pycam.Gui.Settings.ToolpathSettings()
# this offset allows to cut a model with a minimal boundary box correctly
offset = tool_settings["tool_radius"]
# check the configured direction of the offset (boundary mode)
if self.settings.get("boundary_mode") == self.BOUNDARY_MODES["inside"]:
# use the negative offset to stay inside the boundaries
offset *= -1
elif self.settings.get("boundary_mode") == self.BOUNDARY_MODES["along"]:
# don't use any offset
offset = 0
elif self.settings.get("boundary_mode") == self.BOUNDARY_MODES["around"]:
# just use the positive offset - no change required
pass
else:
# this should never happen
log.error("Assertion failed: invalid boundary_mode (%s)" % str(self.settings.get("boundary_mode")))
# TODO: find the right model
model = self.settings.get("models")[0]
border = (offset, offset, 0)
bounds.set_reference(model.get_bounds())
processing_bounds = Bounds(Bounds.TYPE_FIXED_MARGIN, border, border,
reference=bounds)
# check if the boundary limits are valid
if not processing_bounds.is_valid():
if not bounds.is_valid():
# don't generate a toolpath if the area is too small (e.g. due to the tool size)
log.error("Processing boundaries are too small for this tool size.")
return None
toolpath_settings.set_bounds(processing_bounds)
toolpath_settings.set_bounds(bounds)
# put the tool settings together
tools = self.settings.get("tools")
......
# -*- 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
# TODO: move Toolpath.Bounds here?
import pycam.Toolpath
class Bounds(pycam.Plugins.ListPluginBase):
UI_FILE = "bounds.ui"
DEPENDS = ["Models"]
COLUMN_REF, COLUMN_NAME = range(2)
LIST_ATTRIBUTE_MAP = {"ref": COLUMN_REF, "name": COLUMN_NAME}
BOUNDARY_MODES = ("inside", "along", "around")
# mapping of boundary types and GUI control elements
BOUNDARY_TYPES = {
pycam.Toolpath.Bounds.TYPE_RELATIVE_MARGIN: "TypeRelativeMargin",
pycam.Toolpath.Bounds.TYPE_CUSTOM: "TypeCustom"}
RELATIVE_UNIT = ("%", "mm")
CONTROL_BUTTONS = ("TypeRelativeMargin", "TypeCustom",
"ToolLimit", "RelativeUnit", "BoundaryLowX",
"BoundaryLowY", "BoundaryLowZ", "BoundaryHighX",
"BoundaryHighY", "BoundaryHighZ")
CONTROL_SIGNALS = ("toggled", "value-changed", "changed")
CONTROL_GET = ("get_active", "get_value")
CONTROL_SET = ("set_active", "set_value")
def setup(self):
if self.gui:
import gtk
bounds_box = self.gui.get_object("BoundsBox")
bounds_box.unparent()
self.core.register_ui("main", "Bounds", bounds_box, 30)
self._boundsview = self.gui.get_object("BoundsEditTable")
self._modelview = self.gui.get_object("BoundsModelsTable")
model_selection = self._modelview.get_selection()
model_selection.set_mode(gtk.SELECTION_MULTIPLE)
self._detail_handlers = []
handler = model_selection.connect("changed",
lambda widget: self.core.emit_event("bounds-changed"))
self._detail_handlers.append((model_selection, handler))
selection = self._boundsview.get_selection()
selection.connect("changed",
lambda widget: self.core.emit_event("bounds-selection-changed"))
self._treemodel = self._boundsview.get_model()
self._treemodel.clear()
def update_model():
if not hasattr(self, "_model_cache"):
self._model_cache = {}
cache = self._model_cache
for row in self._treemodel:
cache[row[self.COLUMN_REF]] = list(row)
self._treemodel.clear()
for index, item in enumerate(self):
if not id(item) in cache:
cache[id(item)] = [id(item), "Bounds #%d" % index]
self._treemodel.append(cache[id(item)])
self.register_model_update(update_model)
for action, obj_name in ((self.ACTION_UP, "BoundsMoveUp"),
(self.ACTION_DOWN, "BoundsMoveDown"),
(self.ACTION_DELETE, "BoundsDelete")):
self.register_list_action_button(action, self._boundsview,
self.gui.get_object(obj_name))
self.gui.get_object("BoundsNew").connect("clicked",
self._bounds_new)
# Trigger a re-calculation of the bounds values after changing its type.
# TODO: recalculate %/mm
"""
for obj_name in ("TypeRelativeMargin", "TypeCustom"):
self.gui.get_object(obj_name).connect("toggled",
self._store_bounds_settings)
"""
# the boundary manager
for obj_name in ("MarginIncreaseX", "MarginIncreaseY",
"MarginIncreaseZ", "MarginDecreaseX", "MarginDecreaseY",
"MarginDecreaseZ", "MarginResetX", "MarginResetY",
"MarginResetZ"):
axis = obj_name[-1].lower()
if "Increase" in obj_name:
args = "+"
elif "Decrease" in obj_name:
args = "-"
else:
args = "0"
self.gui.get_object(obj_name).connect("clicked",
self._adjust_bounds, axis, args)
# connect change handler for boundary settings
for axis in "XYZ":
for value in ("Low", "High"):
obj_name = "Boundary%s%s" % (value, axis)
obj = self.gui.get_object(obj_name)
handler = obj.connect("value-changed",
lambda widget: self.core.emit_event("bounds-changed"))
self._detail_handlers.append((obj, handler))
# register all controls
for obj_name in self.CONTROL_BUTTONS:
obj = self.gui.get_object(obj_name)
for signal in self.CONTROL_SIGNALS:
try:
handler = obj.connect(signal,
lambda *args: self.core.emit_event(args[-1]),
"bounds-changed")
self._detail_handlers.append((obj, handler))
break
except TypeError:
continue
else:
self.log.info("Failed to connect to widget '%s'" % str(obj_name))
self.gui.get_object("NameCell").connect("edited",
self._edit_bounds_name)
self.gui.get_object("ModelDescriptionColumn").set_cell_data_func(
self.gui.get_object("ModelNameCell"), self._render_model_name)
self.core.register_event("bounds-selection-changed",
self._switch_bounds)
self.core.register_event("bounds-changed",
self._store_bounds_settings)
self.core.register_event("model-list-changed",
self._update_model_list)
self._switch_bounds()
self._update_model_list()
self.core.set("bounds", self)
self.core.register_event("bounds-changed",
lambda: self.core.emit_event("visual-item-updated"))
return True
def teardown(self):
if self.gui:
self.core.unregister_ui("main", self.gui.get_object("BoundsBox"))
self.core.set("bounds", None)
return True
def get_selected(self, index=False):
return self._get_selected(self._boundsview, index=index)
def select(self, bounds):
if bounds in self:
selection = self._boundsview.get_selection()
index = [id(b) for b in self].index(id(b))
selection.unselect_all()
selection.select_path((index,))
def get_selected_models(self, index=False):
return self._get_selected(self._modelview,
content=self.core.get("models"), index=index,
force_list=True)
def select_models(self, models):
selection = self._modelview.get_selection()
remaining = models[:]
for index, row in enumerate(self._modelview.get_model()):
model_ids = [id(m) for m in remaining]
path = (index, )
if row[0] in model_ids:
remaining.pop(model_ids.index(row[0]))
if not selection.path_is_selected(path):
selection.select_path(path)
print "Selected: %d" % index
else:
if selection.path_is_selected(path):
selection.unselect_path(path)
print "Unselected: %d" % index
# remove all models that are not available anymore
for not_found in remaining:
models.remove(not_found)
def _render_model_name(self, column, cell, model, m_iter):
path = model.get_path(m_iter)
all_models = self.core.get("models")
model_id = model[path[0]][0]
model_ids = [id(m) for m in all_models]
if model_id in model_ids:
this_model = all_models[model_ids.index(model_id)]
cell.set_property("text", all_models.get_attr(this_model, "name"))
def _update_model_list(self):
model_ids = [id(m) for m in self.core.get("models")]
model_list = self._modelview.get_model()
for index, model_id in enumerate(model_ids):
while (len(model_list) > index) and \
(model_list[index][0] != model_id):
index_iter = model_list.get_iter((index, ))
if model_list[index][0] in model_ids:
# move it to the end of the list
model_list.move_before(index_iter, None)
else:
model_list.remove(index_iter)
if len(model_list) <= index:
model_list.append((model_id,))
def _store_bounds_settings(self, widget=None):
data = self.get_selected()
control_box = self.gui.get_object("BoundsSettingsControlsBox")
if data is None:
control_box.hide()
return
else:
for obj_name in self.CONTROL_BUTTONS:
obj = self.gui.get_object(obj_name)
for get_func in self.CONTROL_GET:
if hasattr(obj, get_func):
value = getattr(obj, get_func)()
data[obj_name] = value
break
else:
self.log.info("Failed to update value of control %s" % obj_name)
data["Models"] = self.get_selected_models()
control_box.show()
self._hide_and_show_controls()
def _hide_and_show_controls(self):
# show the proper descriptive label for the current margin type
relative_label = self.gui.get_object("MarginTypeRelativeLabel")
custom_label = self.gui.get_object("MarginTypeCustomLabel")
model_list = self.gui.get_object("ModelsTableFrame")
if self.gui.get_object("TypeRelativeMargin").get_active():
relative_label.show()
custom_label.hide()
model_list.show()
else:
relative_label.hide()
custom_label.show()
model_list.hide()
def _adjust_bounds(self, widget, axis, change):
bounds = self.get_selected()
if not bounds:
return
axis_index = "xyz".index(axis)
change_factor = {"0": 0, "+": 1, "-": -1}[change]
if self._is_relative():
# % margin
bounds["BoundaryLow%s" % axis.upper()] += change_factor * 10
bounds["BoundaryHigh%s" % axis.upper()] += change_factor * 10
else:
# absolute margin
models = 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
change_value = (model_high[axis_index] - model_low[axis_index]) * 0.1
bounds["BoundaryLow%s" % axis.upper()] += change_value * change_factor
bounds["BoundaryHigh%s" % axis.upper()] += change_value * change_factor
self._update_controls()
self.core.emit_event("bounds-changed")
def _is_relative(self):
return self.RELATIVE_UNIT[self.gui.get_object("RelativeUnit").get_active()] == "%"
def _update_controls(self):
bounds = self.get_selected()
control_box = self.gui.get_object("BoundsSettingsControlsBox")
if not bounds:
control_box.hide()
else:
for obj, handler in self._detail_handlers:
obj.handler_block(handler)
for obj_name, value in bounds.iteritems():
if obj_name == "Models":
self.select_models(value)
continue
obj = self.gui.get_object(obj_name)
for set_func in self.CONTROL_SET:
if hasattr(obj, set_func):
if (value is False) and hasattr(obj, "get_group"):
# no "False" for radio buttons
pass
else:
getattr(obj, set_func)(value)
break
else:
self.log.info("Failed to set value of control %s" % obj_name)
for obj, handler in self._detail_handlers:
obj.handler_unblock(handler)
self._hide_and_show_controls()
control_box.show()
def _switch_bounds(self, widget=None):
self._update_controls()
# update the sensitivity of the lower z margin for contour models
self.core.emit_event("bounds-changed")
def _bounds_new(self, *args):
current_bounds_index = self.get_selected(index=True)
if current_bounds_index is None:
current_bounds_index = 0
new_bounds = {
"BoundaryLowX": 0,
"BoundaryLowY": 0,
"BoundaryLowZ": 0,
"BoundaryHighX": 0,
"BoundaryHighY": 0,
"BoundaryHighZ": 0,
"TypeRelativeMargin": True,
"TypeCustom": False,
"RelativeUnit": self.RELATIVE_UNIT.index("%"),
"ToolLimit": self.BOUNDARY_MODES.index("along"),
"Models": [],
}
self.append(new_bounds)
self.select(new_bounds)
def _edit_bounds_name(self, cell, path, new_text):
path = int(path)
if (new_text != self._treemodel[path][self.COLUMN_NAME]) and \
new_text:
self._treemodel[path][self.COLUMN_NAME] = new_text
......@@ -38,7 +38,7 @@ class ModelSupport(pycam.Plugins.PluginBase):
"support-model-changed")
self.core.register_event("model-change-after",
support_model_changed)
self.core.register_event("boundary-updated",
self.core.register_event("bounds-changed",
support_model_changed)
self.core.register_event("support-model-changed",
self.update_support_model)
......
......@@ -94,6 +94,7 @@ class Models(pycam.Plugins.ListPluginBase):
self._treemodel.append((id(item), "Model #%d" % index,
True, color,
int(self.DEFAULT_COLOR[3] * _GTK_COLOR_MAX)))
self.core.emit_event("model-list-changed")
self._get_colors_of_selected_models()
self.register_model_update(update_model)
self.core.set("models", self)
......
......@@ -21,10 +21,6 @@ along with PyCAM. If not, see <http://www.gnu.org/licenses/>.
"""
import pycam.Plugins
from pycam.PathGenerators.PushCutter import PushCutter
from pycam.PathGenerators.ContourFollow import ContourFollow
from pycam.PathGenerators.DropCutter import DropCutter
from pycam.PathGenerators.EngraveCutter import EngraveCutter
class Processes(pycam.Plugins.ListPluginBase):
......@@ -84,8 +80,8 @@ class Processes(pycam.Plugins.ListPluginBase):
self.register_model_update(update_model)
# process settings
self._detail_handlers = []
for objname in self.CONTROL_BUTTONS:
obj = self.gui.get_object(objname)
for obj_name in self.CONTROL_BUTTONS:
obj = self.gui.get_object(obj_name)
for signal in self.CONTROL_SIGNALS:
try:
handler = obj.connect(signal,
......@@ -96,12 +92,12 @@ class Processes(pycam.Plugins.ListPluginBase):
except TypeError:
continue
else:
self.log.info("Failed to connect to widget '%s'" % str(objname))
self.log.info("Failed to connect to widget '%s'" % str(obj_name))
self.core.register_event("process-selection-changed",
self._process_change)
self._process_switch)
self.core.register_event("process-changed",
self._update_process_controls)
self._update_process_controls()
self._store_process_settings)
self._store_process_settings()
self.core.set("processes", self)
return True
......@@ -153,7 +149,7 @@ class Processes(pycam.Plugins.ListPluginBase):
new_text:
self._treemodel[path][self.COLUMN_NAME] = new_text
def _update_process_controls(self):
def _store_process_settings(self):
data = self.get_selected()
if data is None:
self.gui.get_object("ProcessSettingsControlsBox").hide()
......@@ -167,7 +163,7 @@ class Processes(pycam.Plugins.ListPluginBase):
data[obj_name] = value
break
else:
log.info("Failed to update value of control %s" % objname)
self.log.info("Failed to update value of control %s" % obj_name)
self.gui.get_object("ProcessSettingsControlsBox").show()
while not self._validate_process_consistency():
pass
......@@ -176,7 +172,7 @@ class Processes(pycam.Plugins.ListPluginBase):
renderer = self.gui.get_object("DescriptionCell")
cell.set_cell_data_func(renderer, self._render_process_description)
def _process_change(self, widget=None, data=None):
def _process_switch(self, widget=None, data=None):
process = self.get_selected()
control_box = self.gui.get_object("ProcessSettingsControlsBox")
if not process:
......@@ -195,7 +191,7 @@ class Processes(pycam.Plugins.ListPluginBase):
getattr(obj, set_func)(value)
break
else:
log.info("Failed to set value of control %s" % objname)
self.log.info("Failed to set value of control %s" % obj_name)
for obj, handler in self._detail_handlers:
obj.handler_unblock(handler)
control_box.show()
......
......@@ -165,7 +165,9 @@ class ListPluginBase(PluginBase, list):
self._update_model()
return value
def _get_selected(self, modelview, index=False, force_list=False):
def _get_selected(self, modelview, index=False, force_list=False, content=None):
if content is None:
content = self
if hasattr(modelview, "get_selection"):
# a treeview selection
selection = modelview.get_selection()
......@@ -178,7 +180,7 @@ class ListPluginBase(PluginBase, list):
if index:
get_result = lambda path: path[0]
else:
get_result = lambda path: self[path[0]]
get_result = lambda path: content[path[0]]
if (selection_mode == gtk.SELECTION_MULTIPLE) or force_list:
result = []
for path in paths:
......
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