Commit a54ad3e7 authored by sumpfralle's avatar sumpfralle

moved simulation interface to a separate tab


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@327 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent c6f0edc9
......@@ -297,7 +297,7 @@ class ProjectGui:
self.gui.get_object("toolpath_down").connect("clicked", self.toolpath_table_event, "move_down")
self.gui.get_object("toolpath_delete").connect("clicked", self.toolpath_table_event, "delete")
self.gui.get_object("toolpath_simulate").connect("clicked", self.toolpath_table_event, "simulate")
self.gui.get_object("ExitSimulationButton").connect("clicked", self.hide_toolpath_simulation)
self.gui.get_object("ExitSimulationButton").connect("clicked", self.finish_toolpath_simulation)
self.gui.get_object("UpdateSimulationButton").connect("clicked", self.update_toolpath_simulation)
# store the original content (for adding the number of current toolpaths in "update_toolpath_table")
self._original_toolpath_tab_label = self.gui.get_object("ToolPathTabLabel").get_text()
......@@ -1355,9 +1355,12 @@ class ProjectGui:
def cancel_progress(self, widget=None):
self._progress_cancel_requested = True
def hide_toolpath_simulation(self, widget=None):
self.gui.get_object("SimulationWidget").hide()
self.task_pane.set_sensitive(True)
def finish_toolpath_simulation(self, widget=None):
# hide the simulation tab
self.gui.get_object("SimulationTab").hide()
# enable all other tabs again
for objname in ("ModelTab", "ModelTabLabel", "TasksTab", "TasksTabLabel", "ToolPathTab", "ToolPathTabLabel"):
self.gui.get_object(objname).set_sensitive(True)
self.settings.set("simulate_object", None)
self.settings.set("show_simulation", False)
self.update_view()
......@@ -1388,7 +1391,7 @@ class ProjectGui:
self.settings.set("simulation_object", simulation_backend)
# disable the simulation widget (avoids confusion regarding "cancel")
if not widget is None:
self.gui.get_object("SimulationWidget").set_sensitive(False)
self.gui.get_object("SimulationTab").set_sensitive(False)
# update the view
self.update_view()
# calculate the simulation and show it simulteneously
......@@ -1414,20 +1417,22 @@ class ProjectGui:
break
# enable the simulation widget again (if we were started from the GUI)
if not widget is None:
self.gui.get_object("SimulationWidget").set_sensitive(True)
self.gui.get_object("SimulationTab").set_sensitive(True)
def show_toolpath_simulation(self, toolpath):
# disable the main controls
for objname in ("ModelTab", "ModelTabLabel", "TasksTab", "TasksTabLabel", "ToolPathTab", "ToolPathTabLabel"):
self.gui.get_object(objname).set_sensitive(False)
# show the simulation controls
self.gui.get_object("SimulationTab").show()
# switch to the simulation tab
self.gui.get_object("MainTabs").set_current_page(3)
# start the simulation
self.settings.set("show_simulation", True)
self.update_toolpath_simulation(toolpath=toolpath)
# disable the task pane _after_ the simulation - the progress bar
# decorator code would reset it otherwise
self.task_pane.set_sensitive(False)
# show the simulation controls
self.gui.get_object("SimulationWidget").show()
# hide the controls immediately, if the simulation was cancelled
if self._progress_cancel_requested:
self.hide_toolpath_simulation()
self.finish_toolpath_simulation()
@progress_activity_guard
def generate_toolpath(self, tool_settings, process_settings):
......
......@@ -1091,7 +1091,7 @@
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox17">
<object class="GtkVBox" id="TasksTab">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
......@@ -1519,7 +1519,7 @@ This combination is added to the above task list.</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="TaskTab">
<object class="GtkLabel" id="TasksTabLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Tasks</property>
</object>
......@@ -1742,128 +1742,135 @@ This feature requires the Open Dynamics Engine (ODE).</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="SimulationWidget">
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment29">
<property name="visible">True</property>
<property name="left_padding">12</property>
<object class="GtkFrame" id="SimulationTab">
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkTable" id="SimulationWidgetTable">
<object class="GtkAlignment" id="alignment29">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">4</property>
<property name="row_spacing">2</property>
<child>
<object class="GtkButton" id="UpdateSimulationButton">
<property name="label">gtk-refresh</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Run the simulation again</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkButton" id="ExitSimulationButton">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Leave simulation mode</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<property name="left_padding">12</property>
<child>
<object class="GtkHBox" id="hbox20">
<object class="GtkVBox" id="vbox23">
<property name="visible">True</property>
<property name="spacing">2</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="SimulationDetailsControlLabel">
<object class="GtkHBox" id="hbox20">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">Simulation detail level (1..10):</property>
<property name="spacing">2</property>
<child>
<object class="GtkLabel" id="SimulationDetailsControlLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">Simulation detail level (1..10):</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="SimulationDetailsControl">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="max_length">6</property>
<property name="invisible_char">&#x25CF;</property>
<property name="adjustment">SimulationDetailsValue</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">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="SimulationDetailsControl">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="max_length">6</property>
<property name="invisible_char">&#x25CF;</property>
<property name="adjustment">SimulationDetailsValue</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Hint:&lt;/b&gt; take a look at the "show drill" and
"OpenGL: polygon" settings in preferences.
&lt;b&gt;Beware:&lt;/b&gt; the simulation feature is new and
experimental. Thus you will quite probably stumble
upon interesting bugs and weird results.</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
<property name="spacing">3</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="UpdateSimulationButton">
<property name="label">gtk-refresh</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="ExitSimulationButton">
<property name="label">gtk-close</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>
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Hint:&lt;/b&gt; take a look at the "show drill" and
"OpenGL: polygon" settings in preferences.
&lt;b&gt;Beware:&lt;/b&gt; the simulation feature is new and
experimental. Thus you will quite probably stumble
upon bugs and weird results.</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options"></property>
<property name="y_options"></property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="SimulationWidgetFrameLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Simulation settings&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child type="label">
<object class="GtkLabel" id="SimulationWidgetFrameLabel">
<child type="tab">
<object class="GtkLabel" id="SimulationTabLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Simulation settings&lt;/b&gt;</property>
<property name="use_markup">True</property>
<property name="label" translatable="yes">Simulation</property>
</object>
<packing>
<property name="position">3</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
<property name="position">0</property>
</packing>
</child>
<child>
......@@ -1872,7 +1879,7 @@ upon bugs and weird results.</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
<property name="position">1</property>
</packing>
</child>
<child>
......@@ -1901,7 +1908,7 @@ upon bugs and weird results.</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">3</property>
<property name="position">2</property>
</packing>
</child>
</object>
......
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