[Quick-Start] Changes in variants use

- Avoid importing PCB/SCH stuff that isn't needed
- We no longer use variants in Quick-Start, just filters
This commit is contained in:
Salvador E. Tropea 2023-01-05 14:16:19 -03:00
parent 315a089300
commit bda5c159ae
2 changed files with 12 additions and 13 deletions

View File

@ -853,16 +853,15 @@ def generate_one_example(dest_dir, types):
yaml_dump(f, {'global': glb})
f.write('\n')
# A helper for the internal templates
imports = [{'file': man} for man in ['Elecrow', 'FusionPCB', 'JLCPCB', 'PCBWay']]
yaml_dump(f, {'import': imports})
f.write('\n')
# A helper for KiCost demo
var = {'name': 'place_holder'}
var['comment'] = 'Just a place holder for pre_transform filters'
var['type'] = 'kicost'
var['pre_transform'] = ['_kicost_rename', '_rot_footprint']
yaml_dump(f, {'variants': [var]})
f.write('\n')
needed_imports = []
if GS.pcb_file:
needed_imports.extend(['Elecrow', 'FusionPCB', 'JLCPCB', 'PCBWay'])
if GS.sch_file and GS.pcb_file:
needed_imports.append('MacroFab_XYRS')
if needed_imports:
imports = [{'file': man} for man in needed_imports]
yaml_dump(f, {'import': imports})
f.write('\n')
# All the outputs
outputs = []
for n, cls in OrderedDict(sorted(outs.items())).items():

View File

@ -995,8 +995,6 @@ class BoM(BaseOutput): # noqa: F821
for tpl in templates:
for out in tpl:
if out['type'] == 'bom':
# Use the KiCost + rotate variant
out['options']['variant'] = 'place_holder'
columns = out['options'].get('columns', None)
if columns:
# Rename MPN for something we have, or just remove it
@ -1085,7 +1083,9 @@ class BoM(BaseOutput): # noqa: F821
grp.append(d+'#')
gb = BoM.create_bom('XLSX', 'Costs', grp, join_fields, fld_names)
gb['options']['xlsx'] = {'style': 'modern-green', 'kicost': True, 'specs': True}
gb['options']['variant'] = 'place_holder'
# KitSpace seems to be failing all the time
gb['options']['xlsx']['kicost_api_disable'] = 'KitSpace'
gb['options']['pre_transform'] = '_kicost_rename'
# gb['options']['distributors'] = list(dists)
outs.append(gb)
# Add the list of layers to the templates