[Filters][generic] added options to filter by PCB side

This commit is contained in:
Salvador E. Tropea 2022-10-29 15:51:33 -03:00
parent da34175cb3
commit d379c67790
3 changed files with 13 additions and 4 deletions

View File

@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- New output:
- `populate` to create step-by-step assembly instructions
- generic filters: options to filter by PCB side
- Diff:
- Option to compare only the first schematic page. (See #319)
- PcbDraw:

View File

@ -67,11 +67,15 @@ class Generic(BaseFilter): # noqa: F821
self.exclude_all_hash_ref = False
""" Exclude all components with a reference starting with # """
self.exclude_virtual = False
""" KiCad 5: exclude components marked as virtual in the PCB """
""" Exclude components marked as virtual in the PCB """
self.exclude_smd = False
""" KiCad 5: exclude components marked as smd in the PCB """
""" Exclude components marked as smd in the PCB """
self.exclude_tht = False
""" KiCad 5: exclude components marked as through-hole in the PCB """
""" Exclude components marked as through-hole in the PCB """
self.exclude_top = False
""" Exclude components on the top side of the PCB """
self.exclude_bottom = False
""" Exclude components on the bottom side of the PCB """
self.add_to_doc('keys', 'Use `dnf_list` for '+str(sorted(DNF)))
self.add_to_doc('keys', 'Use `dnc_list` for '+str(sorted(DNC)))
@ -180,6 +184,10 @@ class Generic(BaseFilter): # noqa: F821
return exclude
if self.exclude_tht and comp.tht:
return exclude
if self.exclude_top and not comp.bottom:
return exclude
if self.exclude_bottom and comp.bottom:
return exclude
# List of references to be excluded
if self.exclude_refs and (comp.ref in self.exclude_refs or comp.ref_prefix+'*' in self.exclude_refs):
return exclude

View File

@ -34,7 +34,7 @@ ignore = E402, E226, E126, W504
# docstrings - text style (imperative, dot)
D4
max-line-length = 127
max-complexity = 21
max-complexity = 22
exclude = experiments/kicad/v6/
experiments/JLC/
kibot/mcpyrate/