From 193632ff656b9f3594e4b0543bf526434aaeffcb Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Thu, 29 Sep 2022 13:45:00 -0300 Subject: [PATCH] [Fixed] Sch v6 sub-sheet issues - When saving a sub-sheet that was edited as a standalone sheet - In this case we have symbo instances, but they weren't processed, so we can't look for filter modifications. Closes #307 --- CHANGELOG.md | 2 ++ kibot/kicad/v6_sch.py | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3252dba..4c1c3fa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 (#289 #290) - KiCad 5 "assert "lower <= upper" failed in Clamp()" (#304) - Missing XYRS information for components with multiple units (#306) +- Schematic v6: Problems when creating a variant of a sub-sheet that was edited + as a standalone sheet (#307) ### Changed - Diff: diff --git a/kibot/kicad/v6_sch.py b/kibot/kicad/v6_sch.py index e956b2d5..893ee48f 100644 --- a/kibot/kicad/v6_sch.py +++ b/kibot/kicad/v6_sch.py @@ -1733,11 +1733,12 @@ class SchematicV6(Schematic): _add_items_list('sheet_instances', self.sheet_instances, sch) # Symbol instances # Copy potentially modified data from components - for s in self.symbol_instances: - comp = s.component - s.reference = comp.ref - s.value = comp.value - s.footprint = comp.footprint_lib+':'+comp.footprint if comp.footprint_lib else comp.footprint + if base_sheet == self: + for s in self.symbol_instances: + comp = s.component + s.reference = comp.ref + s.value = comp.value + s.footprint = comp.footprint_lib+':'+comp.footprint if comp.footprint_lib else comp.footprint _add_items_list('symbol_instances', self.symbol_instances, sch) logger.debug('Saving schematic: `{}`'.format(fname)) # Keep a back-up of existing files