From 2da936ec1177ac6d1bef0d1ef8fd4b2b287f1f1f Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 5 Jan 2021 11:29:28 -0300 Subject: [PATCH] Adds sub-part to multipart references. --- kibot/kicad/v5_sch.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kibot/kicad/v5_sch.py b/kibot/kicad/v5_sch.py index 462f0e08..cef310fa 100644 --- a/kibot/kicad/v5_sch.py +++ b/kibot/kicad/v5_sch.py @@ -931,9 +931,14 @@ class SchematicComponent(object): field.value = stripped_val def __str__(self): + ref = self.ref + # Add the sub-part id + # How to know if unit 1 is A? + if self.unit > 1: + ref += chr(ord('A')+self.unit-1) if self.name == self.value: - return '{} ({})'.format(self.ref, self.name) - return '{} ({} {})'.format(self.ref, self.name, self.value) + return '{} ({})'.format(ref, self.name) + return '{} ({} {})'.format(ref, self.name, self.value) @staticmethod def load(f, sheet_path, sheet_path_h, libs, fields, fields_lc):