Commit fc7cf235 authored by sumpfralle's avatar sumpfralle

GTK user interface change:

 * separate tool and process settings
 * a task is a combination of a tool and a process
 * manage list of tasks
 * allow batch generation of multiple toolpaths


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@272 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 5b884382
Version 0.2.3 - UNRELEASED Version 0.2.3 - UNRELEASED
* GUI change: tool and process settings can be combined into tasks
* fixed "overlap" calculation * fixed "overlap" calculation
* added a warning dialog (GUI) for missing dependencies during startup (especially useful for Windows) * added a warning dialog (GUI) for missing dependencies during startup (especially useful for Windows)
* prevent invalid input values (zero tool radius, ...)
* reduced memory consumption of toolpaths for python 2.6 or above
Version 0.2.2 - 2010-03-17 Version 0.2.2 - 2010-03-17
* added a graphical installer for Windows (via distutils) * added a graphical installer for Windows (via distutils)
......
...@@ -408,7 +408,6 @@ class ProjectGui: ...@@ -408,7 +408,6 @@ class ProjectGui:
gtk.accel_map_change_entry(accel_path, key, mod, True) gtk.accel_map_change_entry(accel_path, key, mod, True)
# other events # other events
self.window.connect("destroy", self.destroy) self.window.connect("destroy", self.destroy)
self.gui.get_object("GenerateToolPathButton").connect("clicked", self.generate_toolpath)
# the settings window # the settings window
self.gui.get_object("CloseSettingsWindow").connect("clicked", self.toggle_settings_window, False) self.gui.get_object("CloseSettingsWindow").connect("clicked", self.toggle_settings_window, False)
self.settings_window = self.gui.get_object("GeneralSettingsWindow") self.settings_window = self.gui.get_object("GeneralSettingsWindow")
...@@ -427,6 +426,9 @@ class ProjectGui: ...@@ -427,6 +426,9 @@ class ProjectGui:
self.toolpath = GuiCommon.ToolPathList() self.toolpath = GuiCommon.ToolPathList()
self._physics_cache = None self._physics_cache = None
self.cutter = None self.cutter = None
self.process_settings_list = []
self.tool_list = []
self.task_list = []
# add some dummies - to be implemented later ... # add some dummies - to be implemented later ...
self.settings.add_item("model", lambda: self.model) self.settings.add_item("model", lambda: self.model)
self.settings.add_item("toolpath", lambda: self.toolpath) self.settings.add_item("toolpath", lambda: self.toolpath)
...@@ -457,17 +459,6 @@ class ProjectGui: ...@@ -457,17 +459,6 @@ class ProjectGui:
self.gui.get_object("Scale up").connect("clicked", self.scale_model, True) self.gui.get_object("Scale up").connect("clicked", self.scale_model, True)
self.gui.get_object("Scale down").connect("clicked", self.scale_model, False) self.gui.get_object("Scale down").connect("clicked", self.scale_model, False)
self.gui.get_object("Scale factor").set_value(2) self.gui.get_object("Scale factor").set_value(2)
# drill, path and processing settings
for objname, key in (("MaterialAllowanceControl", "material_allowance"),
("MaxStepDownControl", "step_down"),
("OverlapPercentControl", "overlap"),
("ToolRadiusControl", "tool_radius"),
("TorusRadiusControl", "torus_radius"),
("FeedrateControl", "feedrate"),
("SpeedControl", "speed"),
("SafetyHeightControl", "safety_height")):
obj = self.gui.get_object(objname)
self.settings.add_item(key, obj.get_value, obj.set_value)
# visual and general settings # visual and general settings
for name, objname in (("show_model", "ShowModelCheckBox"), for name, objname in (("show_model", "ShowModelCheckBox"),
("show_axes", "ShowAxesCheckBox"), ("show_axes", "ShowAxesCheckBox"),
...@@ -534,89 +525,84 @@ class ProjectGui: ...@@ -534,89 +525,84 @@ class ProjectGui:
skip_obj = self.gui.get_object("DrillProgressFrameSkipControl") skip_obj = self.gui.get_object("DrillProgressFrameSkipControl")
self.settings.add_item("drill_progress_max_fps", skip_obj.get_value, skip_obj.set_value) self.settings.add_item("drill_progress_max_fps", skip_obj.get_value, skip_obj.set_value)
self.settings.set("drill_progress_max_fps", 2) self.settings.set("drill_progress_max_fps", 2)
# cutter shapes # drill settings
def get_cutter_shape_name(): for objname, key in (
for name in ("SphericalCutter", "CylindricalCutter", "ToroidalCutter"): ("ToolRadiusControl", "tool_radius"),
if self.gui.get_object(name).get_active(): ("TorusRadiusControl", "torus_radius"),
return name ("FeedrateControl", "feedrate"),
def set_cutter_shape_name(value): ("SpeedControl", "speed")):
self.gui.get_object(value).set_active(True) self.gui.get_object(objname).connect("changed", self.handle_tool_settings_change)
self.settings.add_item("cutter_shape", get_cutter_shape_name, set_cutter_shape_name) for name in ("SphericalCutter", "CylindricalCutter", "ToroidalCutter"):
# path generator self.gui.get_object(name).connect("clicked", self.handle_tool_settings_change)
def get_path_generator(): self.gui.get_object("ToolName").connect("changed", self.handle_tool_settings_change)
for name in ("DropCutter", "PushCutter"): # speed and feedrate controls
if self.gui.get_object(name).get_active(): speed_control = self.gui.get_object("SpeedControl")
return name feedrate_control = self.gui.get_object("FeedrateControl")
def set_path_generator(value): # connect the "consistency check" and the update-handler with all toolpath settings
self.gui.get_object(value).set_active(True)
self.settings.add_item("path_generator", get_path_generator, set_path_generator)
# path postprocessor
def get_path_postprocessor():
for name in ("PathAccumulator", "SimpleCutter", "ZigZagCutter", "PolygonCutter", "ContourCutter"):
if self.gui.get_object(name).get_active():
return name
def set_path_postprocessor(value):
self.gui.get_object(value).set_active(True)
self.settings.add_item("path_postprocessor", get_path_postprocessor, set_path_postprocessor)
# path direction (combined get/set function)
def set_get_path_direction(input=None):
for obj, value in (("PathDirectionX", "x"), ("PathDirectionY", "y"), ("PathDirectionXY", "xy")):
if value == input:
self.gui.get_object(obj).set_active(True)
return
if self.gui.get_object(obj).get_active():
return value
self.settings.add_item("path_direction", set_get_path_direction, set_get_path_direction)
# connect the "consistency check" with all toolpath settings
for objname in ("PathAccumulator", "SimpleCutter", "ZigZagCutter", "PolygonCutter", "ContourCutter", for objname in ("PathAccumulator", "SimpleCutter", "ZigZagCutter", "PolygonCutter", "ContourCutter",
"DropCutter", "PushCutter", "PathDirectionX", "PathDirectionY", "PathDirectionXY", "SettingEnableODE"): "DropCutter", "PushCutter", "PathDirectionX", "PathDirectionY", "PathDirectionXY", "SettingEnableODE"):
self.gui.get_object(objname).connect("toggled", self.disable_invalid_toolpath_settings) self.gui.get_object(objname).connect("toggled", self.disable_invalid_process_settings)
for objname in ("SphericalCutter", "CylindricalCutter", "ToroidalCutter"): if objname != "SettingEnableODE":
self.gui.get_object(objname).connect("toggled", self.update_tool_selector) self.gui.get_object(objname).connect("toggled", self.handle_process_settings_change)
for objname in ("ToolRadiusControl", "TorusRadiusControl"): for objname in ("SafetyHeightControl", "OverlapPercentControl",
self.gui.get_object(objname).connect("value-changed", self.update_tool_selector) "MaterialAllowanceControl", "MaxStepDownControl"):
self.gui.get_object(objname).connect("changed", self.handle_process_settings_change)
self.gui.get_object("ProcessSettingName").connect("changed", self.handle_process_settings_change)
# load a processing configuration object # load a processing configuration object
self.processing_settings = pycam.Gui.Settings.ProcessingSettings(self.settings) self.processing_settings = pycam.Gui.Settings.ProcessingSettings(self.settings)
self.processing_config_selection = self.gui.get_object("ProcessingTemplatesList") self.process_settings_list = []
self.processing_config_selection.connect("changed", self.process_table = self.gui.get_object("ProcessListTable")
self.switch_processing_config, self.processing_config_selection.get_active) self.process_editor_table = self.gui.get_object("ProcessEditorWindowTable")
self.gui.get_object("ProcessingTemplateDelete").connect("clicked", self.process_editor_table.get_selection().connect("changed", self.switch_process_table_selection)
self.delete_processing_config, lambda: self.processing_config_selection.get_child().get_text()) process_editor_window = self.gui.get_object("ProcessEditorWindow")
self.gui.get_object("ProcessingTemplateSave").connect("clicked", process_editor_window.connect("delete-event", self.toggle_process_editor_window, False)
self.save_processing_config, lambda: self.processing_config_selection.get_child().get_text()) # set a minimum size - otherwise the window is too small for an empty table
process_editor_window.set_default_size(400, -1)
self.gui.get_object("ProcessEditorWindowOpen").connect("clicked", self.toggle_process_editor_window, True)
self.gui.get_object("ProcessEditorWindowClose").connect("clicked", self.toggle_process_editor_window, False)
self.gui.get_object("ProcessListMoveUp").connect("clicked", self.handle_process_table_event, "move_up")
self.gui.get_object("ProcessListMoveDown").connect("clicked", self.handle_process_table_event, "move_down")
self.gui.get_object("ProcessListAdd").connect("clicked", self.handle_process_table_event, "add")
self.gui.get_object("ProcessListDelete").connect("clicked", self.handle_process_table_event, "delete")
# progress bar and task pane # progress bar and task pane
self.progress_bar = self.gui.get_object("ProgressBar") self.progress_bar = self.gui.get_object("ProgressBar")
self.progress_widget = self.gui.get_object("ProgressWidget") self.progress_widget = self.gui.get_object("ProgressWidget")
self.task_pane = self.gui.get_object("Tasks") self.task_pane = self.gui.get_object("MainTabs")
self.gui.get_object("ProgressCancelButton").connect("clicked", self.cancel_progress) self.gui.get_object("ProgressCancelButton").connect("clicked", self.cancel_progress)
# make sure that the toolpath settings are consistent # make sure that the toolpath settings are consistent
self.toolpath_table = self.gui.get_object("ToolPathTable") self.toolpath_table = self.gui.get_object("ToolPathTable")
self.toolpath_table.get_selection().connect("changed", self.toolpath_table_event, "update_buttons") self.toolpath_table.get_selection().connect("changed", self.toolpath_table_event, "update_buttons")
self.gui.get_object("toolpath_visible").connect("toggled", self.toolpath_table_event, "toggle_visibility") self.gui.get_object("toolpath_visible").connect("toggled", self.toolpath_table_event, "toggle_visibility")
self.gui.get_object("toolpath_up").connect("clicked", self.toolpath_table_event, "move_up") self.gui.get_object("toolpath_up").connect("clicked", self.toolpath_table_event, "move_up")
self.gui.get_object("toolpath_delete").connect("clicked", self.toolpath_table_event, "delete")
self.gui.get_object("toolpath_down").connect("clicked", self.toolpath_table_event, "move_down") 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")
# store the original content (for adding the number of current toolpaths in "update_toolpath_table") # 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() self._original_toolpath_tab_label = self.gui.get_object("ToolPathTabLabel").get_text()
# tool editor # tool editor
self.tool_list = [] self.tool_table = self.gui.get_object("ToolListTable")
self.tool_editor_table = self.gui.get_object("ToolListTable") self.tool_editor_table = self.gui.get_object("ToolEditorWindowTable")
self.tool_selector = self.gui.get_object("ToolSelector") self.tool_editor_table.get_selection().connect("changed", self.switch_tool_editor_table_selection)
self.tool_selector.connect("changed", self._tool_selector_changed_event) tool_editor_window = self.gui.get_object("ToolEditorWindow")
self.gui.get_object("ToolProperties").connect("clicked", self.toggle_tool_editor_window, True) tool_editor_window.set_default_size(400, -1)
tool_editor_window.connect("delete-event", self.toggle_tool_editor_window, False)
self.gui.get_object("ToolEditorWindowOpen").connect("clicked", self.toggle_tool_editor_window, True)
self.gui.get_object("ToolEditorWindowClose").connect("clicked", self.toggle_tool_editor_window, False) self.gui.get_object("ToolEditorWindowClose").connect("clicked", self.toggle_tool_editor_window, False)
self.tool_editor_table.get_selection().connect("changed", self._tool_editor_button_event, "update_buttons")
self.gui.get_object("ToolEditorDelete").connect("clicked", self._tool_editor_button_event, "delete")
self.gui.get_object("ToolEditorImport").connect("clicked", self._tool_editor_button_event, "import")
self.gui.get_object("ToolEditorExport").connect("clicked", self._tool_editor_button_event, "export")
self.gui.get_object("ToolEditorMoveUp").connect("clicked", self._tool_editor_button_event, "move_up") self.gui.get_object("ToolEditorMoveUp").connect("clicked", self._tool_editor_button_event, "move_up")
self.gui.get_object("ToolEditorMoveDown").connect("clicked", self._tool_editor_button_event, "move_down") self.gui.get_object("ToolEditorMoveDown").connect("clicked", self._tool_editor_button_event, "move_down")
self.gui.get_object("ToolEditorAdd").connect("clicked", self._tool_editor_button_event, "add") self.gui.get_object("ToolEditorAdd").connect("clicked", self._tool_editor_button_event, "add")
# speed and feedrate controls self.gui.get_object("ToolEditorDelete").connect("clicked", self._tool_editor_button_event, "delete")
speed_control = self.gui.get_object("SpeedControl") # the task list manager
self.settings.add_item("speed", speed_control.get_value, speed_control.set_value) self.tasklist_table = self.gui.get_object("TaskListTable")
feedrate_control = self.gui.get_object("FeedrateControl") self.tasklist_table.get_selection().connect("changed", self.update_tasklist_controls)
self.settings.add_item("feedrate", feedrate_control.get_value, feedrate_control.set_value) self.tool_table.get_selection().connect("changed", self.update_tasklist_controls)
self.process_table.get_selection().connect("changed", self.update_tasklist_controls)
self.gui.get_object("tasklist_enabled").connect("toggled", self._handle_tasklist_button_event, "toggle_enabled")
self.gui.get_object("TaskListMoveUp").connect("clicked", self._handle_tasklist_button_event, "move_up")
self.gui.get_object("TaskListMoveDown").connect("clicked", self._handle_tasklist_button_event, "move_down")
self.gui.get_object("TaskListAdd").connect("clicked", self._handle_tasklist_button_event, "add")
self.gui.get_object("TaskListDelete").connect("clicked", self._handle_tasklist_button_event, "delete")
self.gui.get_object("GenerateToolPathButton").connect("clicked", self._handle_tasklist_button_event, "generate_one_toolpath")
self.gui.get_object("GenerateAllToolPathsButton").connect("clicked", self._handle_tasklist_button_event, "generate_all_toolpaths")
# menu bar # menu bar
uimanager = gtk.UIManager() uimanager = gtk.UIManager()
self._accel_group = uimanager.get_accel_group() self._accel_group = uimanager.get_accel_group()
...@@ -642,9 +628,12 @@ class ProjectGui: ...@@ -642,9 +628,12 @@ class ProjectGui:
# some more initialization # some more initialization
self.processing_settings.enable_config() self.processing_settings.enable_config()
self.update_toolpath_table() self.update_toolpath_table()
self.update_tool_editor() self.update_tool_table()
self.update_tool_selector() self.update_tool_controls()
self.disable_invalid_toolpath_settings() self.disable_invalid_process_settings()
self.update_process_table()
self.update_tasklist_table()
self.update_tasklist_controls()
self.load_processing_settings() self.load_processing_settings()
self.update_save_actions() self.update_save_actions()
self.update_unit_labels() self.update_unit_labels()
...@@ -658,9 +647,10 @@ class ProjectGui: ...@@ -658,9 +647,10 @@ class ProjectGui:
self._progress_running = True self._progress_running = True
self._progress_cancel_requested = False self._progress_cancel_requested = False
self.toggle_progress_bar(True) self.toggle_progress_bar(True)
func(self, *args, **kwargs) result = func(self, *args, **kwargs)
self.toggle_progress_bar(False) self.toggle_progress_bar(False)
self._progress_running = False self._progress_running = False
return result
return wrapper return wrapper
def gui_activity_guard(func): def gui_activity_guard(func):
...@@ -694,44 +684,162 @@ class ProjectGui: ...@@ -694,44 +684,162 @@ class ProjectGui:
self.gui.get_object("SaveProcessingTemplates").set_sensitive(not self.last_config_file is None) self.gui.get_object("SaveProcessingTemplates").set_sensitive(not self.last_config_file is None)
self.gui.get_object("SaveModel").set_sensitive(not self.last_model_file is None) self.gui.get_object("SaveModel").set_sensitive(not self.last_model_file is None)
def disable_invalid_toolpath_settings(self, widget=None, data=None): def update_tasklist_controls(self, widget=None, data=None):
# check if both the tool and the process table have a selected row
all_are_active = True
for control in (self.tool_table, self.process_table):
if control.get_selection().get_selected()[1] is None:
all_are_active = False
self.gui.get_object("TaskListAdd").set_sensitive(all_are_active)
# en/disable some buttons
index = self._treeview_get_active_index(self.tasklist_table, self.task_list)
selection_active = not index is None
self.gui.get_object("TaskListDelete").set_sensitive(selection_active)
self.gui.get_object("TaskListMoveUp").set_sensitive(selection_active and index > 0)
self.gui.get_object("TaskListMoveDown").set_sensitive(selection_active and index < len(self.task_list) - 1)
self.gui.get_object("GenerateToolPathButton").set_sensitive(selection_active)
# check if any of the tasks is marked as "enabled"
enabled_count = len([True for task in self.task_list if task["enabled"]])
self.gui.get_object("GenerateAllToolPathsButton").set_sensitive(enabled_count > 0)
# update the task description
lines = []
task_index = self._treeview_get_active_index(self.tasklist_table, self.task_list)
if not task_index is None:
task = self.task_list[task_index]
tool = task["tool"]
process = task["process"]
unit = self.settings.get("unit")
tool_desc = "Tool: %s " % tool["shape"]
if tool["shape"] != "ToroidalCutter":
tool_desc += "(%.4f%s)" % (tool["tool_radius"], unit)
else:
tool_desc += "(%.4f%s / %.4f%s)" % (tool["tool_radius"], unit, tool["torus_radius"], unit)
lines.append(tool_desc)
lines.append("Speed: %d/minute / Feedrate: %d%s/minute" % (tool["speed"], tool["feedrate"], unit))
lines.append("Path: %s / %s" % (process["path_generator"], process["path_postprocessor"]))
lines.append("Overlap: %d%%" % process["overlap"])
lines.append("Material allowance: %.2f%s" % (process["material_allowance"], unit))
if process["path_generator"] == "PushCutter":
lines.append("Maximum step down: %.2f%s" % (process["step_down"], unit))
else:
lines.append("No task selected")
self.gui.get_object("CurrentTaskSummary").set_text(os.linesep.join(lines))
def update_tasklist_table(self, new_index=None, skip_model_update=False):
tasklist_model = self.gui.get_object("TaskList")
if new_index is None:
# keep the old selection - this may return "None" if nothing is selected
new_index = self._treeview_get_active_index(self.tasklist_table, self.task_list)
if not skip_model_update:
tasklist_model.clear()
# remove broken tasks from the list (tool or process was deleted)
self.task_list = [task for task in self.task_list
if (task["tool"] in self.tool_list) and (task["process"] in self.process_settings_list)]
counter = 0
for task in self.task_list:
tasklist_model.append((counter, task["tool"]["name"], task["process"]["name"], task["enabled"]))
counter += 1
if not new_index is None:
self._treeview_set_active_index(self.tasklist_table, new_index)
self.update_tasklist_controls()
@gui_activity_guard
def _handle_tasklist_button_event(self, widget, data, action=None):
# "toggle" uses two parameters - all other actions have only one
if action is None:
action = data
# get the index of the currently selected task
try:
current_task_index = self._treeview_get_active_index(self.tasklist_table, self.task_list)
except ValueError:
current_task_index = None
self._treeview_button_event(self.tasklist_table, self.task_list, action, self.update_tasklist_table)
if action == "add":
tool_index = self._treeview_get_active_index(self.tool_table, self.tool_list)
process_index = self._treeview_get_active_index(self.process_table, self.process_settings_list)
new_task = {}
new_task["tool"] = self.tool_list[tool_index]
new_task["process"] = self.process_settings_list[process_index]
new_task["enabled"] = True
self.task_list.append(new_task)
self.update_tasklist_table(self.task_list.index(new_task))
elif action == "toggle_enabled":
if (not current_task_index is None) and (current_task_index < len(self.task_list)):
self.task_list[current_task_index]["enabled"] = not self.task_list[current_task_index]["enabled"]
# update the table values
self.update_tasklist_table(current_task_index)
elif action == "generate_all_toolpaths":
enabled_tasks = []
for index in range(len(self.task_list)):
task = self.task_list[index]
if task["enabled"]:
enabled_tasks.append(task)
progress_bar = self.gui.get_object("MultipleProgressBar")
progress_bar.show()
for index in range(len(enabled_tasks)):
progress_bar.set_fraction(float(index) / len(enabled_tasks))
progress_bar.set_text("Toolpath %d/%d" % (index, len(enabled_tasks)))
task = enabled_tasks[index]
if not self.generate_toolpath(task["tool"], task["process"]):
# break out of the loop, if cancel was requested
break
progress_bar.hide()
elif action == "generate_one_toolpath":
task = self.task_list[current_task_index]
self.generate_toolpath(task["tool"], task["process"])
else:
pass
def disable_invalid_process_settings(self, widget=None, data=None):
# possible dependencies of the DropCutter # possible dependencies of the DropCutter
if self.settings.get("path_generator") == "DropCutter": get_obj = lambda name: self.gui.get_object(name)
if self.settings.get("path_direction") == "xy": if get_obj("DropCutter").get_active():
self.settings.set("path_direction", "x") if get_obj("PathDirectionXY").get_active():
if not self.settings.get("path_postprocessor") in ("PathAccumulator", "ZigZagCutter"): get_obj("PathDirectionX").set_active(True)
self.settings.set("path_postprocessor", "PathAccumulator") if not (get_obj("PathAccumulator").get_active() or get_obj("ZigZagCutter").get_active()):
get_obj("PathAccumulator").set_active(True)
dropcutter_active = True dropcutter_active = True
else: else:
# PushCutter
if not (get_obj("SimpleCutter").get_active() \
or get_obj("PolygonCutter").get_active() \
or get_obj("ContourCutter").get_active()):
get_obj("SimpleCutter").set_active(True)
dropcutter_active = False dropcutter_active = False
for objname in ("PathDirectionXY", "SimpleCutter", "PolygonCutter", "ContourCutter"): for objname in ("PathDirectionXY", "SimpleCutter", "PolygonCutter", "ContourCutter"):
self.gui.get_object(objname).set_sensitive(not dropcutter_active) self.gui.get_object(objname).set_sensitive(not dropcutter_active)
self.gui.get_object("PathDirectionXY").set_sensitive(not dropcutter_active) for objname in ("PathAccumulator", "ZigZagCutter"):
# disable the dropcutter, if "xy" or one of "SimpleCutter", "PolygonCutter", "ContourCutter" is enabled self.gui.get_object(objname).set_sensitive(dropcutter_active)
if (self.settings.get("path_postprocessor") in ("SimpleCutter", "PolygonCutter", "ContourCutter")) \
or (self.settings.get("path_direction") == "xy"):
self.gui.get_object("DropCutter").set_sensitive(False)
else:
self.gui.get_object("DropCutter").set_sensitive(True)
# disable "step down" control, if PushCutter is not active # disable "step down" control, if PushCutter is not active
self.gui.get_object("MaxStepDownControl").set_sensitive(self.settings.get("path_generator") == "PushCutter") self.gui.get_object("MaxStepDownControl").set_sensitive(get_obj("PushCutter").get_active())
# "material allowance" requires ODE support # "material allowance" requires ODE support
self.gui.get_object("MaterialAllowanceControl").set_sensitive(self.settings.get("enable_ode")) self.gui.get_object("MaterialAllowanceControl").set_sensitive(self.settings.get("enable_ode"))
def update_tool_controls(self, widget=None, data=None): def update_tool_controls(self, widget=None, data=None):
# disable the toroidal radius if the toroidal cutter is not enabled # disable the toroidal radius if the toroidal cutter is not enabled
self.gui.get_object("TorusRadiusControl").set_sensitive(self.settings.get("cutter_shape") == "ToroidalCutter") is_torus_shape = self.gui.get_object("ToroidalCutter").get_active()
self.gui.get_object("TorusRadiusControl").set_sensitive(is_torus_shape)
for objname, default_value in (("ToolRadiusControl", 1.0),
("TorusRadiusControl", 0.25),
("SpeedControl", 1000),
("FeedrateControl", 200)):
obj = self.gui.get_object(objname)
if obj.get_value() == 0:
# set the value to the configured minimum
obj.set_value(default_value)
@gui_activity_guard @gui_activity_guard
def toggle_about_window(self, widget=None, event=None, state=None): def toggle_about_window(self, widget=None, event=None, state=None):
# only "delete-event" uses four arguments
# TODO: unify all these "toggle" functions for different windows into one single function (including storing the position)
if state is None: if state is None:
# the "delete-event" issues the additional "event" argument
state = event state = event
if state: if state:
self.about_window.show() self.about_window.show()
else: else:
self.about_window.hide() self.about_window.hide()
# don't close the window - just hide it # don't close the window - just hide it (for "delete-event")
return True return True
@gui_activity_guard @gui_activity_guard
...@@ -749,7 +857,35 @@ class ProjectGui: ...@@ -749,7 +857,35 @@ class ProjectGui:
self._settings_window_position = self.settings_window.get_position() self._settings_window_position = self.settings_window.get_position()
self.settings_window.hide() self.settings_window.hide()
self._settings_window_visible = state self._settings_window_visible = state
# don't close the window - just hide it # don't close the window - just hide it (for "delete-event")
return True
def toggle_tool_editor_window(self, widget=None, event=None, state=None):
# only "delete-event" uses four arguments
if state is None:
state = event
if state:
tool_index = self._treeview_get_active_index(self.tool_table, self.tool_list)
if not tool_index is None:
self._treeview_set_active_index(self.tool_editor_table, tool_index)
self.gui.get_object("ToolEditorWindow").show()
else:
self.gui.get_object("ToolEditorWindow").hide()
# don't close the window - just hide it (for "delete-event")
return True
def toggle_process_editor_window(self, widget=None, event=None, state=None):
# only "delete-event" uses four arguments
if state is None:
state = event
if state:
process_index = self._treeview_get_active_index(self.process_table, self.process_settings_list)
if not process_index is None:
self._treeview_set_active_index(self.process_editor_table, process_index)
self.gui.get_object("ProcessEditorWindow").show()
else:
self.gui.get_object("ProcessEditorWindow").hide()
# don't close the window - just hide it (for "delete-event")
return True return True
@gui_activity_guard @gui_activity_guard
...@@ -803,12 +939,6 @@ class ProjectGui: ...@@ -803,12 +939,6 @@ class ProjectGui:
GuiCommon.transform_model(self.model, value) GuiCommon.transform_model(self.model, value)
self.update_view() self.update_view()
def toggle_tool_editor_window(self, widget=None, state=False):
if state:
self.gui.get_object("ToolWindow").show()
else:
self.gui.get_object("ToolWindow").hide()
def _treeview_get_active_index(self, table, datalist): def _treeview_get_active_index(self, table, datalist):
if len(datalist) == 0: if len(datalist) == 0:
result = None result = None
...@@ -862,64 +992,72 @@ class ProjectGui: ...@@ -862,64 +992,72 @@ class ProjectGui:
pass pass
update_func(new_index=future_selection_index, skip_model_update=skip_model_update) update_func(new_index=future_selection_index, skip_model_update=skip_model_update)
def _put_tool_settings_to_gui(self, settings):
self.gui.get_object("ToolName").set_text(settings["name"])
# cutter shapes
def set_cutter_shape_name(value):
self.gui.get_object(value).set_active(True)
set_cutter_shape_name(settings["shape"])
for objname, key in (
("ToolRadiusControl", "tool_radius"),
("TorusRadiusControl", "torus_radius"),
("FeedrateControl", "feedrate"),
("SpeedControl", "speed")):
self.gui.get_object(objname).set_value(settings[key])
def _load_tool_settings_from_gui(self, settings=None):
if settings is None:
settings = {}
settings["name"] = self.gui.get_object("ToolName").get_text()
def get_cutter_shape_name():
for name in ("SphericalCutter", "CylindricalCutter", "ToroidalCutter"):
if self.gui.get_object(name).get_active():
return name
settings["shape"] = get_cutter_shape_name()
for objname, key in (
("ToolRadiusControl", "tool_radius"),
("TorusRadiusControl", "torus_radius"),
("FeedrateControl", "feedrate"),
("SpeedControl", "speed")):
settings[key] = self.gui.get_object(objname).get_value()
return settings
@gui_activity_guard
def handle_tool_settings_change(self, widget=None, data=None):
current_index = self._treeview_get_active_index(self.tool_editor_table, self.tool_list)
if not current_index is None:
self._load_tool_settings_from_gui(self.tool_list[current_index])
self.update_tool_table()
self.update_tool_controls()
@gui_activity_guard
def switch_tool_editor_table_selection(self, widget=None, data=None):
new_index = self._treeview_get_active_index(self.tool_editor_table, self.tool_list)
if not new_index is None:
self._put_tool_settings_to_gui(self.tool_list[new_index])
self.update_tool_controls()
@gui_activity_guard @gui_activity_guard
def _tool_editor_button_event(self, widget, data, action=None): def _tool_editor_button_event(self, widget, data, action=None):
# "toggle" uses two parameters - all other actions have only one # "toggle" uses two parameters - all other actions have only one
if action is None: if action is None:
action = data action = data
current_index = self._treeview_get_active_index(self.tool_editor_table, self.tool_list) self._treeview_button_event(self.tool_editor_table, self.tool_list, action, self.update_tool_table)
override_index = None override_index = None
if action == "export": if action == "add":
if (not current_index is None) and (0 <= current_index < len(self.tool_list)): # look for the first unused default name
tool = self.tool_list[current_index] prefix = "New Tool "
# transfer the cutter attributes to the current session index = 1
self.set_current_tool(tool) # loop while the current name is in use
elif (action == "import") or (action == "add"): while [True for process in self.tool_list if process["name"] == "%s%d" % (prefix, index)]:
cutter = self.get_current_tool() index += 1
if action == "add": new_settings = self._load_tool_settings_from_gui()
if (current_index is None) or (current_index + 1 >= len(self.tool_list)): new_settings["name"] = "%s%d" % (prefix, index)
self.tool_list.append(cutter) self.tool_list.append(new_settings)
current_index = len(self.tool_list) - 1 self.update_tool_table(self.tool_list.index(new_settings))
else: self._put_tool_settings_to_gui(new_settings)
current_index += 1
self.tool_list.insert(current_index, cutter) def update_tool_table(self, new_index=None, skip_model_update=False):
override_index = current_index
else:
if (not current_index is None) and (0 <= current_index < len(self.tool_list)):
self.tool_list[current_index] = cutter
else:
pass
length_before = len(self.tool_list)
self._treeview_button_event(self.tool_editor_table, self.tool_list, action, self.update_tool_editor)
length_after = len(self.tool_list)
current_index = self._treeview_get_active_index(self.tool_editor_table, self.tool_list)
if not override_index is None:
self._treeview_set_active_index(self.tool_editor_table, override_index)
# update the button states - especially after adding the first tool
self.update_tool_editor(new_index=None, skip_model_update=True)
self.update_tool_selector()
def _tool_selector_changed_event(self, widget=None, data=None):
index = self.tool_selector.get_active()
if index >= 0:
self.set_current_tool(self.tool_list[index])
self.update_tool_controls()
def update_tool_selector(self, widget=None, data=None):
selector_index = self.tool_selector.get_active()
current_tool = self.get_current_tool()
if (selector_index < 0) or (current_tool != self.tool_list[selector_index]):
# invalid index for "no selection"
result = -1
# look for the next suitable tool
for one_tool in self.tool_list:
if one_tool == current_tool:
result = self.tool_list.index(one_tool)
break
self.tool_selector.set_active(result)
self.update_tool_controls()
def update_tool_editor(self, new_index=None, skip_model_update=False):
tool_model = self.gui.get_object("ToolList") tool_model = self.gui.get_object("ToolList")
if new_index is None: if new_index is None:
# keep the old selection - this may return "None" if nothing is selected # keep the old selection - this may return "None" if nothing is selected
...@@ -928,27 +1066,22 @@ class ProjectGui: ...@@ -928,27 +1066,22 @@ class ProjectGui:
tool_model.clear() tool_model.clear()
counter = 0 counter = 0
for tool in self.tool_list: for tool in self.tool_list:
# the drill string is something like: "ToroidalCutter<%s,%f,R=%f,r=%f>" tool_model.append((counter, counter + 1, tool["name"]))
# we want to omit the location and improve the formatting
# remove the location ("Point<...>")
short_name = re.sub("<[^>]*>", "", str(tool))
try:
name, attribs = short_name.split(",", 1)
except ValueError:
name, attribs = short_name, ""
attribs = attribs.rstrip(">").replace(",", " / ")
description = "%s (%s)" % (name, attribs)
tool_model.append((counter, counter + 1, description))
counter += 1 counter += 1
if not new_index is None: if not new_index is None:
self._treeview_set_active_index(self.tool_editor_table, new_index) self._treeview_set_active_index(self.tool_editor_table, new_index)
# en/disable some buttons # en/disable some buttons
selection_active = not new_index is None selection_active = not new_index is None
self.gui.get_object("ToolEditorDelete").set_sensitive(selection_active) self.gui.get_object("ToolEditorDelete").set_sensitive(selection_active)
self.gui.get_object("ToolEditorImport").set_sensitive(selection_active)
self.gui.get_object("ToolEditorExport").set_sensitive(selection_active)
self.gui.get_object("ToolEditorMoveUp").set_sensitive(selection_active and new_index > 0) self.gui.get_object("ToolEditorMoveUp").set_sensitive(selection_active and new_index > 0)
self.gui.get_object("ToolEditorMoveDown").set_sensitive(selection_active and new_index < len(self.tool_list) - 1) self.gui.get_object("ToolEditorMoveDown").set_sensitive(selection_active and new_index < len(self.tool_list) - 1)
# hide all controls if no process is defined
if new_index is None:
self.gui.get_object("ToolSettingsControlsBox").hide()
else:
self.gui.get_object("ToolSettingsControlsBox").show()
# remove any broken tasks and update changed names
self.update_tasklist_table()
def update_unit_labels(self, widget=None, data=None): def update_unit_labels(self, widget=None, data=None):
# we can't just use the "unit" setting, since we need the plural of "inch" # we can't just use the "unit" setting, since we need the plural of "inch"
...@@ -1121,26 +1254,9 @@ class ProjectGui: ...@@ -1121,26 +1254,9 @@ class ProjectGui:
# load the default config # load the default config
self.processing_settings.enable_config() self.processing_settings.enable_config()
# reset the combobox # reset the combobox
self.processing_config_selection.get_model().clear() #self.processing_config_selection.get_model().clear()
for config_name in self.processing_settings.get_config_list(): #for config_name in self.processing_settings.get_config_list():
self.processing_config_selection.append_text(config_name) # self.processing_config_selection.append_text(config_name)
def switch_processing_config(self, widget=None, section=None):
if callable(section):
section = section()
if section is None:
return
if isinstance(section, basestring):
# a template may be choosen as a string via the commandline
if not section in self.processing_settings.get_config_list():
section = None
elif section == -1:
section = None
else:
section = self.processing_settings.get_config_list()[section]
if not section is None:
self.processing_settings.enable_config(section)
self._visually_enable_specific_processing_config(section)
def delete_processing_config(self, widget=None, section=None): def delete_processing_config(self, widget=None, section=None):
if callable(section): if callable(section):
...@@ -1168,6 +1284,118 @@ class ProjectGui: ...@@ -1168,6 +1284,118 @@ class ProjectGui:
if section != current_text: if section != current_text:
self.processing_config_selection.get_child().set_text(section) self.processing_config_selection.get_child().set_text(section)
def _load_process_settings_from_gui(self, settings=None):
if settings is None:
settings = {}
settings["name"] = self.gui.get_object("ProcessSettingName").get_text()
# path generator
def get_path_generator():
for name in ("DropCutter", "PushCutter"):
if self.gui.get_object(name).get_active():
return name
settings["path_generator"] = get_path_generator()
# path direction
def get_path_direction():
for obj, value in (("PathDirectionX", "x"), ("PathDirectionY", "y"), ("PathDirectionXY", "xy")):
if self.gui.get_object(obj).get_active():
return value
settings["path_direction"] = get_path_direction()
def get_path_postprocessor():
for name in ("PathAccumulator", "SimpleCutter", "ZigZagCutter", "PolygonCutter", "ContourCutter"):
if self.gui.get_object(name).get_active():
return name
settings["path_postprocessor"] = get_path_postprocessor()
for objname, key in (("SafetyHeightControl", "safety_height"),
("OverlapPercentControl", "overlap"),
("MaterialAllowanceControl", "material_allowance"),
("MaxStepDownControl", "step_down")):
settings[key] = self.gui.get_object(objname).get_value()
return settings
def _put_process_settings_to_gui(self, settings):
self.gui.get_object("ProcessSettingName").set_text(settings["name"])
def set_path_generator(value):
self.gui.get_object(value).set_active(True)
set_path_generator(settings["path_generator"])
# path direction
def set_path_direction(input):
for obj, value in (("PathDirectionX", "x"), ("PathDirectionY", "y"), ("PathDirectionXY", "xy")):
if value == input:
self.gui.get_object(obj).set_active(True)
return
set_path_direction(settings["path_direction"])
# path postprocessor
def set_path_postprocessor(value):
self.gui.get_object(value).set_active(True)
set_path_postprocessor(settings["path_postprocessor"])
for objname, key in (("SafetyHeightControl", "safety_height"),
("OverlapPercentControl", "overlap"),
("MaterialAllowanceControl", "material_allowance"),
("MaxStepDownControl", "step_down")):
self.gui.get_object(objname).set_value(settings[key])
@gui_activity_guard
def handle_process_settings_change(self, widget=None, data=None):
current_index = self._treeview_get_active_index(self.process_editor_table, self.process_settings_list)
if not current_index is None:
self._load_process_settings_from_gui(self.process_settings_list[current_index])
self.update_process_table()
def update_process_table(self, new_index=None, skip_model_update=False):
# reset the model data and the selection
if new_index is None:
# keep the old selection - this may return "None" if nothing is selected
new_index = self._treeview_get_active_index(self.process_editor_table, self.process_settings_list)
if not skip_model_update:
# update the TreeModel data
model = self.gui.get_object("ProcessList")
model.clear()
# columns: index, description
for index in range(len(self.process_settings_list)):
process = self.process_settings_list[index]
items = (index, process["name"])
model.append(items)
if not new_index is None:
self._treeview_set_active_index(self.process_editor_table, new_index)
# enable/disable the modification buttons
self.gui.get_object("ProcessListMoveUp").set_sensitive((not new_index is None) and (new_index > 0))
self.gui.get_object("ProcessListDelete").set_sensitive(not new_index is None)
self.gui.get_object("ProcessListMoveDown").set_sensitive((not new_index is None) and (new_index + 1 < len(self.process_settings_list)))
# hide all controls if no process is defined
if new_index is None:
self.gui.get_object("ProcessSettingsControlsBox").hide()
else:
self.gui.get_object("ProcessSettingsControlsBox").show()
# remove any broken tasks and update changed names
self.update_tasklist_table()
@gui_activity_guard
def switch_process_table_selection(self, widget=None, data=None):
new_index = self._treeview_get_active_index(self.process_editor_table, self.process_settings_list)
if not new_index is None:
self._put_process_settings_to_gui(self.process_settings_list[new_index])
self.update_process_table()
@gui_activity_guard
def handle_process_table_event(self, widget, data, action=None):
# "toggle" uses two parameters - all other actions have only one
if action is None:
action = data
self._treeview_button_event(self.process_editor_table, self.process_settings_list, action, self.update_process_table)
# do some post-processing ...
if action == "add":
# look for the first unused default name
prefix = "New Process "
index = 1
# loop while the current name is in use
while [True for process in self.process_settings_list if process["name"] == "%s%d" % (prefix, index)]:
index += 1
new_settings = self._load_process_settings_from_gui()
new_settings["name"] = "%s%d" % (prefix, index)
self.process_settings_list.append(new_settings)
self.update_process_table(self.process_settings_list.index(new_settings))
self._put_process_settings_to_gui(new_settings)
@gui_activity_guard @gui_activity_guard
def toolpath_table_event(self, widget, data, action=None): def toolpath_table_event(self, widget, data, action=None):
# "toggle" uses two parameters - all other actions have only one # "toggle" uses two parameters - all other actions have only one
...@@ -1240,44 +1468,29 @@ class ProjectGui: ...@@ -1240,44 +1468,29 @@ class ProjectGui:
if not self.processing_settings.write_to_file(filename) and not no_dialog: if not self.processing_settings.write_to_file(filename) and not no_dialog:
show_error_dialog(self.window, "Failed to save processing settings file") show_error_dialog(self.window, "Failed to save processing settings file")
def set_current_tool(self, tool): def get_tool_instance(self, tool_settings):
# transfer the cutter attributes to the current session
if isinstance(tool, pycam.Cutters.SphericalCutter):
cutter_shape = "SphericalCutter"
elif isinstance(tool, pycam.Cutters.CylindricalCutter):
cutter_shape = "CylindricalCutter"
elif isinstance(tool, pycam.Cutters.ToroidalCutter):
cutter_shape = "ToroidalCutter"
self.settings.set("torus_radius", tool.minorradius)
else:
cutter_shape = None
if cutter_shape:
self.settings.set("cutter_shape", cutter_shape)
self.settings.set("tool_radius", tool.radius)
def get_current_tool(self):
cutter_height = self.settings.get("maxz") - self.settings.get("minz") cutter_height = self.settings.get("maxz") - self.settings.get("minz")
if self.model: if self.model:
cutter_height = max(cutter_height, self.model.maxz - self.model.minz) cutter_height = max(cutter_height, self.model.maxz - self.model.minz)
# Due to some weirdness the height of the drill must be bigger than the object's size. # Due to some weirdness the height of the drill must be bigger than the object's size.
# Otherwise some collisions are not detected. # Otherwise some collisions are not detected.
cutter_height *= 4 cutter_height *= 4
cuttername = self.settings.get("cutter_shape") cuttername = tool_settings["shape"]
radius = self.settings.get("tool_radius") radius = tool_settings["tool_radius"]
if cuttername == "SphericalCutter": if cuttername == "SphericalCutter":
cutter = pycam.Cutters.SphericalCutter(radius, height=cutter_height) cutter = pycam.Cutters.SphericalCutter(radius, height=cutter_height)
elif cuttername == "CylindricalCutter": elif cuttername == "CylindricalCutter":
cutter = pycam.Cutters.CylindricalCutter(radius, height=cutter_height) cutter = pycam.Cutters.CylindricalCutter(radius, height=cutter_height)
elif cuttername == "ToroidalCutter": elif cuttername == "ToroidalCutter":
toroid = self.settings.get("torus_radius") toroid = tool_settings["torus_radius"]
cutter = pycam.Cutters.ToroidalCutter(radius, toroid, height=cutter_height) cutter = pycam.Cutters.ToroidalCutter(radius, toroid, height=cutter_height)
else: else:
pass pass
return cutter return cutter
def get_current_pathgenerator(self, cutter): def get_pathgenerator_instance(self, cutter, process_settings):
pathgenerator = self.settings.get("path_generator") pathgenerator = process_settings["path_generator"]
pathprocessor = self.settings.get("path_postprocessor") pathprocessor = process_settings["path_postprocessor"]
physics = self.get_physics(cutter) physics = self.get_physics(cutter)
if pathgenerator == "DropCutter": if pathgenerator == "DropCutter":
if pathprocessor == "ZigZagCutter": if pathprocessor == "ZigZagCutter":
...@@ -1325,9 +1538,8 @@ class ProjectGui: ...@@ -1325,9 +1538,8 @@ class ProjectGui:
def cancel_progress(self, widget=None): def cancel_progress(self, widget=None):
self._progress_cancel_requested = True self._progress_cancel_requested = True
@gui_activity_guard
@progress_activity_guard @progress_activity_guard
def generate_toolpath(self, widget=None, data=None): def generate_toolpath(self, tool_settings, process_settings):
start_time = time.time() start_time = time.time()
self.update_progress_bar("Preparing toolpath generation") self.update_progress_bar("Preparing toolpath generation")
parent = self parent = self
...@@ -1353,13 +1565,13 @@ class ProjectGui: ...@@ -1353,13 +1565,13 @@ class ProjectGui:
callback = None callback = None
draw_callback = UpdateView(callback, draw_callback = UpdateView(callback,
max_fps=self.settings.get("drill_progress_max_fps")).update max_fps=self.settings.get("drill_progress_max_fps")).update
direction = self.settings.get("path_direction") direction = process_settings["path_direction"]
self.update_progress_bar("Generating collision model") self.update_progress_bar("Generating collision model")
self.cutter = self.get_current_tool() self.cutter = self.get_tool_instance(tool_settings)
# this offset allows to cut a model with a minimal boundary box correctly # this offset allows to cut a model with a minimal boundary box correctly
offset = self.settings.get("tool_radius") / 2.0 offset = tool_settings["tool_radius"] / 2.0
minx = float(self.settings.get("minx"))-offset minx = float(self.settings.get("minx"))-offset
maxx = float(self.settings.get("maxx"))+offset maxx = float(self.settings.get("maxx"))+offset
...@@ -1368,15 +1580,15 @@ class ProjectGui: ...@@ -1368,15 +1580,15 @@ class ProjectGui:
minz = float(self.settings.get("minz")) minz = float(self.settings.get("minz"))
maxz = float(self.settings.get("maxz")) maxz = float(self.settings.get("maxz"))
effective_toolradius = self.settings.get("tool_radius") * (1.0 - self.settings.get("overlap")/100.0) effective_toolradius = tool_settings["tool_radius"] * (1.0 - process_settings["overlap"] / 100.0)
x_shift = effective_toolradius x_shift = effective_toolradius
y_shift = effective_toolradius y_shift = effective_toolradius
self.update_progress_bar("Starting the toolpath generation") self.update_progress_bar("Starting the toolpath generation")
pathgenerator = self.get_current_pathgenerator(self.cutter) pathgenerator = self.get_pathgenerator_instance(self.cutter, process_settings)
pathgenerator_name = self.settings.get("path_generator") pathgenerator_name = process_settings["path_generator"]
if pathgenerator_name == "DropCutter": if pathgenerator_name == "DropCutter":
dx = x_shift dx = x_shift
dy = y_shift dy = y_shift
...@@ -1386,13 +1598,13 @@ class ProjectGui: ...@@ -1386,13 +1598,13 @@ class ProjectGui:
toolpath = pathgenerator.GenerateToolPath(minx, maxx, miny, maxy, minz, maxz, dy, dx, 1, draw_callback) toolpath = pathgenerator.GenerateToolPath(minx, maxx, miny, maxy, minz, maxz, dy, dx, 1, draw_callback)
elif pathgenerator_name == "PushCutter": elif pathgenerator_name == "PushCutter":
if self.settings.get("path_postprocessor") == "ContourCutter": if process_settings["path_postprocessor"] == "ContourCutter":
dx = x_shift dx = x_shift
else: else:
dx = utils.INFINITE dx = utils.INFINITE
dy = y_shift dy = y_shift
if self.settings.get("step_down") > 0: if process_settings["step_down"] > 0:
dz = self.settings.get("step_down") dz = process_settings["step_down"]
else: else:
dz = utils.INFINITE dz = utils.INFINITE
if direction == "x": if direction == "x":
...@@ -1413,20 +1625,23 @@ class ProjectGui: ...@@ -1413,20 +1625,23 @@ class ProjectGui:
and self.toolpath[-1].visible: and self.toolpath[-1].visible:
self.toolpath[-1].visible = False self.toolpath[-1].visible = False
# add the new toolpath # add the new toolpath
description = "%s / %s" % (tool_settings["name"], process_settings["name"])
self.toolpath.add_toolpath(toolpath, self.toolpath.add_toolpath(toolpath,
self.processing_config_selection.get_active_text(), description,
self.cutter, self.cutter,
self.settings.get("speed"), tool_settings["speed"],
self.settings.get("feedrate"), tool_settings["feedrate"],
self.settings.get("material_allowance"), process_settings["material_allowance"],
self.settings.get("safety_height"), process_settings["safety_height"],
self.settings.get("unit"), self.settings.get("unit"),
minx, miny, maxz + start_offset) minx, miny, maxz + start_offset)
self.update_toolpath_table() self.update_toolpath_table()
self.update_view() self.update_view()
# return "False" if the action was cancelled
return not self._progress_cancel_requested
# for compatibility with old pycam GUI (see pycam_start.py) # for compatibility with old pycam GUI (see pycamGUI)
# TODO: remove it in v0.2 # TODO: remove it in v0.3
generateToolpath = generate_toolpath generateToolpath = generate_toolpath
def get_filename_via_dialog(self, title, mode_load=False, type_filter=None): def get_filename_via_dialog(self, title, mode_load=False, type_filter=None):
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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