Skip to content

Commit

Permalink
FIX: Point terminal layer getter function (#965)
Browse files Browse the repository at this point in the history
The layer getter property of the point terminal always returned the top layer name
irrespective of where the terminal was located. This has been fixed.

(cherry picked from commit 265b4b3)

Co-authored-by: skandakotethota <[email protected]>
Co-authored-by: Skanda Kotethota <[email protected]>
  • Loading branch information
3 people authored Jan 13, 2025
1 parent 733701b commit 67dcb66
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/pyedb/dotnet/edb_core/cell/terminal/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@ def hfss_type(self, value):
@property
def layer(self):
"""Get layer of the terminal."""
point_data = self._pedb.point_data(0, 0)
layer = list(self._pedb.stackup.layers.values())[0]._edb_layer
if self._edb_object.GetParameters(point_data, layer):
try:
_, _, layer = self._edb_object.GetParameters()
return self._pedb.stackup.all_layers[layer.GetName()]
else:
self._pedb.logger.warning(f"No pad parameters found for terminal {self.name}")
except:
self._pedb.logger.error("Cannot determine terminal layer")

@layer.setter
def layer(self, value):
Expand All @@ -121,9 +120,11 @@ def layer(self, value):
@property
def location(self):
"""Location of the terminal."""
layer = list(self._pedb.stackup.layers.values())[0]._edb_layer
_, point_data, _ = self._edb_object.GetParameters(None, layer)
return [point_data.X.ToDouble(), point_data.Y.ToDouble()]
try:
_, point_data, _ = self._edb_object.GetParameters()
return [point_data.X.ToDouble(), point_data.Y.ToDouble()]
except:
self._pedb.logger.error("Cannot determine terminal location")

@location.setter
def location(self, value):
Expand Down

0 comments on commit 67dcb66

Please sign in to comment.