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 @@ ...@@ -748,10 +748,9 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<child> <child>
<object class="GtkViewport" id="ModelsViewPort"> <object class="GtkVBox" id="ModelsViewPort">
<property name="visible">True</property> <property name="visible">True</property>
<property name="resize_mode">queue</property> <property name="orientation">vertical</property>
<property name="shadow_type">etched-out</property>
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
......
...@@ -112,6 +112,10 @@ class InputChoice(InputBaseClass): ...@@ -112,6 +112,10 @@ class InputChoice(InputBaseClass):
@_input_conversion @_input_conversion
def set_value(self, value): def set_value(self, value):
if value is None: 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) self.control.set_active(-1)
else: else:
if value in self._values: if value in self._values:
......
...@@ -102,8 +102,7 @@ class ProcessStrategyContour(pycam.Plugins.PluginBase): ...@@ -102,8 +102,7 @@ class ProcessStrategyContour(pycam.Plugins.PluginBase):
(low, high), process["parameters"]["step_down"], (low, high), process["parameters"]["step_down"],
line_distance=line_distance, line_distance=line_distance,
grid_direction=pycam.Toolpath.MotionGrid.GRID_DIRECTION_X, grid_direction=pycam.Toolpath.MotionGrid.GRID_DIRECTION_X,
milling_style=process["parameters"]["milling_style"], milling_style=process["parameters"]["milling_style"])
start_position=(START_X | START_Z))
return path_generator, motion_grid, (low, high) return path_generator, motion_grid, (low, high)
...@@ -176,6 +175,10 @@ class ProcessStrategyEngraving(pycam.Plugins.PluginBase): ...@@ -176,6 +175,10 @@ class ProcessStrategyEngraving(pycam.Plugins.PluginBase):
path_generator = pycam.PathGenerators.EngraveCutter.EngraveCutter( path_generator = pycam.PathGenerators.EngraveCutter.EngraveCutter(
pycam.PathProcessors.SimpleCutter.SimpleCutter()) pycam.PathProcessors.SimpleCutter.SimpleCutter())
models = list(process["parameters"]["trace_models"]) 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") progress = self.core.get("progress")
if process["parameters"]["radius_compensation"]: if process["parameters"]["radius_compensation"]:
progress.update(text="Offsetting models") progress.update(text="Offsetting models")
......
...@@ -48,6 +48,15 @@ class TaskTypeMilling(pycam.Plugins.PluginBase): ...@@ -48,6 +48,15 @@ class TaskTypeMilling(pycam.Plugins.PluginBase):
environment = {} environment = {}
for key in task["parameters"]: for key in task["parameters"]:
environment[key] = task["parameters"][key] 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 = {} funcs = {}
for key, set_name in (("tool", "shape"), ("process", "strategy")): for key, set_name in (("tool", "shape"), ("process", "strategy")):
funcs[key] = self.core.get("get_parameter_sets")( funcs[key] = self.core.get("get_parameter_sets")(
...@@ -55,6 +64,9 @@ class TaskTypeMilling(pycam.Plugins.PluginBase): ...@@ -55,6 +64,9 @@ class TaskTypeMilling(pycam.Plugins.PluginBase):
tool = funcs["tool"](tool=environment["tool"], environment=environment) tool = funcs["tool"](tool=environment["tool"], environment=environment)
path_generator, motion_grid, (low, high) = funcs["process"]( path_generator, motion_grid, (low, high) = funcs["process"](
environment["process"], environment=environment) environment["process"], environment=environment)
if path_generator is None:
# we assume that an error message was given already
return
models = task["parameters"]["collision_models"] models = task["parameters"]["collision_models"]
moves = path_generator.GenerateToolPath(tool, models, motion_grid, moves = path_generator.GenerateToolPath(tool, models, motion_grid,
minz=low[2], maxz=high[2], draw_callback=callback) minz=low[2], maxz=high[2], draw_callback=callback)
......
...@@ -133,6 +133,7 @@ class Toolpaths(pycam.Plugins.ListPluginBase): ...@@ -133,6 +133,7 @@ class Toolpaths(pycam.Plugins.ListPluginBase):
self.tp_box.hide() self.tp_box.hide()
else: else:
self.tp_box.show() self.tp_box.show()
self._trigger_toolpath_time_update()
def _trigger_toolpath_time_update(self): def _trigger_toolpath_time_update(self):
self.gui.get_object("ToolpathTimeColumn").set_cell_data_func( 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