Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: fix padstack def #964

Merged
merged 3 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/pyedb/configuration/cfg_padstacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ def set_parameters_to_edb(self):
if self.solder_ball_parameters:
self._set_solder_parameters_to_edb(self.solder_ball_parameters)

def retrieve_parameters_from_edb(self):
hui-zhou-a marked this conversation as resolved.
Show resolved Hide resolved
self.name = self._pyedb_obj.name
self.hole_plating_thickness = self._pyedb_obj.hole_plating_thickness
self.material = self._pyedb_obj.material
self.hole_range = self._pyedb_obj.hole_range
self.pad_parameters = self._get_pad_parameters_from_edb()
self.hole_parameters = self._get_hole_parameters_from_edb()
self.solder_ball_parameters = self._get_solder_parameters_from_edb()

def _set_solder_parameters_to_edb(self, parameters):
pdef_data = self._pyedb_obj._padstack_def_data

Expand Down Expand Up @@ -158,15 +167,6 @@ def _get_solder_parameters_from_edb(self):
}
return parameters

def retrieve_parameters_from_edb(self):
self.name = self._pyedb_obj.name
self.hole_plating_thickness = self._pyedb_obj.hole_plating_thickness
self.material = self._pyedb_obj.material
self.hole_range = self._pyedb_obj.hole_range
self.pad_parameters = self._get_pad_parameters_from_edb()
self.hole_parameters = self._get_hole_parameters_from_edb()
self.solder_ball_parameters = self._get_solder_parameters_from_edb()

def _get_pad_parameters_from_edb(self):
"""Pad parameters.
Expand Down
14 changes: 9 additions & 5 deletions src/pyedb/configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,17 @@ def run(self, **kwargs):

# Configure stackup
if kwargs.get("fix_padstack_def"):
from pyedb.configuration.cfg_padstacks import CfgPadstackDefinition

pedb_defs = self._pedb.padstacks.definitions
temp = {}
for name, pdef in pedb_defs.items():
temp[name] = pdef.get_properties()
temp = []
for _, pdef in pedb_defs.items():
cfg_def = CfgPadstackDefinition(self._pedb, pdef)
cfg_def.retrieve_parameters_from_edb()
temp.append(cfg_def)
self.cfg_data.stackup.apply()
for name, pdef_p in temp.items():
pedb_defs[name].set_properties(**pdef_p)
for cfg_pdef in temp:
cfg_pdef.set_parameters_to_edb()
else:
self.cfg_data.stackup.apply()

Expand Down
3 changes: 2 additions & 1 deletion tests/legacy/system/test_edb_configuration_2p0.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,8 @@ def test_09_padstack_definition(self, edb_examples):

data = {"padstacks": {"definitions": [DEFINITION], "instances": [INSTANCE]}}
edbapp = edb_examples.get_si_verse()
assert edbapp.configuration.load(data, apply_file=True)
assert edbapp.configuration.load(data, apply_file=False)
edbapp.configuration.run()
data_from_layout = edbapp.configuration.get_data_from_db(padstacks=True)
pdef = [i for i in data_from_layout["padstacks"]["definitions"] if i["name"] == "v35h15"][0]

Expand Down
Loading