Commit e7f1b929 authored by sumpfralle's avatar sumpfralle

improved simulation:

* added a progress slider for backward/forward control
* removed "modal" property to allow model view changes during simulation


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@902 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 53030e64
...@@ -4271,8 +4271,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</ ...@@ -4271,8 +4271,7 @@ Usually you will want to use the cutter radius here to cut around the outline.</
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Show a simple simulation of the generated toolpath. <property name="tooltip_text" translatable="yes">Show a simple simulation of the generated toolpath.</property>
This feature requires the Open Dynamics Engine (ODE).</property>
<property name="image">ShowToolPathSimulation</property> <property name="image">ShowToolPathSimulation</property>
</object> </object>
<packing> <packing>
...@@ -4377,6 +4376,7 @@ This feature requires the Open Dynamics Engine (ODE).</property> ...@@ -4377,6 +4376,7 @@ This feature requires the Open Dynamics Engine (ODE).</property>
</child> </child>
<child> <child>
<object class="GtkHBox" id="ProgressWidget"> <object class="GtkHBox" id="ProgressWidget">
<property name="spacing">3</property>
<child> <child>
<object class="GtkProgressBar" id="ProgressBar"> <object class="GtkProgressBar" id="ProgressBar">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -4387,11 +4387,33 @@ This feature requires the Open Dynamics Engine (ODE).</property> ...@@ -4387,11 +4387,33 @@ This feature requires the Open Dynamics Engine (ODE).</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="ProgressCancelButton"> <object class="GtkVBox" id="vbox13">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="orientation">vertical</property>
<property name="receives_default">True</property> <child>
<object class="GtkToggleButton" id="ShowToolpathProgressButton">
<property name="label" translatable="yes">Show Progress</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ProgressCancelButton">
<property name="label" translatable="yes">Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
...@@ -5414,7 +5436,7 @@ Leave this field empty to use the default ("ngc").</property> ...@@ -5414,7 +5436,7 @@ Leave this field empty to use the default ("ngc").</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkCheckButton" id="ShowDrillProgressCheckBox"> <object class="GtkCheckButton" id="ShowDrillCheckBox">
<property name="label" translatable="yes">Show Drill</property> <property name="label" translatable="yes">Show Drill</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
...@@ -7804,7 +7826,6 @@ Please read the description of the Server Mode (linked below) to understand the ...@@ -7804,7 +7826,6 @@ Please read the description of the Server Mode (linked below) to understand the
<object class="GtkDialog" id="SimulationDialog"> <object class="GtkDialog" id="SimulationDialog">
<property name="border_width">5</property> <property name="border_width">5</property>
<property name="title" translatable="yes">PyCAM simulation</property> <property name="title" translatable="yes">PyCAM simulation</property>
<property name="modal">True</property>
<property name="destroy_with_parent">True</property> <property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<property name="has_separator">False</property> <property name="has_separator">False</property>
...@@ -7867,6 +7888,29 @@ upon interesting bugs and weird results.</property> ...@@ -7867,6 +7888,29 @@ upon interesting bugs and weird results.</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkLabel" id="SimulationProgressTimelineLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Progress:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkHScale" id="SimulationProgressTimeline">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">SimulationProgressTimelineValue</property>
<property name="draw_value">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">3</property>
</packing>
</child>
<child> <child>
<object class="GtkHBox" id="hbox36"> <object class="GtkHBox" id="hbox36">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -7895,7 +7939,7 @@ upon interesting bugs and weird results.</property> ...@@ -7895,7 +7939,7 @@ upon interesting bugs and weird results.</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">2</property> <property name="position">4</property>
</packing> </packing>
</child> </child>
<child> <child>
...@@ -7908,7 +7952,7 @@ upon interesting bugs and weird results.</property> ...@@ -7908,7 +7952,7 @@ upon interesting bugs and weird results.</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="position">3</property> <property name="position">5</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -7920,34 +7964,6 @@ upon interesting bugs and weird results.</property> ...@@ -7920,34 +7964,6 @@ upon interesting bugs and weird results.</property>
<object class="GtkHButtonBox" id="dialog-action_area8"> <object class="GtkHButtonBox" id="dialog-action_area8">
<property name="visible">True</property> <property name="visible">True</property>
<property name="layout_style">end</property> <property name="layout_style">end</property>
<child>
<object class="GtkButton" id="SimulationCancelButton">
<property name="label">gtk-cancel</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="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">1</property>
</packing>
</child>
<child> <child>
<object class="GtkButton" id="ExitSimulationButton"> <object class="GtkButton" id="ExitSimulationButton">
<property name="label">gtk-close</property> <property name="label">gtk-close</property>
...@@ -7959,7 +7975,7 @@ upon interesting bugs and weird results.</property> ...@@ -7959,7 +7975,7 @@ upon interesting bugs and weird results.</property>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
<property name="position">2</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -7972,9 +7988,11 @@ upon interesting bugs and weird results.</property> ...@@ -7972,9 +7988,11 @@ upon interesting bugs and weird results.</property>
</object> </object>
</child> </child>
<action-widgets> <action-widgets>
<action-widget response="0">SimulationCancelButton</action-widget>
<action-widget response="0">UpdateSimulationButton</action-widget>
<action-widget response="0">ExitSimulationButton</action-widget> <action-widget response="0">ExitSimulationButton</action-widget>
</action-widgets> </action-widgets>
</object> </object>
<object class="GtkAdjustment" id="SimulationProgressTimelineValue">
<property name="upper">100</property>
<property name="step_increment">1</property>
</object>
</interface> </interface>
...@@ -896,8 +896,7 @@ def draw_complete_model_view(settings): ...@@ -896,8 +896,7 @@ def draw_complete_model_view(settings):
# don't do it, if a new toolpath is just being calculated # don't do it, if a new toolpath is just being calculated
safety_height = settings.get("gcode_safety_height") safety_height = settings.get("gcode_safety_height")
if settings.get("show_toolpath") \ if settings.get("show_toolpath") \
and not (settings.get("show_drill_progress") \ and not settings.get("toolpath_in_progress") \
and (not settings.get("toolpath_in_progress") is None)) \
and not (settings.get("show_simulation") \ and not (settings.get("show_simulation") \
and settings.get("simulation_toolpath_moves")): and settings.get("simulation_toolpath_moves")):
for toolpath_obj in settings.get("toolpath"): for toolpath_obj in settings.get("toolpath"):
...@@ -907,13 +906,14 @@ def draw_complete_model_view(settings): ...@@ -907,13 +906,14 @@ def draw_complete_model_view(settings):
settings.get("color_toolpath_return"), settings.get("color_toolpath_return"),
show_directions=settings.get("show_directions")) show_directions=settings.get("show_directions"))
# draw the drill # draw the drill
if settings.get("show_drill_progress") \ if settings.get("show_drill"):
and settings.get("toolpath_in_progress"):
cutter = settings.get("cutter") cutter = settings.get("cutter")
if not cutter is None: if not cutter is None:
GL.glColor4f(*settings.get("color_cutter")) GL.glColor4f(*settings.get("color_cutter"))
cutter.to_OpenGL() cutter.to_OpenGL()
# also show the toolpath that is currently being calculated if settings.get("show_drill_progress") \
and settings.get("toolpath_in_progress"):
# show the toolpath that is currently being calculated
toolpath_in_progress = settings.get("toolpath_in_progress") toolpath_in_progress = settings.get("toolpath_in_progress")
# do a quick conversion from a list of Paths to a list of points # do a quick conversion from a list of Paths to a list of points
moves = [] moves = []
......
This diff is collapsed.
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