Skip to content

Commit

Permalink
Added support for all nets and all layers in create_fieldplot_layers_…
Browse files Browse the repository at this point in the history
…nets method (#4520)

Co-authored-by: maxcapodi78 <Shark78>
  • Loading branch information
maxcapodi78 authored Apr 17, 2024
1 parent d389646 commit 2199664
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
14 changes: 13 additions & 1 deletion _unittest/test_41_3dlayout_modeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,12 +660,24 @@ def test_42_post_processing(self, add_app):
intrinsics={"Time": "1ms"},
plot_name="Test_Layers",
)
assert test_post1.post.create_fieldplot_layers_nets(
[["TOP"], ["PWR", "V3P3_S5"]],
"Mag_Volume_Force_Density",
intrinsics={"Time": "1ms"},
plot_name="Test_Layers2",
)
assert test_post1.post.create_fieldplot_layers_nets(
[["no-layer", "GND"]],
"Mag_Volume_Force_Density",
intrinsics={"Time": "1ms"},
plot_name="Test_Layers3",
)
test_post2 = add_app(project_name=test_post1.project_name, just_open=True)
assert test_post2.post.create_fieldplot_layers_nets(
[["TOP", "GND", "V3P3_S5"], ["PWR", "V3P3_S5"]],
"Mag_E",
intrinsics={"Freq": "1GHz", "Phase": "0deg"},
plot_name="Test_Layers",
plot_name="Test_Layers4",
)
self.aedtapp.close_project(test_post2.project_name)

Expand Down
19 changes: 18 additions & 1 deletion pyaedt/modules/PostProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3307,7 +3307,9 @@ def create_fieldplot_layers_nets(
----------
layers_nets : list
List of layers and nets to plot. For example:
``[["Layer1", "GND", "PWR"], ["Layer2", "VCC"], ...]``.
``[["Layer1", "GND", "PWR"], ["Layer2", "VCC"], ...]``. If ``"no-layer"`` is provided as first argument,
all layers will be considered. If ``"no-net"`` is provided or the list contains only layer name, all the
nets will be automatically considered.
quantity : str
Name of the quantity to plot.
setup : str, optional
Expand All @@ -3333,6 +3335,21 @@ def create_fieldplot_layers_nets(
>>> oModule.CreateFieldPlot
"""
new_list = []
for layer in layers_nets:
if "no-layer" in layer[0]:
for v in self._app.modeler.user_defined_components.values():
new_list.extend(
[[i] + layer[1:] for i in v.layout_component.edb_object.stackup.stackup_layers.keys()]
)
else:
new_list.append(layer)
layers_nets = new_list
for layer in layers_nets:
if len(layer) == 1 or "no-net" in layer[1]:
for v in self._app.modeler.user_defined_components.values():
if layer[0] in v.layout_component.edb_object.stackup.stackup_layers:
layer.extend(list(v.layout_component.edb_object.nets.nets.keys()))
if not (
"APhi" in self.post_solution_type and settings.aedt_version >= "2023.2"
) and not self._app.design_type in ["HFSS", "HFSS 3D Layout Design"]:
Expand Down

0 comments on commit 2199664

Please sign in to comment.