- fixed an issue in Tool Cutout - when using the thin gaps the 9999 tool number is not accepted by Mach3

This commit is contained in:
Marius Stanciu
2021-01-28 21:28:15 +02:00
committed by Marius
parent 35c8fafddd
commit f7e0226621
3 changed files with 36 additions and 35 deletions

View File

@@ -14,6 +14,7 @@ CHANGELOG for FlatCAM beta
- working in Drilling Tool to make it more robust - 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 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 - 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 21.01.2021

View File

@@ -1070,17 +1070,17 @@ class CutOut(AppTool):
if not gaps_solid_geo: if not gaps_solid_geo:
pass pass
else: else:
geo_obj.tools[9999] = deepcopy(self.cut_tool_dict) geo_obj.tools[99] = deepcopy(self.cut_tool_dict)
geo_obj.tools[9999]['tooldia'] = str(dia) geo_obj.tools[99]['tooldia'] = str(dia)
geo_obj.tools[9999]['solid_geometry'] = gaps_solid_geo geo_obj.tools[99]['solid_geometry'] = gaps_solid_geo
geo_obj.tools[9999]['data']['name'] = outname geo_obj.tools[99]['data']['name'] = outname
geo_obj.tools[9999]['data']['tools_mill_tooldia'] = str(dia) geo_obj.tools[99]['data']['tools_mill_tooldia'] = str(dia)
geo_obj.tools[9999]['data']['tools_mill_cutz'] = self.ui.thin_depth_entry.get_value() geo_obj.tools[99]['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[99]['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']['tools_mill_depthperpass'] = self.ui.maxdepth_entry.get_value()
# plot this tool in a different color # 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): def excellon_init(exc_obj, app_o):
if not holes: if not holes:
@@ -1449,15 +1449,15 @@ class CutOut(AppTool):
if not gaps_solid_geo: if not gaps_solid_geo:
pass pass
else: else:
geo_obj.tools[9999] = deepcopy(self.cut_tool_dict) geo_obj.tools[99] = deepcopy(self.cut_tool_dict)
geo_obj.tools[9999]['tooldia'] = str(dia) geo_obj.tools[99]['tooldia'] = str(dia)
geo_obj.tools[9999]['solid_geometry'] = gaps_solid_geo geo_obj.tools[99]['solid_geometry'] = gaps_solid_geo
geo_obj.tools[9999]['data']['name'] = outname geo_obj.tools[99]['data']['name'] = outname
geo_obj.tools[9999]['data']['tools_mill_cutz'] = self.ui.thin_depth_entry.get_value() geo_obj.tools[99]['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[99]['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']['tools_mill_depthperpass'] = self.ui.maxdepth_entry.get_value()
geo_obj.tools[9999]['data']['override_color'] = "#29a3a3fa" geo_obj.tools[99]['data']['override_color'] = "#29a3a3fa"
def excellon_init(exc_obj, app_o): def excellon_init(exc_obj, app_o):
if not holes: if not holes:
@@ -1714,20 +1714,20 @@ class CutOut(AppTool):
dia = self.ui.dia.get_value() dia = self.ui.dia.get_value()
if gaps_solid_geo: 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({ 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[99]['tooldia'] = str(dia)
self.man_cutout_obj.tools[9999]['solid_geometry'] = [gaps_solid_geo] 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[99]['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[99]['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[99]['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[99]['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']['override_color'] = "#29a3a3fa"
else: 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.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.")) self.app.inform.emit('%s' % _("Added manual Bridge Gap. Left click to add another or right click to finish."))

View File

@@ -1565,13 +1565,13 @@ class ToolMilling(AppTool, Excellon):
self.update_ui() self.update_ui()
# synchronize selection in the Geometry Milling Tool Table with the selection in the Geometry UI Tool Table # 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() # self.target_obj.ui.geo_tools_table.clearSelection()
current_selection_mode = self.target_obj.ui.geo_tools_table.selectionMode() # current_selection_mode = self.target_obj.ui.geo_tools_table.selectionMode()
self.target_obj.ui.geo_tools_table.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection) # self.target_obj.ui.geo_tools_table.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
for row in range(self.target_obj.ui.geo_tools_table.rowCount()): # for row in range(self.target_obj.ui.geo_tools_table.rowCount()):
if row in sel_rows: # if row in sel_rows:
self.target_obj.ui.geo_tools_table.selectRow(row) # 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.setSelectionMode(current_selection_mode)
# mode = QtCore.QItemSelectionModel.Select | QtCore.QItemSelectionModel.Rows # mode = QtCore.QItemSelectionModel.Select | QtCore.QItemSelectionModel.Rows
# for index in sel_indexes: # for index in sel_indexes:
@@ -1715,7 +1715,7 @@ class ToolMilling(AppTool, Excellon):
try: try:
# widgets in the tools table # widgets in the tools table
if storage_key == 'tools_mill_tool_type': 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 = self.ui.geo_tools_table.cellWidget(self.current_row, 2)
form_val.set_value(dict_storage['tools_mill_tool_type']) form_val.set_value(dict_storage['tools_mill_tool_type'])
else: else: