From 0d1f34b2417ee8a36f8b083aaa9bf851f412d57e Mon Sep 17 00:00:00 2001 From: gkorompi Date: Tue, 14 May 2024 10:22:46 +0300 Subject: [PATCH 1/4] FIX: pin definition --- src/pyedb/dotnet/edb.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/pyedb/dotnet/edb.py b/src/pyedb/dotnet/edb.py index 975c5044ba..df21c4feea 100644 --- a/src/pyedb/dotnet/edb.py +++ b/src/pyedb/dotnet/edb.py @@ -4340,3 +4340,28 @@ def definitions(self): from pyedb.dotnet.edb_core.definition.definitions import Definitions return Definitions(self) + + @pyedb_function_handler() + def change_pin_definition(self, pin): + """Change the object definition of the pin from EDBPadstackInstance to PadstackInstance and vice versa. + Parameter + ---------- + pin : object EDBPadstackInstance or PadstackInstance + Initial definition of Pin. + Returns + ------- + pin: secondary definition, depending on the input + object EDBPadstackInstance or PadstackInstance. + """ + from pyedb.dotnet.edb_core.edb_data.padstacks_data import EDBPadstackInstance + + if isinstance(pin, EDBPadstackInstance): + name = pin.name.split("-") + for i in self.components.get_pin_from_component(name[0]): + if i.GetName() == name[1]: + return i + else: + name = pin.GetComponent().GetName() + "-" + pin.GetName() + for i in [*self.padstacks.pins.values()]: + if i.name == name: + return i From 95684137fbe11f976260028c2965b8427e745ca0 Mon Sep 17 00:00:00 2001 From: gkorompi <156683163+gkorompi@users.noreply.github.com> Date: Wed, 15 May 2024 08:24:29 +0300 Subject: [PATCH 2/4] Update src/pyedb/dotnet/edb.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sébastien Morais <146729917+SMoraisAnsys@users.noreply.github.com> --- src/pyedb/dotnet/edb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyedb/dotnet/edb.py b/src/pyedb/dotnet/edb.py index df21c4feea..09e8419f32 100644 --- a/src/pyedb/dotnet/edb.py +++ b/src/pyedb/dotnet/edb.py @@ -4362,6 +4362,6 @@ def change_pin_definition(self, pin): return i else: name = pin.GetComponent().GetName() + "-" + pin.GetName() - for i in [*self.padstacks.pins.values()]: + for i in self.padstacks.pins.values(): if i.name == name: return i From fb416dc8b0562631116c5855e9ea237e180f264c Mon Sep 17 00:00:00 2001 From: gkorompi <156683163+gkorompi@users.noreply.github.com> Date: Wed, 15 May 2024 08:24:43 +0300 Subject: [PATCH 3/4] Update src/pyedb/dotnet/edb.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sébastien Morais <146729917+SMoraisAnsys@users.noreply.github.com> --- src/pyedb/dotnet/edb.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pyedb/dotnet/edb.py b/src/pyedb/dotnet/edb.py index 09e8419f32..892b44c5b8 100644 --- a/src/pyedb/dotnet/edb.py +++ b/src/pyedb/dotnet/edb.py @@ -4344,10 +4344,12 @@ def definitions(self): @pyedb_function_handler() def change_pin_definition(self, pin): """Change the object definition of the pin from EDBPadstackInstance to PadstackInstance and vice versa. + Parameter ---------- pin : object EDBPadstackInstance or PadstackInstance Initial definition of Pin. + Returns ------- pin: secondary definition, depending on the input From 646292079be607b31998b62fff09ffcb54b84ee0 Mon Sep 17 00:00:00 2001 From: gkorompi Date: Wed, 15 May 2024 12:39:19 +0300 Subject: [PATCH 4/4] FIX: pin definition --- src/pyedb/dotnet/edb.py | 25 ------------------------- src/pyedb/dotnet/edb_core/components.py | 6 +++++- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/pyedb/dotnet/edb.py b/src/pyedb/dotnet/edb.py index df21c4feea..975c5044ba 100644 --- a/src/pyedb/dotnet/edb.py +++ b/src/pyedb/dotnet/edb.py @@ -4340,28 +4340,3 @@ def definitions(self): from pyedb.dotnet.edb_core.definition.definitions import Definitions return Definitions(self) - - @pyedb_function_handler() - def change_pin_definition(self, pin): - """Change the object definition of the pin from EDBPadstackInstance to PadstackInstance and vice versa. - Parameter - ---------- - pin : object EDBPadstackInstance or PadstackInstance - Initial definition of Pin. - Returns - ------- - pin: secondary definition, depending on the input - object EDBPadstackInstance or PadstackInstance. - """ - from pyedb.dotnet.edb_core.edb_data.padstacks_data import EDBPadstackInstance - - if isinstance(pin, EDBPadstackInstance): - name = pin.name.split("-") - for i in self.components.get_pin_from_component(name[0]): - if i.GetName() == name[1]: - return i - else: - name = pin.GetComponent().GetName() + "-" + pin.GetName() - for i in [*self.padstacks.pins.values()]: - if i.name == name: - return i diff --git a/src/pyedb/dotnet/edb_core/components.py b/src/pyedb/dotnet/edb_core/components.py index 9293d8ebc1..d1a47fc87e 100644 --- a/src/pyedb/dotnet/edb_core/components.py +++ b/src/pyedb/dotnet/edb_core/components.py @@ -2350,7 +2350,11 @@ def get_pin_from_component(self, component, netName=None, pinName=None): and (self.get_aedt_pin_name(p) in pinName or p.GetName() in pinName) ] else: - pins = [p for p in list(component.LayoutObjs) if int(p.GetObjType()) == 1 and p.IsLayoutPin()] + pins = [ + self._pedb.padstacks.get_instances(pid=p.GetId()) + for p in list(component.LayoutObjs) + if int(p.GetObjType()) == 1 and p.IsLayoutPin() + ] return pins @pyedb_function_handler()