diff --git a/CHANGELOG.md b/CHANGELOG.md index e5c12749..c992f981 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ CHANGELOG for FlatCAM beta - added detection of Gerber files in Gerber X2 format - added a new feature: if a Gerber file in format Gerber X2 having Drill information's is detected then after loading, it will be converted to an Excellon object +- fixed the Extract Tool to work with apertures (tools) keys as integers +- fixed the Copper Thieving Tool to work with apertures (tools) keys as integers +- fixed the Corners Tool to work with apertures (tools) keys as integers +- fixed the Fiducials Tool to work with apertures (tools) keys as integers 4.03.2021 diff --git a/appPlugins/ToolCopperThieving.py b/appPlugins/ToolCopperThieving.py index eeb41c4e..8cb0e4d7 100644 --- a/appPlugins/ToolCopperThieving.py +++ b/appPlugins/ToolCopperThieving.py @@ -273,7 +273,7 @@ class ToolCopperThieving(AppTool): else: ap_keys = list(new_apertures.keys()) if ap_keys: - new_apid = str(int(max(ap_keys)) + 1) + new_apid = int(max(ap_keys)) + 1 else: new_apid = 10 @@ -1082,7 +1082,7 @@ class ToolCopperThieving(AppTool): ap_keys = list(new_apertures.keys()) max_apid = int(max(ap_keys)) if ap_keys and max_apid != 0: - new_apid = str(max_apid + 1) + new_apid = max_apid + 1 else: new_apid = 10 @@ -1102,7 +1102,6 @@ class ToolCopperThieving(AppTool): # and then set the total plated area value to the GUI element # the area is in mm2 when using Metric units, make it in cm2 for Metric units - print(plated_area) if self.units.lower() == 'mm': plated_area /= 100 self.ui.plated_area_entry.set_value(plated_area) diff --git a/appPlugins/ToolCorners.py b/appPlugins/ToolCorners.py index 1c251b07..dbb4f88c 100644 --- a/appPlugins/ToolCorners.py +++ b/appPlugins/ToolCorners.py @@ -347,14 +347,15 @@ class ToolCorners(AppTool): else: ap_keys = list(new_apertures.keys()) if ap_keys: - new_apid = str(int(max(ap_keys)) + 1) + new_apid = int(max(ap_keys)) + 1 else: new_apid = 10 - new_apertures[new_apid] = {} - new_apertures[new_apid]['type'] = 'C' - new_apertures[new_apid]['size'] = line_thickness - new_apertures[new_apid]['geometry'] = [] + new_apertures[new_apid] = { + 'type': 'C', + 'size': line_thickness, + 'geometry': [] + } for geo in geo_list: geo_buff = geo.buffer(line_thickness / 2.0, resolution=self.grb_steps_per_circle, join_style=3) @@ -471,6 +472,7 @@ class ToolCorners(AppTool): 1: { "tooldia": tooldia, "drills": drill_list, + "slots": [], "solid_geometry": [] } } @@ -565,6 +567,7 @@ class ToolCorners(AppTool): 1: { "tooldia": tooldia, "drills": drill_list, + "slots": [], 'data': {}, "solid_geometry": [] } diff --git a/appPlugins/ToolExtract.py b/appPlugins/ToolExtract.py index 30f944ec..e41689bf 100644 --- a/appPlugins/ToolExtract.py +++ b/appPlugins/ToolExtract.py @@ -253,7 +253,7 @@ class ToolExtract(AppTool): continue # Aperture CODE - ap_code_item = QtWidgets.QTableWidgetItem(ap_code) + ap_code_item = QtWidgets.QTableWidgetItem(str(ap_code)) ap_code_item.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) # Aperture TYPE @@ -379,7 +379,7 @@ class ToolExtract(AppTool): # selected codes in the apertures UI table sel_apid = [] for it in self.ui.apertures_table.selectedItems(): - sel_apid.append(it.text()) + sel_apid.append(int(it.text())) if mode == 'fixed': tools = { @@ -648,7 +648,7 @@ class ToolExtract(AppTool): # selected codes in the apertures UI table sel_apid = [] for it in self.ui.apertures_table.selectedItems(): - sel_apid.append(it.text()) + sel_apid.append(int(it.text())) for apid, apid_value in obj.tools.items(): if apid in sel_apid: @@ -844,7 +844,7 @@ class ToolExtract(AppTool): return try: - aperture = self.ui.apertures_table.item(cw_row, 0).text() + aperture = int(self.ui.apertures_table.item(cw_row, 0).text()) except AttributeError: return diff --git a/appPlugins/ToolFiducials.py b/appPlugins/ToolFiducials.py index f9eb9f3c..1acfe02f 100644 --- a/appPlugins/ToolFiducials.py +++ b/appPlugins/ToolFiducials.py @@ -355,7 +355,7 @@ class ToolFiducials(AppTool): else: ap_keys = list(g_obj.tools.keys()) if ap_keys: - new_apid = str(int(max(ap_keys)) + 1) + new_apid = int(max(ap_keys)) + 1 else: new_apid = 10 @@ -413,7 +413,7 @@ class ToolFiducials(AppTool): else: ap_keys = list(g_obj.tools.keys()) if ap_keys: - new_apid = str(int(max(ap_keys)) + 1) + new_apid = int(max(ap_keys)) + 1 else: new_apid = 10 @@ -487,7 +487,7 @@ class ToolFiducials(AppTool): else: ap_keys = list(g_obj.tools.keys()) if ap_keys: - new_apid = str(int(max(ap_keys)) + 1) + new_apid = int(max(ap_keys)) + 1 else: new_apid = 10 diff --git a/appPlugins/ToolFollow.py b/appPlugins/ToolFollow.py index 6ccf3008..d52e62a0 100644 --- a/appPlugins/ToolFollow.py +++ b/appPlugins/ToolFollow.py @@ -316,8 +316,7 @@ class ToolFollow(AppTool, Gerber): 'solid_geometry': new_obj.solid_geometry } } - for d in new_data: - print(d, new_data[d]) + ret = self.app.app_obj.new_object("geometry", outname, follow_init) if ret == 'fail': self.app.inform.emit("[ERROR_NOTCL] %s" % _("Failed to create Follow Geometry.")) diff --git a/appPlugins/ToolInvertGerber.py b/appPlugins/ToolInvertGerber.py index 26be49e5..e5faca28 100644 --- a/appPlugins/ToolInvertGerber.py +++ b/appPlugins/ToolInvertGerber.py @@ -150,7 +150,7 @@ class ToolInvertGerber(AppTool): if 0 not in new_apertures: new_apertures[0] = { - 'type': 'C', + 'type': 'REG', 'size': 0.0, 'geometry': [] }