Skip to content

Commit

Permalink
[Subparts filter][Fixed] general filtering
Browse files Browse the repository at this point in the history
Should solve #729
  • Loading branch information
set-soft committed Nov 21, 2024
1 parent 42dc171 commit 312bf7f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- SubParts filter:
- iBoM and Schematic print didn't take it into account (#716)
- 3D outputs also ignored them (#729)
- Any output filtering by reference ignored them (#729)
- BoM
- The field name `Reference` was accepted, but didn't work
- Do Not Fit footprint crosses:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Fixed
- SubParts filter:

- iBoM and Schematic print didn’t take it into account (#716)
- 3D outputs also ignored them (#729)
- Any output filtering by reference ignored them (#729)

- BoM

Expand Down
8 changes: 4 additions & 4 deletions kibot/out_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,8 @@ def filter_pcb_components(self, do_3D=False, do_2D=True, highlight=None):
if not self.will_filter_pcb_components():
return False
self._comps_hash = self.get_refs_hash()
# As we will be comparing the reference split components won't match, so include their parents
self._comps_hash = self.include_parents(self._comps_hash)
if self._sub_pcb:
self._sub_pcb.apply(self._comps_hash)
if self._comps:
Expand All @@ -893,8 +895,7 @@ def filter_pcb_components(self, do_3D=False, do_2D=True, highlight=None):
# Disable the models that aren't for this variant
self.apply_3D_variant_aspect(GS.board)
# Remove the 3D models for not fitted components (also rename)
comps_hash = self.include_parents(self._comps_hash)
self.remove_3D_models(GS.board, comps_hash)
self.remove_3D_models(GS.board, self._comps_hash)
# Highlight selected components
self.highlight_3D_models(GS.board, highlight)
return True
Expand All @@ -911,8 +912,7 @@ def unfilter_pcb_components(self, do_3D=False, do_2D=True):
self.restore_sch_fields_to_pcb(GS.board)
if do_3D and self._comps_hash:
# Undo the removing (also rename)
comps_hash = self.include_parents(self._comps_hash)
self.restore_3D_models(GS.board, comps_hash)
self.restore_3D_models(GS.board, self._comps_hash)
# Re-enable the modules that aren't for this variant
self.apply_3D_variant_aspect(GS.board, enable=True)
# Remove the highlight 3D object
Expand Down

0 comments on commit 312bf7f

Please sign in to comment.