- fixed a bug in Extract Tool, when extracting drills some of the drills were lost; added a new UI control to select/deselect all apertures
- updated the Extract Tool - Extract Soldermask functionality, such that the selection of apertures will control the final SolderMask Gerber content
This commit is contained in:
@@ -13,11 +13,13 @@ CHANGELOG for FlatCAM beta
|
|||||||
- updated the language strings files
|
- updated the language strings files
|
||||||
- changed the icon for Extract Tool
|
- changed the icon for Extract Tool
|
||||||
- in Cutout Tool added the UI for a new feature: Cut by Drilling
|
- in Cutout Tool added the UI for a new feature: Cut by Drilling
|
||||||
|
- fixed a bug in Extract Tool, when extracting drills some of the drills were lost; added a new UI control to select/deselect all apertures
|
||||||
|
- updated the Extract Tool - Extract Soldermask functionality, such that the selection of apertures will control the final SolderMask Gerber content
|
||||||
|
|
||||||
9.11.2020
|
9.11.2020
|
||||||
|
|
||||||
- some refactoring in signal connections in App.__init__()
|
- some refactoring in signal connections in App.__init__()
|
||||||
- fixed issue with conenctiong twice the signals for the File Toolbar on the first execution of the program
|
- fixed issue with connecting twice the signals for the File Toolbar on the first execution of the program
|
||||||
|
|
||||||
8.11.2020
|
8.11.2020
|
||||||
|
|
||||||
|
|||||||
@@ -2620,7 +2620,7 @@ class MainGUI(QtWidgets.QMainWindow):
|
|||||||
# Extract Drills Tool
|
# Extract Drills Tool
|
||||||
if key == QtCore.Qt.Key_E:
|
if key == QtCore.Qt.Key_E:
|
||||||
# self.app.cal_exc_tool.run(toggle=True)
|
# self.app.cal_exc_tool.run(toggle=True)
|
||||||
self.app.edrills_tool.run(toggle=True)
|
self.app.extract_tool.run(toggle=True)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Fiducials Tool
|
# Fiducials Tool
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ class ToolExtract(AppTool):
|
|||||||
self.ui.other_ring_entry.setDisabled(False) if state else self.ui.other_ring_entry.setDisabled(True)
|
self.ui.other_ring_entry.setDisabled(False) if state else self.ui.other_ring_entry.setDisabled(True)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.ui.all_cb.stateChanged.connect(self.on_select_all)
|
||||||
|
|
||||||
def install(self, icon=None, separator=None, **kwargs):
|
def install(self, icon=None, separator=None, **kwargs):
|
||||||
AppTool.install(self, icon, separator, shortcut='Alt+I', **kwargs)
|
AppTool.install(self, icon, separator, shortcut='Alt+I', **kwargs)
|
||||||
|
|
||||||
@@ -123,6 +125,21 @@ class ToolExtract(AppTool):
|
|||||||
|
|
||||||
self.ui.clearance_entry.set_value(float(self.app.defaults["tools_extract_sm_clearance"]))
|
self.ui.clearance_entry.set_value(float(self.app.defaults["tools_extract_sm_clearance"]))
|
||||||
|
|
||||||
|
def on_select_all(self, state):
|
||||||
|
|
||||||
|
if state:
|
||||||
|
self.ui.circular_cb.setChecked(True)
|
||||||
|
self.ui.oblong_cb.setChecked(True)
|
||||||
|
self.ui.square_cb.setChecked(True)
|
||||||
|
self.ui.rectangular_cb.setChecked(True)
|
||||||
|
self.ui.other_cb.setChecked(True)
|
||||||
|
else:
|
||||||
|
self.ui.circular_cb.setChecked(False)
|
||||||
|
self.ui.oblong_cb.setChecked(False)
|
||||||
|
self.ui.square_cb.setChecked(False)
|
||||||
|
self.ui.rectangular_cb.setChecked(False)
|
||||||
|
self.ui.other_cb.setChecked(False)
|
||||||
|
|
||||||
def on_extract_drills_click(self):
|
def on_extract_drills_click(self):
|
||||||
|
|
||||||
drill_dia = self.ui.dia_entry.get_value()
|
drill_dia = self.ui.dia_entry.get_value()
|
||||||
@@ -186,7 +203,7 @@ class ToolExtract(AppTool):
|
|||||||
if 'follow' in geo_el and isinstance(geo_el['follow'], Point):
|
if 'follow' in geo_el and isinstance(geo_el['follow'], Point):
|
||||||
tools[1]["drills"].append(geo_el['follow'])
|
tools[1]["drills"].append(geo_el['follow'])
|
||||||
if 'solid_geometry' not in tools[1]:
|
if 'solid_geometry' not in tools[1]:
|
||||||
tools[1]['solid_geometry'] = []
|
tools[1]['solid_geometry'] = [geo_el['follow']]
|
||||||
else:
|
else:
|
||||||
tools[1]['solid_geometry'].append(geo_el['follow'])
|
tools[1]['solid_geometry'].append(geo_el['follow'])
|
||||||
|
|
||||||
@@ -270,7 +287,7 @@ class ToolExtract(AppTool):
|
|||||||
tools[tool_in_drills]['drills'].append(geo_el['follow'])
|
tools[tool_in_drills]['drills'].append(geo_el['follow'])
|
||||||
|
|
||||||
if 'solid_geometry' not in tools[tool_in_drills]:
|
if 'solid_geometry' not in tools[tool_in_drills]:
|
||||||
tools[tool_in_drills]['solid_geometry'] = []
|
tools[tool_in_drills]['solid_geometry'] = [geo_el['follow']]
|
||||||
else:
|
else:
|
||||||
tools[tool_in_drills]['solid_geometry'].append(geo_el['follow'])
|
tools[tool_in_drills]['solid_geometry'].append(geo_el['follow'])
|
||||||
|
|
||||||
@@ -360,7 +377,7 @@ class ToolExtract(AppTool):
|
|||||||
tools[tool_in_drills]['drills'].append(geo_el['follow'])
|
tools[tool_in_drills]['drills'].append(geo_el['follow'])
|
||||||
|
|
||||||
if 'solid_geometry' not in tools[tool_in_drills]:
|
if 'solid_geometry' not in tools[tool_in_drills]:
|
||||||
tools[tool_in_drills]['solid_geometry'] = []
|
tools[tool_in_drills]['solid_geometry'] = [geo_el['follow']]
|
||||||
else:
|
else:
|
||||||
tools[tool_in_drills]['solid_geometry'].append(geo_el['follow'])
|
tools[tool_in_drills]['solid_geometry'].append(geo_el['follow'])
|
||||||
|
|
||||||
@@ -390,8 +407,25 @@ class ToolExtract(AppTool):
|
|||||||
return
|
return
|
||||||
|
|
||||||
def on_extract_soldermask_click(self):
|
def on_extract_soldermask_click(self):
|
||||||
|
|
||||||
clearance = self.ui.clearance_entry.get_value()
|
clearance = self.ui.clearance_entry.get_value()
|
||||||
|
|
||||||
|
circ = self.ui.circular_cb.get_value()
|
||||||
|
oblong = self.ui.oblong_cb.get_value()
|
||||||
|
square = self.ui.square_cb.get_value()
|
||||||
|
rect = self.ui.rectangular_cb.get_value()
|
||||||
|
other = self.ui.other_cb.get_value()
|
||||||
|
|
||||||
|
allowed_apertures = []
|
||||||
|
if circ:
|
||||||
|
allowed_apertures.append('C')
|
||||||
|
if oblong:
|
||||||
|
allowed_apertures.append('O')
|
||||||
|
if square or rect:
|
||||||
|
allowed_apertures.append('R')
|
||||||
|
if other:
|
||||||
|
allowed_apertures.append('ELSE')
|
||||||
|
|
||||||
selection_index = self.ui.gerber_object_combo.currentIndex()
|
selection_index = self.ui.gerber_object_combo.currentIndex()
|
||||||
model_index = self.app.collection.index(selection_index, 0, self.ui.gerber_object_combo.rootModelIndex())
|
model_index = self.app.collection.index(selection_index, 0, self.ui.gerber_object_combo.rootModelIndex())
|
||||||
|
|
||||||
@@ -408,6 +442,25 @@ class ToolExtract(AppTool):
|
|||||||
new_follow_geometry = []
|
new_follow_geometry = []
|
||||||
|
|
||||||
for apid, apid_value in obj.apertures.items():
|
for apid, apid_value in obj.apertures.items():
|
||||||
|
ap_type = apid_value['type']
|
||||||
|
|
||||||
|
if ap_type not in allowed_apertures:
|
||||||
|
new_apertures.pop(apid, None)
|
||||||
|
continue
|
||||||
|
|
||||||
|
if ap_type == 'R':
|
||||||
|
width = float(apid_value['width'])
|
||||||
|
height = float(apid_value['height'])
|
||||||
|
|
||||||
|
# if the height == width (float numbers so the reason for the following)
|
||||||
|
if round(width, self.decimals) == round(height, self.decimals):
|
||||||
|
if square is False:
|
||||||
|
new_apertures.pop(apid, None)
|
||||||
|
continue
|
||||||
|
elif rect is False:
|
||||||
|
new_apertures.pop(apid, None)
|
||||||
|
continue
|
||||||
|
|
||||||
if 'geometry' in apid_value:
|
if 'geometry' in apid_value:
|
||||||
new_aper_geo = []
|
new_aper_geo = []
|
||||||
for geo_el in apid_value['geometry']:
|
for geo_el in apid_value['geometry']:
|
||||||
@@ -535,7 +588,7 @@ class ExtractUI:
|
|||||||
|
|
||||||
# grid_lay.addRow("Bottom Layer:", self.object_combo)
|
# grid_lay.addRow("Bottom Layer:", self.object_combo)
|
||||||
grid_lay.addWidget(self.grb_label, 0, 0, 1, 2)
|
grid_lay.addWidget(self.grb_label, 0, 0, 1, 2)
|
||||||
grid_lay.addWidget(self.gerber_object_combo, 1, 0, 1, 2)
|
grid_lay.addWidget(self.gerber_object_combo, 2, 0, 1, 2)
|
||||||
|
|
||||||
self.padt_label = FCLabel("<b>%s</b>" % _("Processed Pads Type"))
|
self.padt_label = FCLabel("<b>%s</b>" % _("Processed Pads Type"))
|
||||||
self.padt_label.setToolTip(
|
self.padt_label.setToolTip(
|
||||||
@@ -544,7 +597,7 @@ class ExtractUI:
|
|||||||
"disable the Rectangular aperture.")
|
"disable the Rectangular aperture.")
|
||||||
)
|
)
|
||||||
|
|
||||||
grid_lay.addWidget(self.padt_label, 2, 0, 1, 2)
|
grid_lay.addWidget(self.padt_label, 4, 0, 1, 2)
|
||||||
|
|
||||||
# Circular Aperture Selection
|
# Circular Aperture Selection
|
||||||
self.circular_cb = FCCheckBox('%s' % _("Circular"))
|
self.circular_cb = FCCheckBox('%s' % _("Circular"))
|
||||||
@@ -552,7 +605,7 @@ class ExtractUI:
|
|||||||
_("Process Circular Pads.")
|
_("Process Circular Pads.")
|
||||||
)
|
)
|
||||||
|
|
||||||
grid_lay.addWidget(self.circular_cb, 3, 0, 1, 2)
|
grid_lay.addWidget(self.circular_cb, 6, 0, 1, 2)
|
||||||
|
|
||||||
# Oblong Aperture Selection
|
# Oblong Aperture Selection
|
||||||
self.oblong_cb = FCCheckBox('%s' % _("Oblong"))
|
self.oblong_cb = FCCheckBox('%s' % _("Oblong"))
|
||||||
@@ -560,7 +613,7 @@ class ExtractUI:
|
|||||||
_("Process Oblong Pads.")
|
_("Process Oblong Pads.")
|
||||||
)
|
)
|
||||||
|
|
||||||
grid_lay.addWidget(self.oblong_cb, 4, 0, 1, 2)
|
grid_lay.addWidget(self.oblong_cb, 8, 0, 1, 2)
|
||||||
|
|
||||||
# Square Aperture Selection
|
# Square Aperture Selection
|
||||||
self.square_cb = FCCheckBox('%s' % _("Square"))
|
self.square_cb = FCCheckBox('%s' % _("Square"))
|
||||||
@@ -568,7 +621,7 @@ class ExtractUI:
|
|||||||
_("Process Square Pads.")
|
_("Process Square Pads.")
|
||||||
)
|
)
|
||||||
|
|
||||||
grid_lay.addWidget(self.square_cb, 5, 0, 1, 2)
|
grid_lay.addWidget(self.square_cb, 10, 0, 1, 2)
|
||||||
|
|
||||||
# Rectangular Aperture Selection
|
# Rectangular Aperture Selection
|
||||||
self.rectangular_cb = FCCheckBox('%s' % _("Rectangular"))
|
self.rectangular_cb = FCCheckBox('%s' % _("Rectangular"))
|
||||||
@@ -576,7 +629,7 @@ class ExtractUI:
|
|||||||
_("Process Rectangular Pads.")
|
_("Process Rectangular Pads.")
|
||||||
)
|
)
|
||||||
|
|
||||||
grid_lay.addWidget(self.rectangular_cb, 6, 0, 1, 2)
|
grid_lay.addWidget(self.rectangular_cb, 12, 0, 1, 2)
|
||||||
|
|
||||||
# Others type of Apertures Selection
|
# Others type of Apertures Selection
|
||||||
self.other_cb = FCCheckBox('%s' % _("Others"))
|
self.other_cb = FCCheckBox('%s' % _("Others"))
|
||||||
@@ -584,12 +637,25 @@ class ExtractUI:
|
|||||||
_("Process pads not in the categories above.")
|
_("Process pads not in the categories above.")
|
||||||
)
|
)
|
||||||
|
|
||||||
grid_lay.addWidget(self.other_cb, 7, 0, 1, 2)
|
grid_lay.addWidget(self.other_cb, 14, 0, 1, 2)
|
||||||
|
|
||||||
separator_line = QtWidgets.QFrame()
|
separator_line = QtWidgets.QFrame()
|
||||||
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||||
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||||
grid_lay.addWidget(separator_line, 8, 0, 1, 2)
|
grid_lay.addWidget(separator_line, 16, 0, 1, 2)
|
||||||
|
|
||||||
|
# All Aperture Selection
|
||||||
|
self.all_cb = FCCheckBox('%s' % _("All"))
|
||||||
|
self.all_cb.setToolTip(
|
||||||
|
_("Process all Pads.")
|
||||||
|
)
|
||||||
|
|
||||||
|
grid_lay.addWidget(self.all_cb, 18, 0, 1, 2)
|
||||||
|
|
||||||
|
separator_line = QtWidgets.QFrame()
|
||||||
|
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||||
|
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||||
|
grid_lay.addWidget(separator_line, 20, 0, 1, 2)
|
||||||
|
|
||||||
# ## Grid Layout
|
# ## Grid Layout
|
||||||
grid1 = QtWidgets.QGridLayout()
|
grid1 = QtWidgets.QGridLayout()
|
||||||
|
|||||||
Reference in New Issue
Block a user