From 84f7e5d25b1323a1a83b5d6a66c354416e84ff8c Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 6 Oct 2023 14:42:35 +0200 Subject: Add missing simulation yamls --- gerbonara/cad/kicad/base_types.py | 2 +- gerbonara/cad/kicad/footprints.py | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'gerbonara/cad') diff --git a/gerbonara/cad/kicad/base_types.py b/gerbonara/cad/kicad/base_types.py index 11eeb6d..81eb0c4 100644 --- a/gerbonara/cad/kicad/base_types.py +++ b/gerbonara/cad/kicad/base_types.py @@ -239,7 +239,7 @@ class AtPos(XYCoord): x: float = 0 # in millimeter y: float = 0 # in millimeter rotation: int = 0 # in degrees, can only be 0, 90, 180 or 270. - unlocked: Flag() = False + unlocked: Flag() = True def __before_sexp__(self): self.rotation = int(round(self.rotation % 360)) diff --git a/gerbonara/cad/kicad/footprints.py b/gerbonara/cad/kicad/footprints.py index 7bdeec6..aedef41 100644 --- a/gerbonara/cad/kicad/footprints.py +++ b/gerbonara/cad/kicad/footprints.py @@ -627,7 +627,7 @@ class Footprint: zone_connect: Named(int) = None thermal_width: Named(float) = None thermal_gap: Named(float) = None - attributes: List(Attribute) = field(default_factory=list) + attributes: Attribute = field(default_factory=list) private_layers: Named(str) = None net_tie_pad_groups: Named(Array(str)) = None texts: List(Text) = field(default_factory=list) @@ -672,11 +672,27 @@ class Footprint: effects = TextEffect() self.properties.append(DrawnProperty(key, value, - at=AtPos(x, y, rotation), + at=AtPos(x, y, rotation, unlocked=True), layer=layer, hide=hide, effects=effects)) + def make_standard_properties(self): + if not self.property_value('Reference', None): + self.set_property('Reference', 'REF**', 0, 0, 0, 'F.SilkS') + + if not self.property_value('Value', None): + self.set_property('Value', self.name or 'VAL**', 0, 0, 0, hide=False) + + if not self.property_value('Footprint', None): + self.set_property('Footprint', '', 0, 0, 0) + + if not self.property_value('Datasheet', None): + self.set_property('Datasheet', '', 0, 0, 0) + + if not self.property_value('Description', None): + self.set_property('Description', self.descr or '', 0, 0, 0) + @property def pads_by_number(self): return {(int(pad.number) if pad.number.isnumeric() else pad.number): pad for pad in self.pads if pad.number} -- cgit