- fixed an error in Drilling Plugin when selecting only a few tools and not all for drilling

- fixed an error when building the UI for a CNCJob object created from drilling an Excellon object with a limited selection of tools
This commit is contained in:
Marius Stanciu
2022-01-28 04:03:19 +02:00
committed by Marius
parent 2ebc231f6f
commit c470023719
4 changed files with 16 additions and 8 deletions

View File

@@ -196,7 +196,10 @@ class CNCJobObject(FlatCAMObj, CNCjob):
self.ui.cnc_tools_table.show()
if self.options['type'].lower() == 'excellon':
self.build_excellon_cnc_tools()
try:
self.build_excellon_cnc_tools()
except Exception as err:
self.app.log.error("camlib.CNCJobObject.build_ui -> %s" % str(err))
self.ui.exc_cnc_tools_table.show()
self.ui_connect()
@@ -330,11 +333,10 @@ class CNCJobObject(FlatCAMObj, CNCjob):
n = len(self.tools)
self.ui.exc_cnc_tools_table.setRowCount(n)
row_no = 1
row_no = 0
for t_id, dia_value in self.tools.items():
tooldia = self.tools[t_id]['tooldia']
row_no = t_id - 1
try:
offset_val = self.app.dec_format(float(dia_value['offset']), self.decimals) + self.z_cut
except KeyError:
@@ -368,6 +370,8 @@ class CNCJobObject(FlatCAMObj, CNCjob):
self.ui.exc_cnc_tools_table.setItem(row_no, 5, cutz_item)
self.ui.exc_cnc_tools_table.setCellWidget(row_no, 6, plot_item)
row_no += 1
for row in range(row_no):
self.ui.exc_cnc_tools_table.item(row, 0).setFlags(
self.ui.exc_cnc_tools_table.item(row, 0).flags() ^ QtCore.Qt.ItemFlag.ItemIsSelectable)