Commit 4a032cd1 authored by sumpfralle's avatar sumpfralle

update toolpath time after change

warn if process or task parameters are missing
use first value of selector, if non was specified


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1191 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 05358d3e
......@@ -748,10 +748,9 @@
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkViewport" id="ModelsViewPort">
<object class="GtkVBox" id="ModelsViewPort">
<property name="visible">True</property>
<property name="resize_mode">queue</property>
<property name="shadow_type">etched-out</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
......
......@@ -112,6 +112,10 @@ class InputChoice(InputBaseClass):
@_input_conversion
def set_value(self, value):
if value is None:
if len(self._values) > 0:
# activate the first item as the default
self.control.set_active(0)
else:
self.control.set_active(-1)
else:
if value in self._values:
......
......@@ -102,8 +102,7 @@ class ProcessStrategyContour(pycam.Plugins.PluginBase):
(low, high), process["parameters"]["step_down"],
line_distance=line_distance,
grid_direction=pycam.Toolpath.MotionGrid.GRID_DIRECTION_X,
milling_style=process["parameters"]["milling_style"],
start_position=(START_X | START_Z))
milling_style=process["parameters"]["milling_style"])
return path_generator, motion_grid, (low, high)
......@@ -176,6 +175,10 @@ class ProcessStrategyEngraving(pycam.Plugins.PluginBase):
path_generator = pycam.PathGenerators.EngraveCutter.EngraveCutter(
pycam.PathProcessors.SimpleCutter.SimpleCutter())
models = list(process["parameters"]["trace_models"])
if not models:
self.log.error("No trace models given: you need to assign a " + \
"2D model to the engraving process.")
return None, None, (None, None)
progress = self.core.get("progress")
if process["parameters"]["radius_compensation"]:
progress.update(text="Offsetting models")
......
......@@ -48,6 +48,15 @@ class TaskTypeMilling(pycam.Plugins.PluginBase):
environment = {}
for key in task["parameters"]:
environment[key] = task["parameters"][key]
if environment["tool"] is None:
self.log.error("You need to assign a tool to this task.")
return
if environment["process"] is None:
self.log.error("You need to assign a process to this task.")
return
if environment["bounds"] is None:
self.log.error("You need to assign bounds to this task.")
return
funcs = {}
for key, set_name in (("tool", "shape"), ("process", "strategy")):
funcs[key] = self.core.get("get_parameter_sets")(
......@@ -55,6 +64,9 @@ class TaskTypeMilling(pycam.Plugins.PluginBase):
tool = funcs["tool"](tool=environment["tool"], environment=environment)
path_generator, motion_grid, (low, high) = funcs["process"](
environment["process"], environment=environment)
if path_generator is None:
# we assume that an error message was given already
return
models = task["parameters"]["collision_models"]
moves = path_generator.GenerateToolPath(tool, models, motion_grid,
minz=low[2], maxz=high[2], draw_callback=callback)
......
......@@ -133,6 +133,7 @@ class Toolpaths(pycam.Plugins.ListPluginBase):
self.tp_box.hide()
else:
self.tp_box.show()
self._trigger_toolpath_time_update()
def _trigger_toolpath_time_update(self):
self.gui.get_object("ToolpathTimeColumn").set_cell_data_func(
......
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