[Fixed] Missing data in components added from PCBs

This commit is contained in:
Salvador E. Tropea 2023-11-16 11:24:23 -03:00
parent 7774db11d9
commit ff03417926
1 changed files with 5 additions and 1 deletions

View File

@ -278,6 +278,9 @@ def load_sch():
def create_component_from_footprint(m, ref):
c = SchematicComponentV6()
c.f_ref = c.ref = ref
c.name = m.GetValue()
c.sheet_path_h = c.lib = ''
c.project = GS.sch_basename
# Basic fields
# Reference
f = SchematicField()
@ -288,7 +291,7 @@ def create_component_from_footprint(m, ref):
# Value
f = SchematicField()
f.name = 'Value'
f.value = m.GetValue()
f.value = c.name
f.number = 1
c.add_field(f)
# Footprint
@ -313,6 +316,7 @@ def create_component_from_footprint(m, ref):
f.visible(False)
c.add_field(f)
c._solve_fields(None)
c.split_ref()
return c