[Fixed] Copy of KiCost data
Now we use a copy of the components to allow field expansions. So we must also copy the specs to the original components.
This commit is contained in:
parent
055e832670
commit
22248c0068
|
|
@ -567,6 +567,8 @@ def copy_specs_to_components(parts, groups):
|
|||
for p in parts:
|
||||
for c in p.kibot_group.components:
|
||||
c.kicost_part = p
|
||||
if hasattr(c, 'original_copy'):
|
||||
c.original_copy.kicost_part = p
|
||||
|
||||
|
||||
def _create_kicost_sheet(workbook, groups, image_data, fmt_title, fmt_info, fmt_subtitle, fmt_head, fmt_cols, cfg):
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ class Spec_to_Field(BaseFilter): # noqa: F821
|
|||
ei[dattr] = pattern.format(value)
|
||||
|
||||
def check_coherent(self, c):
|
||||
if not self.check_dist_coherence:
|
||||
if not self.check_dist_coherence or not hasattr(c, 'kicost_part'):
|
||||
return
|
||||
extra_info = {}
|
||||
for d, dd in c.kicost_part.dd.items():
|
||||
|
|
|
|||
|
|
@ -349,7 +349,9 @@ def expand_comp_fields(c, env):
|
|||
|
||||
def expand_fields(comps, dont_copy=False):
|
||||
if not dont_copy:
|
||||
comps = deepcopy(comps)
|
||||
new_comps = deepcopy(comps)
|
||||
for n_c, c in zip(new_comps, comps):
|
||||
n_c.original_copy = c
|
||||
env = KiConf.kicad_env
|
||||
env.update(GS.load_pro_variables())
|
||||
for c in comps:
|
||||
|
|
|
|||
Loading…
Reference in New Issue