feat: amended exclude DNP from BOM only option #159 #148

This commit is contained in:
Benny Megidish
2024-04-20 21:26:14 +03:00
parent f78ad8c141
commit 702e7e6ee9
2 changed files with 8 additions and 10 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ class KiCadToJLCForm(wx.Frame):
self.mAutomaticTranslation.SetValue(userOptions[AUTO_TRANSLATE_OPT])
self.mAutomaticFill = wx.CheckBox(self, label='Apply automatic fill for all zones')
self.mAutomaticFill.SetValue(userOptions[AUTO_FILL_OPT])
self.mExcludeDnpCheckbox = wx.CheckBox(self, label='Exclude DNP components')
self.mExcludeDnpCheckbox = wx.CheckBox(self, label='Exclude DNP components from BOM')
self.mExcludeDnpCheckbox.SetValue(userOptions[EXCLUDE_DNP_OPT])
layers = get_layer_names(pcbnew.GetBoard())
+7 -9
View File
@@ -159,15 +159,13 @@ class ProcessManager:
# 2: 'unspecified'
# }.get(footprint.GetAttributes())
skip_footprint = ((footprint.GetAttributes() & pcbnew.FP_EXCLUDE_FROM_POS_FILES)
or footprint.GetPadCount() == 0
or exclude_dnp
and (footprint_has_field(footprint, 'dnp')
or (footprint.GetValue().upper() == 'DNP')
or getattr(footprint, 'IsDNP', bool))
)
is_dnp = (footprint_has_field(footprint, 'dnp')
or (footprint.GetValue().upper() == 'DNP')
or getattr(footprint, 'IsDNP', bool))
skip_dnp = exclude_dnp and is_dnp
skip_footprint = footprint.GetPadCount() == 0
if not skip_footprint:
if not (footprint.GetAttributes() & pcbnew.FP_EXCLUDE_FROM_POS_FILES) and not skip_footprint and not is_dnp:
# append unique ID if duplicate footprint designator
unique_id = ""
if footprint_designators[footprint.GetReference()] > 1:
@@ -209,7 +207,7 @@ class ProcessManager:
'Layer': layer,
})
if not (footprint.GetAttributes() & pcbnew.FP_EXCLUDE_FROM_BOM) and not skip_footprint:
if not (footprint.GetAttributes() & pcbnew.FP_EXCLUDE_FROM_BOM) and not skip_footprint and not skip_dnp:
# append unique ID if we are dealing with duplicate bom designator
unique_id = ""
if bom_designators[footprint.GetReference()] > 1: