[Schematic v6][Fixed] Issues saving deep nested sheets

- When using sub-dirs relative to a sheet in a sub-dir
This commit is contained in:
Salvador E. Tropea 2024-01-26 13:43:49 -03:00
parent de1fc05298
commit e47124ea51
3 changed files with 9 additions and 2 deletions

View File

@ -120,7 +120,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- When *check_zone_fills* is enabled now we do a refill for the boards
### Fixed
- Schematics: problems with deep nested and recycled sheets (#520)
- Schematics:
- Problems with deep nested and recycled sheets (#520)
- Problems saving deep nested sheets
- Rotated polygons and text used in the worksheet (#466)
- The --log/-L didn't enabled full debug for all messages
- BoM:

View File

@ -2031,7 +2031,7 @@ class SchematicV6(Schematic):
saved.add(fname)
for sch in self.sheets:
if sch.sch:
sch.sch.save(sch.flat_file if exp_hierarchy else sch.file, dest_dir, base_sheet, saved, cross=cross,
sch.sch.save(sch.flat_file if exp_hierarchy else sch.sch.fname_rel, dest_dir, base_sheet, saved, cross=cross,
exp_hierarchy=exp_hierarchy)
def save_variant(self, dest_dir):
@ -2156,6 +2156,7 @@ class SchematicV6(Schematic):
self.all_sheets = []
self.root_sheet = self
UUID_Validator.reset()
self.root_file_path = os.path.dirname(os.path.abspath(fname))
else:
self.fields = parent.fields
self.fields_lc = parent.fields_lc
@ -2165,9 +2166,11 @@ class SchematicV6(Schematic):
self.sheet_names = parent.sheet_names
self.all_sheets = parent.all_sheets
self.root_sheet = parent.root_sheet
self.root_file_path = parent.root_file_path
self.symbol_instances = []
self.parent = parent
self.fname = fname
self.fname_rel = os.path.relpath(fname, self.root_file_path)
self.project = project
self.lib_symbols = []
self.symbols = []

View File

@ -94,6 +94,8 @@ class KiCanvasOptions(VariantOptions):
self.restore_title(sch=True)
def run(self, out_dir):
for f in self._get_targets(out_dir):
logger.error(f)
# Download KiCanvas
if self.local_script:
logger.debug(f'Downloading the script from `{self.url_script}`')