From 75466a7d44b69956b21739629f804617956e0cd2 Mon Sep 17 00:00:00 2001 From: chenchienjacklin <104948990+chenchienjacklin@users.noreply.github.com> Date: Tue, 9 Apr 2024 14:51:42 -0700 Subject: [PATCH] FEATURE: Add PadstackDefData.GetConnectionPt() PadstackDefData.SetConnectionPt() API. --- .../edb/core/definition/padstack_def_data.py | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/src/ansys/edb/core/definition/padstack_def_data.py b/src/ansys/edb/core/definition/padstack_def_data.py index 105170d258..e8e11db797 100644 --- a/src/ansys/edb/core/definition/padstack_def_data.py +++ b/src/ansys/edb/core/definition/padstack_def_data.py @@ -146,6 +146,20 @@ def padstack_def_data_set_solder_ball_param_message(target, d1, d2): def padstack_def_data_set_solder_ball_material_message(target, material): return pb.PadstackDefDataSetSolderBallMaterialMessage(target=target.msg, material=material) + @staticmethod + def padstack_def_data_get_connection_pt_message(target, layer): + return pb.PadstackDefDataGetConnectionPtMessage(target=target.msg, layer=layer) + + @staticmethod + def padstack_def_data_set_connection_pt_message(target, layer, x, y, direction): + return pb.PadstackDefDataSetConnectionPtMessage( + target=target.msg, + layer=layer, + x=messages.value_message(x), + y=messages.value_message(y), + direction=direction.value, + ) + class PadType(Enum): """Provides an enum representing pad types.""" @@ -202,6 +216,22 @@ class SolderballPlacement(Enum): UNKNOWN_PLACEMENT = pb.UNKNOWN_PLACEMENT +class ConnectionPtDirection(Enum): + """Provides an enum representing connection pt direction.""" + + PS_NO_DIRECTION = pb.PS_NO_DIRECTION + PS_ANY_DIRECTION = pb.PS_ANY_DIRECTION + PS_0_DIRECTION = pb.PS_0_DIRECTION + PS_45_DIRECTION = pb.PS_45_DIRECTION + PS_90_DIRECTION = pb.PS_90_DIRECTION + PS_135_DIRECTION = pb.PS_135_DIRECTION + PS_180_DIRECTION = pb.PS_180_DIRECTION + PS_225_DIRECTION = pb.PS_225_DIRECTION + PS_270_DIRECTION = pb.PS_270_DIRECTION + PS_315_DIRECTION = pb.PS_315_DIRECTION + PS_UNKNOWN_DIRECTION = pb.PS_UNKNOWN_DIRECTION + + class PadstackDefData(ObjBase): """Represents a padstack data definition.""" @@ -473,3 +503,49 @@ def solder_ball_material(self, material): self, material ) ) + + def get_connection_pt(self, layer): + """ + Get connection point position and direction by layer name. + + Parameters + ---------- + layer : str + Layer name. + + Returns + ------- + tuple[:class:`Value `, \ + :class:`Value `, :class:`ConnectionPtDirection`] + + The tuple is in a ``(x, y, direction)`` format: + + - ``x``: X of the connection point. + - ``y``: Y of the connection point. + - ``direction``: Direction of the connection point. + """ + msg = self.__stub.GetConnectionPt( + _PadstackDefDataQueryBuilder.padstack_def_data_get_connection_pt_message(self, layer) + ) + return Value(msg.x), Value(msg.y), ConnectionPtDirection(msg.direction) + + def set_connection_pt(self, layer, x, y, direction): + """ + Set connection point position and direction. + + Parameters + ---------- + layer : str + Layer name. + x : :class:`Value ` + X. + y : :class:`Value ` + Y. + direction : :class:`ConnectionPtDirection` + Direction. + """ + self.__stub.SetConnectionPt( + _PadstackDefDataQueryBuilder.padstack_def_data_set_connection_pt_message( + self, layer, x, y, direction + ) + )