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.</
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Show a simple simulation of the generated toolpath.
This feature requires the Open Dynamics Engine (ODE).</property>
<property name="tooltip_text" translatable="yes">Show a simple simulation of the generated toolpath.</property>
<property name="image">ShowToolPathSimulation</property>
</object>
<packing>
......@@ -4377,6 +4376,7 @@ This feature requires the Open Dynamics Engine (ODE).</property>
</child>
<child>
<object class="GtkHBox" id="ProgressWidget">
<property name="spacing">3</property>
<child>
<object class="GtkProgressBar" id="ProgressBar">
<property name="visible">True</property>
......@@ -4386,6 +4386,22 @@ This feature requires the Open Dynamics Engine (ODE).</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox13">
<property name="visible">True</property>
<property name="orientation">vertical</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>
......@@ -4399,6 +4415,12 @@ This feature requires the Open Dynamics Engine (ODE).</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
......@@ -5414,7 +5436,7 @@ Leave this field empty to use the default ("ngc").</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="ShowDrillProgressCheckBox">
<object class="GtkCheckButton" id="ShowDrillCheckBox">
<property name="label" translatable="yes">Show Drill</property>
<property name="visible">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
<object class="GtkDialog" id="SimulationDialog">
<property name="border_width">5</property>
<property name="title" translatable="yes">PyCAM simulation</property>
<property name="modal">True</property>
<property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property>
<property name="has_separator">False</property>
......@@ -7867,6 +7888,29 @@ upon interesting bugs and weird results.</property>
<property name="position">1</property>
</packing>
</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>
<object class="GtkHBox" id="hbox36">
<property name="visible">True</property>
......@@ -7895,7 +7939,7 @@ upon interesting bugs and weird results.</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
<property name="position">4</property>
</packing>
</child>
<child>
......@@ -7908,7 +7952,7 @@ upon interesting bugs and weird results.</property>
</object>
<packing>
<property name="expand">False</property>
<property name="position">3</property>
<property name="position">5</property>
</packing>
</child>
</object>
......@@ -7920,34 +7964,6 @@ upon interesting bugs and weird results.</property>
<object class="GtkHButtonBox" id="dialog-action_area8">
<property name="visible">True</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>
<object class="GtkButton" id="ExitSimulationButton">
<property name="label">gtk-close</property>
......@@ -7959,7 +7975,7 @@ upon interesting bugs and weird results.</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
<property name="position">1</property>
</packing>
</child>
</object>
......@@ -7972,9 +7988,11 @@ upon interesting bugs and weird results.</property>
</object>
</child>
<action-widgets>
<action-widget response="0">SimulationCancelButton</action-widget>
<action-widget response="0">UpdateSimulationButton</action-widget>
<action-widget response="0">ExitSimulationButton</action-widget>
</action-widgets>
</object>
<object class="GtkAdjustment" id="SimulationProgressTimelineValue">
<property name="upper">100</property>
<property name="step_increment">1</property>
</object>
</interface>
......@@ -896,8 +896,7 @@ def draw_complete_model_view(settings):
# don't do it, if a new toolpath is just being calculated
safety_height = settings.get("gcode_safety_height")
if settings.get("show_toolpath") \
and not (settings.get("show_drill_progress") \
and (not settings.get("toolpath_in_progress") is None)) \
and not settings.get("toolpath_in_progress") \
and not (settings.get("show_simulation") \
and settings.get("simulation_toolpath_moves")):
for toolpath_obj in settings.get("toolpath"):
......@@ -907,13 +906,14 @@ def draw_complete_model_view(settings):
settings.get("color_toolpath_return"),
show_directions=settings.get("show_directions"))
# draw the drill
if settings.get("show_drill_progress") \
and settings.get("toolpath_in_progress"):
if settings.get("show_drill"):
cutter = settings.get("cutter")
if not cutter is None:
GL.glColor4f(*settings.get("color_cutter"))
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")
# do a quick conversion from a list of Paths to a list of points
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