From f7e0226621183f33f147c464926cda3d51fafede Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 28 Jan 2021 21:28:15 +0200 Subject: [PATCH] - fixed an issue in Tool Cutout - when using the thin gaps the 9999 tool number is not accepted by Mach3 --- CHANGELOG.md | 1 + appTools/ToolCutOut.py | 54 ++++++++++++++++++++--------------------- appTools/ToolMilling.py | 16 ++++++------ 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ebd6439..baed95df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ CHANGELOG for FlatCAM beta - working in Drilling Tool to make it more robust - Drilling Tool - fixed an issue with dropping the changes done in the UI - Drilling Tool - fixed an issue when Drilling Tool is open and the last Excellon object is deleted +- fixed an issue in Tool Cutout - when using the thin gaps the 9999 tool number is not accepted by Mach3 21.01.2021 diff --git a/appTools/ToolCutOut.py b/appTools/ToolCutOut.py index 36b898ae..876488f6 100644 --- a/appTools/ToolCutOut.py +++ b/appTools/ToolCutOut.py @@ -1070,17 +1070,17 @@ class CutOut(AppTool): if not gaps_solid_geo: pass else: - geo_obj.tools[9999] = deepcopy(self.cut_tool_dict) - geo_obj.tools[9999]['tooldia'] = str(dia) - geo_obj.tools[9999]['solid_geometry'] = gaps_solid_geo + geo_obj.tools[99] = deepcopy(self.cut_tool_dict) + geo_obj.tools[99]['tooldia'] = str(dia) + geo_obj.tools[99]['solid_geometry'] = gaps_solid_geo - geo_obj.tools[9999]['data']['name'] = outname - geo_obj.tools[9999]['data']['tools_mill_tooldia'] = str(dia) - geo_obj.tools[9999]['data']['tools_mill_cutz'] = self.ui.thin_depth_entry.get_value() - geo_obj.tools[9999]['data']['tools_mill_multidepth'] = self.ui.mpass_cb.get_value() - geo_obj.tools[9999]['data']['tools_mill_depthperpass'] = self.ui.maxdepth_entry.get_value() + geo_obj.tools[99]['data']['name'] = outname + geo_obj.tools[99]['data']['tools_mill_tooldia'] = str(dia) + geo_obj.tools[99]['data']['tools_mill_cutz'] = self.ui.thin_depth_entry.get_value() + geo_obj.tools[99]['data']['tools_mill_multidepth'] = self.ui.mpass_cb.get_value() + geo_obj.tools[99]['data']['tools_mill_depthperpass'] = self.ui.maxdepth_entry.get_value() # plot this tool in a different color - geo_obj.tools[9999]['data']['override_color'] = "#29a3a3fa" + geo_obj.tools[99]['data']['override_color'] = "#29a3a3fa" def excellon_init(exc_obj, app_o): if not holes: @@ -1449,15 +1449,15 @@ class CutOut(AppTool): if not gaps_solid_geo: pass else: - geo_obj.tools[9999] = deepcopy(self.cut_tool_dict) - geo_obj.tools[9999]['tooldia'] = str(dia) - geo_obj.tools[9999]['solid_geometry'] = gaps_solid_geo + geo_obj.tools[99] = deepcopy(self.cut_tool_dict) + geo_obj.tools[99]['tooldia'] = str(dia) + geo_obj.tools[99]['solid_geometry'] = gaps_solid_geo - geo_obj.tools[9999]['data']['name'] = outname - geo_obj.tools[9999]['data']['tools_mill_cutz'] = self.ui.thin_depth_entry.get_value() - geo_obj.tools[9999]['data']['tools_mill_multidepth'] = self.ui.mpass_cb.get_value() - geo_obj.tools[9999]['data']['tools_mill_depthperpass'] = self.ui.maxdepth_entry.get_value() - geo_obj.tools[9999]['data']['override_color'] = "#29a3a3fa" + geo_obj.tools[99]['data']['name'] = outname + geo_obj.tools[99]['data']['tools_mill_cutz'] = self.ui.thin_depth_entry.get_value() + geo_obj.tools[99]['data']['tools_mill_multidepth'] = self.ui.mpass_cb.get_value() + geo_obj.tools[99]['data']['tools_mill_depthperpass'] = self.ui.maxdepth_entry.get_value() + geo_obj.tools[99]['data']['override_color'] = "#29a3a3fa" def excellon_init(exc_obj, app_o): if not holes: @@ -1714,20 +1714,20 @@ class CutOut(AppTool): dia = self.ui.dia.get_value() if gaps_solid_geo: - if 9999 not in self.man_cutout_obj.tools: + if 99 not in self.man_cutout_obj.tools: self.man_cutout_obj.tools.update({ - 9999: self.cut_tool_dict + 99: self.cut_tool_dict }) - self.man_cutout_obj.tools[9999]['tooldia'] = str(dia) - self.man_cutout_obj.tools[9999]['solid_geometry'] = [gaps_solid_geo] + self.man_cutout_obj.tools[99]['tooldia'] = str(dia) + self.man_cutout_obj.tools[99]['solid_geometry'] = [gaps_solid_geo] - self.man_cutout_obj.tools[9999]['data']['name'] = self.man_cutout_obj.options['name'] + '_cutout' - self.man_cutout_obj.tools[9999]['data']['tools_mill_cutz'] = self.ui.thin_depth_entry.get_value() - self.man_cutout_obj.tools[9999]['data']['tools_mill_multidepth'] = self.ui.mpass_cb.get_value() - self.man_cutout_obj.tools[9999]['data']['tools_mill_depthperpass'] = self.ui.maxdepth_entry.get_value() - self.man_cutout_obj.tools[9999]['data']['override_color'] = "#29a3a3fa" + self.man_cutout_obj.tools[99]['data']['name'] = self.man_cutout_obj.options['name'] + '_cutout' + self.man_cutout_obj.tools[99]['data']['tools_mill_cutz'] = self.ui.thin_depth_entry.get_value() + self.man_cutout_obj.tools[99]['data']['tools_mill_multidepth'] = self.ui.mpass_cb.get_value() + self.man_cutout_obj.tools[99]['data']['tools_mill_depthperpass'] = self.ui.maxdepth_entry.get_value() + self.man_cutout_obj.tools[99]['data']['override_color'] = "#29a3a3fa" else: - self.man_cutout_obj.tools[9999]['solid_geometry'].append(gaps_solid_geo) + self.man_cutout_obj.tools[99]['solid_geometry'].append(gaps_solid_geo) self.man_cutout_obj.plot(plot_tool=1) self.app.inform.emit('%s' % _("Added manual Bridge Gap. Left click to add another or right click to finish.")) diff --git a/appTools/ToolMilling.py b/appTools/ToolMilling.py index 0d020298..5ef836d7 100644 --- a/appTools/ToolMilling.py +++ b/appTools/ToolMilling.py @@ -1565,13 +1565,13 @@ class ToolMilling(AppTool, Excellon): self.update_ui() # synchronize selection in the Geometry Milling Tool Table with the selection in the Geometry UI Tool Table - self.target_obj.ui.geo_tools_table.clearSelection() - current_selection_mode = self.target_obj.ui.geo_tools_table.selectionMode() - self.target_obj.ui.geo_tools_table.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection) - for row in range(self.target_obj.ui.geo_tools_table.rowCount()): - if row in sel_rows: - self.target_obj.ui.geo_tools_table.selectRow(row) - self.target_obj.ui.geo_tools_table.setSelectionMode(current_selection_mode) + # self.target_obj.ui.geo_tools_table.clearSelection() + # current_selection_mode = self.target_obj.ui.geo_tools_table.selectionMode() + # self.target_obj.ui.geo_tools_table.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection) + # for row in range(self.target_obj.ui.geo_tools_table.rowCount()): + # if row in sel_rows: + # self.target_obj.ui.geo_tools_table.selectRow(row) + # self.target_obj.ui.geo_tools_table.setSelectionMode(current_selection_mode) # mode = QtCore.QItemSelectionModel.Select | QtCore.QItemSelectionModel.Rows # for index in sel_indexes: @@ -1715,7 +1715,7 @@ class ToolMilling(AppTool, Excellon): try: # widgets in the tools table if storage_key == 'tools_mill_tool_type': - print(dict_storage['tools_mill_tool_type']) + # print(dict_storage['tools_mill_tool_type']) form_val = self.ui.geo_tools_table.cellWidget(self.current_row, 2) form_val.set_value(dict_storage['tools_mill_tool_type']) else: