Commit e66675fc authored by sumpfralle's avatar sumpfralle

added various "help" buttons (linked to the wiki)

fixed visualization update of toolpath table changes


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1008 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 6c1bcd63
......@@ -39,16 +39,17 @@
<menuitem action="HelpModelTransformations"/>
<menuitem action="HelpGCodeExport"/>
<menuitem action="HelpSimulation"/>
<menuitem action="Help3DView"/>
<menuitem action="HelpServerMode"/>
<menuitem action="HelpCommandLine"/>
<menuitem action="HelpHotkeys"/>
<menuitem action="HelpTouchOff"/>
</menu>
<menu action="HelpMenuGUI">
<menuitem action="HelpToolTypes"/>
<menuitem action="HelpProcessSettings"/>
<menuitem action="HelpBoundsSettings"/>
<menuitem action="HelpTaskSetup"/>
<menuitem action="Help3DView"/>
</menu>
<separator />
<menuitem action="ProjectWebsite"/>
......
......@@ -966,6 +966,11 @@
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkVBox" id="vbox9">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<object class="GtkAlignment" id="alignment42">
<property name="visible">True</property>
......@@ -981,8 +986,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Toggle the direction of a 2D contour model.
This can be useful if the imported model is technically broken (sometimes this happens with Inkscape).</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -997,7 +1000,6 @@ This can be useful if the imported model is technically broken (sometimes this h
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Scale the model by a factor of 25.4.</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -1010,7 +1012,6 @@ This can be useful if the imported model is technically broken (sometimes this h
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Scale the model by a divider of 25.4.</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -1023,8 +1024,6 @@ This can be useful if the imported model is technically broken (sometimes this h
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Reduce the 3D model down to a 2D projection.
The projection plane is usually at z=0. Only in case of models completely above or below zero the bottom of the model is used instead.</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -1034,6 +1033,28 @@ The projection plane is usually at z=0. Only in case of models completely above
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="ModelTransformationsHelp">
<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=ModelTransformations</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="MiscellaneousModelFrameLabel">
......@@ -1860,6 +1881,10 @@ The projection plane is usually at z=0. Only in case of models completely above
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox16">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkVButtonBox" id="vbuttonbox1">
<property name="visible">True</property>
......@@ -1922,6 +1947,27 @@ The projection plane is usually at z=0. Only in case of models completely above
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="ToolHelp">
<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=ToolTypes</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>
......@@ -2380,6 +2426,10 @@ The projection plane is usually at z=0. Only in case of models completely above
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox20">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkVButtonBox" id="vbuttonbox2">
<property name="visible">True</property>
......@@ -2442,6 +2492,27 @@ The projection plane is usually at z=0. Only in case of models completely above
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="ProcessHelp">
<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=ProcessSettings</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>
......@@ -3097,6 +3168,10 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<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>
......@@ -3159,6 +3234,27 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<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="has_tooltip">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="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
......@@ -3860,6 +3956,10 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<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>
......@@ -3871,6 +3971,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Generate the currently selected toolpath</property>
<property name="image">GenerateOneToolPathIcon</property>
<property name="use_underline">True</property>
</object>
......@@ -3886,6 +3987,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Generate all toolpaths that are marked as enabled</property>
<property name="image">GenerateAllToolPathsIcon</property>
<property name="use_underline">True</property>
</object>
......@@ -3952,6 +4054,27 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</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="has_tooltip">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>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
......@@ -4138,6 +4261,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
......@@ -4154,7 +4278,6 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
......@@ -4295,6 +4418,36 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="layout_style">center</property>
<child>
<object class="GtkButton" id="ExportAllToolpathsButton">
<property name="label" translatable="yes">Export all</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">ExportAllToolpathsIcon</property>
<property name="xalign">0</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="ExportVisibleToolpathsButton">
<property name="label" translatable="yes">Export visible</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">ExportVisibleToolpathsIcon</property>
<property name="xalign">0</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="toolpath_simulate">
<property name="label" translatable="yes">Simulate</property>
......@@ -4307,7 +4460,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="position">2</property>
</packing>
</child>
<child>
......@@ -4317,11 +4470,12 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
<property name="position">3</property>
</packing>
</child>
<child>
......@@ -4336,7 +4490,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
<property name="position">4</property>
</packing>
</child>
<child>
......@@ -4351,7 +4505,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
<property name="position">5</property>
</packing>
</child>
<child>
......@@ -4366,7 +4520,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
<property name="position">6</property>
</packing>
</child>
<child>
......@@ -4381,7 +4535,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">5</property>
<property name="position">7</property>
</packing>
</child>
</object>
......@@ -4576,9 +4730,8 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</packing>
</child>
<child>
<object class="GtkToolbar" id="PerspectiveControls">
<object class="GtkHBox" id="hbox38">
<property name="visible">True</property>
<property name="toolbar_style">text</property>
<child>
<object class="GtkToolButton" id="Reset View">
<property name="visible">True</property>
......@@ -4587,7 +4740,8 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
......@@ -4598,7 +4752,8 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
......@@ -4609,7 +4764,8 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
......@@ -4620,7 +4776,8 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
......@@ -4631,7 +4788,8 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
<child>
......@@ -4642,7 +4800,8 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
<property name="fill">False</property>
<property name="position">5</property>
</packing>
</child>
<child>
......@@ -4653,7 +4812,8 @@ Usually you will want to use the cutter radius here to cut around the outline.</
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
<property name="fill">False</property>
<property name="position">6</property>
</packing>
</child>
</object>
......@@ -4661,6 +4821,23 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="3DViewHelp">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="relief">none</property>
<property name="use_stock">True</property>
<property name="xalign">1</property>
<property name="uri">http://sourceforge.net/apps/mediawiki/pycam/index.php?title=3D_View</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -4883,7 +5060,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<property name="label">_Settings</property>
</object>
<object class="GtkAction" id="ExportGCodeVisible">
<property name="label">_Export visible Toolpaths</property>
<property name="label">Export _visible Toolpaths</property>
<property name="tooltip">Write all visible toolpaths to a file.</property>
<property name="stock_id">gtk-execute</property>
<property name="always_show_image">True</property>
......@@ -5623,7 +5800,7 @@ Choose a small value to minimize rapid moves up and down.</property>
<child>
<object class="GtkTable" id="TouchOffLocationTable">
<property name="visible">True</property>
<property name="n_rows">7</property>
<property name="n_rows">8</property>
<property name="n_columns">3</property>
<property name="column_spacing">3</property>
<property name="row_spacing">3</property>
......@@ -5915,6 +6092,26 @@ Everyone else should use the option for M3/M5 (see above).</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="TouchOffHelp">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="relief">none</property>
<property name="use_stock">True</property>
<property name="xalign">1</property>
<property name="uri">http://sourceforge.net/apps/mediawiki/pycam/index.php?title=TouchOff</property>
</object>
<packing>
<property name="right_attach">3</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -6533,7 +6730,7 @@ Hotkey: &lt;p&gt;</property>
<child>
<object class="GtkTable" id="table11">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_rows">3</property>
<property name="n_columns">4</property>
<property name="column_spacing">3</property>
<child>
......@@ -6656,6 +6853,26 @@ Hotkey: &lt;p&gt;</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="ExternalProgramsHelp">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="relief">none</property>
<property name="use_stock">True</property>
<property name="xalign">1</property>
<property name="uri">http://sourceforge.net/apps/mediawiki/pycam/index.php?title=Requirements#Optional_external_programs</property>
</object>
<packing>
<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>
</object>
</child>
</object>
......@@ -6896,7 +7113,7 @@ See the &lt;a href="http://sf.net/apps/mediawiki/pycam/?title=Parallel_Processin
<child>
<object class="GtkTable" id="ServerModeSettingsTable">
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_rows">4</property>
<property name="n_columns">3</property>
<property name="column_spacing">3</property>
<property name="row_spacing">2</property>
......@@ -7069,6 +7286,26 @@ The default port is 1250.</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="ServerModeHelp">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="relief">none</property>
<property name="use_stock">True</property>
<property name="xalign">1</property>
<property name="uri">http://sourceforge.net/apps/mediawiki/pycam/index.php?title=ServerMode</property>
</object>
<packing>
<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>
</object>
</child>
</object>
......@@ -7460,7 +7697,7 @@ Any selected group of dimensions will be scaled accordingly.</property>
<property name="label">_Help</property>
</object>
<object class="GtkAction" id="HelpMenuMisc">
<property name="label">Miscellaneous</property>
<property name="label">Mis_cellaneous</property>
</object>
<object class="GtkAction" id="HelpMenuGUI">
<property name="label">_GUI description</property>
......@@ -7518,15 +7755,15 @@ Any selected group of dimensions will be scaled accordingly.</property>
<property name="stock_id">gtk-network</property>
</object>
<object class="GtkAction" id="Forum">
<property name="label">Forum</property>
<property name="label">_Forum</property>
<property name="stock_id">gtk-network</property>
</object>
<object class="GtkAction" id="BugTracker">
<property name="label">Report a Bug</property>
<property name="label">Report a _Bug</property>
<property name="stock_id">gtk-network</property>
</object>
<object class="GtkAction" id="FeatureRequest">
<property name="label">Request a Feature</property>
<property name="label">Re_quest a Feature</property>
<property name="stock_id">gtk-network</property>
</object>
<object class="GtkAdjustment" id="SupportGridDistanceY">
......@@ -8020,7 +8257,7 @@ Please read the description of the Server Mode (linked below) to understand the
<property name="always_show_image">True</property>
</object>
<object class="GtkAction" id="DevelopmentBlog">
<property name="label">Development Blog</property>
<property name="label">_Development Blog</property>
<property name="stock_id">gtk-network</property>
</object>
<object class="GtkAction" id="HelpServerMode">
......@@ -8971,14 +9208,6 @@ upon interesting bugs and weird results.</property>
<property name="visible">True</property>
<property name="stock">gtk-zoom-fit</property>
</object>
<object class="GtkImage" id="GenerateOneToolPathIcon">
<property name="visible">True</property>
<property name="stock">gtk-execute</property>
</object>
<object class="GtkImage" id="GenerateAllToolPathsIcon">
<property name="visible">True</property>
<property name="stock">gtk-execute</property>
</object>
<object class="GtkAdjustment" id="ToolChangeRapidMoveDownValue">
<property name="upper">10000</property>
<property name="step_increment">1</property>
......@@ -9019,4 +9248,25 @@ upon interesting bugs and weird results.</property>
<property name="upper">100</property>
<property name="step_increment">1</property>
</object>
<object class="GtkImage" id="GenerateOneToolPathIcon">
<property name="visible">True</property>
<property name="stock">gtk-execute</property>
</object>
<object class="GtkImage" id="GenerateAllToolPathsIcon">
<property name="visible">True</property>
<property name="stock">gtk-execute</property>
</object>
<object class="GtkAction" id="HelpTouchOff">
<property name="label">_Touch off and tool change</property>
<property name="short_label">_Touch off</property>
<property name="stock_id">gtk-help</property>
</object>
<object class="GtkImage" id="ExportVisibleToolpathsIcon">
<property name="visible">True</property>
<property name="stock">gtk-save-as</property>
</object>
<object class="GtkImage" id="ExportAllToolpathsIcon">
<property name="visible">True</property>
<property name="stock">gtk-save-as</property>
</object>
</interface>
......@@ -331,7 +331,7 @@ class ProjectGui:
("OpenModel", self.load_model_file, None, "<Control>o"),
("SaveModel", self.save_model, lambda: self.last_model_filename, "<Control>s"),
("SaveAsModel", self.save_model, None, "<Control><Shift>s"),
("ExportGCodeAll", self.save_toolpath, None, "<Control><Shift>e"),
("ExportGCodeAll", self.save_toolpath, False, "<Control><Shift>e"),
("ExportGCodeVisible", self.save_toolpath, True, None),
("ExportEMCToolDefinition", self.export_emc_tools, None, None),
("Quit", self.destroy, None, "<Control>q"),
......@@ -350,6 +350,7 @@ class ProjectGui:
("HelpBoundsSettings", self.show_help, "BoundsSettings", None),
("HelpTaskSetup", self.show_help, "TaskSetup", None),
("HelpGCodeExport", self.show_help, "GCodeExport", None),
("HelpTouchOff", self.show_help, "TouchOff", None),
("HelpSimulation", self.show_help, "Simulation", None),
("Help3DView", self.show_help, "3D_View", None),
("HelpServerMode", self.show_help, "ServerMode", None),
......@@ -865,6 +866,10 @@ class ProjectGui:
self.gui.get_object("toolpath_crop").connect("clicked", self.toolpath_table_event, "crop")
self.gui.get_object("ToolpathGrid").connect("clicked", self.toolpath_table_event, "grid")
self.gui.get_object("ExitSimulationButton").connect("clicked", self.finish_toolpath_simulation)
self.gui.get_object("ExportAllToolpathsButton").connect("clicked",
self.save_toolpath, False)
self.gui.get_object("ExportVisibleToolpathsButton").connect("clicked",
self.save_toolpath, True)
speed_factor_widget = self.gui.get_object("SimulationSpeedFactor")
self.settings.add_item("simulation_speed_factor",
lambda: pow(10, speed_factor_widget.get_value()),
......@@ -1149,6 +1154,7 @@ class ProjectGui:
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):
# path mode
......@@ -3350,8 +3356,9 @@ class ProjectGui:
path = None
if (not path is None) and (path < len(self.toolpath)):
self.toolpath[path].visible = not self.toolpath[path].visible
# hide/show toolpaths according to the new setting
self.update_view()
tp_model = self.toolpath_table.get_model()
tp_model[path][2] = self.toolpath[path].visible
self.update_toolpath_related_controls()
elif action == "simulate":
index = self._treeview_get_active_index(self.toolpath_table,
self.toolpath)
......@@ -3372,7 +3379,7 @@ class ProjectGui:
self._treeview_button_event(self.toolpath_table, self.toolpath,
action, self.update_toolpath_table)
# do some post-processing ...
if action in ("delete", "crop", "grid"):
if action in ("toggle_visibility", "delete", "crop", "grid"):
self.update_view()
def update_toolpath_grid_window(self, widget=None):
......@@ -3423,6 +3430,7 @@ class ProjectGui:
toolpath.visible = False
new_toolpath.visible = True
self.toolpath.append(new_toolpath)
self.update_toolpath_table()
dialog.hide()
@progress_activity_guard
......@@ -3443,14 +3451,7 @@ class ProjectGui:
self.update_progress_bar("Cropping the toolpath")
toolpath.crop(contour.get_polygons(), callback=self.update_progress_bar)
def update_toolpath_table(self, new_index=None, skip_model_update=False):
def get_time_string(minutes):
if minutes > 180:
return "%d hours" % int(round(minutes / 60))
elif minutes > 3:
return "%d minutes" % int(round(minutes))
else:
return "%d seconds" % int(round(minutes * 60))
def update_toolpath_related_controls(self):
# show or hide the "toolpath" tab
toolpath_tab = self.gui.get_object("ToolPathTab")
if not self.toolpath:
......@@ -3461,8 +3462,21 @@ class ProjectGui:
toolpath_tab.show()
# enable/disable the export menu item
self.gui.get_object("ExportGCodeAll").set_sensitive(len(self.toolpath) > 0)
visible_toolpaths = [tp for tp in self.toolpath if tp.visible]
self.gui.get_object("ExportGCodeVisible").set_sensitive(len(visible_toolpaths) > 0)
toolpaths_are_visible = any([tp.visible for tp in self.toolpath])
self.gui.get_object("ExportGCodeVisible").set_sensitive(
toolpaths_are_visible)
self.gui.get_object("ExportVisibleToolpathsButton").set_sensitive(
toolpaths_are_visible)
def update_toolpath_table(self, new_index=None, skip_model_update=False):
def get_time_string(minutes):
if minutes > 180:
return "%d hours" % int(round(minutes / 60))
elif minutes > 3:
return "%d minutes" % int(round(minutes))
else:
return "%d seconds" % int(round(minutes * 60))
self.update_toolpath_related_controls()
# reset the model data and the selection
if new_index is None:
# keep the old selection - this may return "None" if nothing is selected
......
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