From 1df26cb37e45d6e0a1094b64733854e5d4ef062d Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Fri, 21 Jun 2024 15:40:33 +0200 Subject: [PATCH 1/4] hfsspi SimsetupInfo bug fixed --- .../edb_core/edb_data/hfss_pi_simulation_setup_data.py | 2 +- src/pyedb/dotnet/edb_core/utilities/simulation_setup.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py b/src/pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py index 299f839c7f..8d7e5d9e10 100644 --- a/src/pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py +++ b/src/pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py @@ -39,7 +39,7 @@ def __init__(self, pedb, edb_object=None): def create(self, name=None): """Create an HFSS setup.""" self._name = name - self._create(name) + self._create(name=name, simulation_setup_type=self._setup_type) return self @property diff --git a/src/pyedb/dotnet/edb_core/utilities/simulation_setup.py b/src/pyedb/dotnet/edb_core/utilities/simulation_setup.py index 4408f14fab..4bf44e4a78 100644 --- a/src/pyedb/dotnet/edb_core/utilities/simulation_setup.py +++ b/src/pyedb/dotnet/edb_core/utilities/simulation_setup.py @@ -100,7 +100,11 @@ def __init__(self, pedb, edb_object=None): @property def sim_setup_info(self): - return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self._edb_object.GetSimSetupInfo()) + if self.type not in ["hfss_pi", "raptor_x"]: + return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self._edb_object.GetSimSetupInfo()) + else: + if self._edb_setup_info: + return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self._edb_setup_info) @sim_setup_info.setter def sim_setup_info(self, sim_setup_info): From 19355561b973aa5de048dc47d0e27c105b858932 Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Tue, 25 Jun 2024 20:12:45 +0200 Subject: [PATCH 2/4] temp --- .../dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py diff --git a/src/pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py b/src/pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py deleted file mode 100644 index e69de29bb2..0000000000 From d972e560b8eefe4d6c4d0cc996585ea0a3ff7400 Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Thu, 4 Jul 2024 21:18:53 +0200 Subject: [PATCH 3/4] center line get setter --- src/pyedb/dotnet/edb_core/dotnet/primitive.py | 10 ++++++--- tests/legacy/system/test_edb_modeler.py | 21 +++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/pyedb/dotnet/edb_core/dotnet/primitive.py b/src/pyedb/dotnet/edb_core/dotnet/primitive.py index b1f6d191d3..ee5b747fcc 100644 --- a/src/pyedb/dotnet/edb_core/dotnet/primitive.py +++ b/src/pyedb/dotnet/edb_core/dotnet/primitive.py @@ -847,11 +847,15 @@ def create(self, layout, layer, net, width, end_cap1, end_cap2, corner_style, po @property def center_line(self): """:class:`PolygonData `: Center line for this Path.""" - return self.prim_obj.GetCenterLine() + edb_center_line = self.prim_obj.GetCenterLine() + return [[pt.X.ToDouble(), pt.Y.ToDouble()] for pt in list(edb_center_line.Points)] @center_line.setter - def center_line(self, center_line): - self.prim_obj.SetCenterLineMessage(center_line) + def center_line(self, value): + if isinstance(value, list): + points = [self._pedb.point_data(i[0], i[1]) for i in value] + polygon_data = self._edb.geometry.polygon_data.dotnetobj(convert_py_list_to_net_list(points), False) + self.prim_obj.SetCenterLine(polygon_data) @property def end_cap_style(self): diff --git a/tests/legacy/system/test_edb_modeler.py b/tests/legacy/system/test_edb_modeler.py index 2311e1fca7..8a3e31a2fb 100644 --- a/tests/legacy/system/test_edb_modeler.py +++ b/tests/legacy/system/test_edb_modeler.py @@ -537,3 +537,24 @@ def arbitrary_wave_ports(self): assert "ref" in test_edb.stackup.layers assert len(test_edb.modeler.polygons) == 12 test_edb.close() + + def test_path_center_line(self): + edb = Edb() + edb.stackup.add_layer("GND", "Gap") + edb.stackup.add_layer("Substrat", "GND", layer_type="dielectric", thickness="0.2mm", material="Duroid (tm)") + edb.stackup.add_layer("TOP", "Substrat") + trace_length = 10e-3 + trace_width = 200e-6 + trace_gap = 1e-3 + edb.modeler.create_trace( + path_list=[[-trace_gap / 2, 0.0], [-trace_gap / 2, trace_length]], + layer_name="TOP", + width=trace_width, + net_name="signal1", + start_cap_style="Flat", + end_cap_style="Flat", + ) + centerline = edb.modeler.paths[0].center_line + assert centerline == [[-0.0005, 0.0], [-0.0005, 0.01]] + edb.modeler.paths[0].center_line = [[0.0, 0.0], [0.0, 5e-3]] + assert edb.modeler.paths[0].center_line == [[0.0, 0.0], [0.0, 5e-3]] From b4be9053776761c5effefca311b9923c6424ea2c Mon Sep 17 00:00:00 2001 From: svandenb-dev Date: Fri, 5 Jul 2024 11:39:02 +0200 Subject: [PATCH 4/4] center line get setter --- src/pyedb/dotnet/edb_core/dotnet/primitive.py | 5 ++--- src/pyedb/dotnet/edb_core/edb_data/primitives_data.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pyedb/dotnet/edb_core/dotnet/primitive.py b/src/pyedb/dotnet/edb_core/dotnet/primitive.py index ee5b747fcc..23e2bf7804 100644 --- a/src/pyedb/dotnet/edb_core/dotnet/primitive.py +++ b/src/pyedb/dotnet/edb_core/dotnet/primitive.py @@ -837,9 +837,8 @@ def create(self, layout, layer, net, width, end_cap1, end_cap2, corner_style, po net = net.api_object width = self._app.edb_api.utility.value(width) if isinstance(points, list): - points = self._app.edb_api.geometry.polygon_data.api_class( - convert_py_list_to_net_list([self._app.geometry.point_data(i) for i in points]), False - ) + points = convert_py_list_to_net_list([self._app.point_data(i[0], i[1]) for i in points]) + points = self._app.edb_api.geometry.polygon_data.dotnetobj(points) return PathDotNet( self._app, self.api.Path.Create(layout, layer, net, width, end_cap1, end_cap2, corner_style, points) ) diff --git a/src/pyedb/dotnet/edb_core/edb_data/primitives_data.py b/src/pyedb/dotnet/edb_core/edb_data/primitives_data.py index 00c9f518bd..184685f208 100644 --- a/src/pyedb/dotnet/edb_core/edb_data/primitives_data.py +++ b/src/pyedb/dotnet/edb_core/edb_data/primitives_data.py @@ -631,7 +631,7 @@ def length(self): float Path length in meters. """ - center_line_arcs = list(self.center_line.GetArcData()) + center_line_arcs = list(self.api_object.GetCenterLine().GetArcData()) path_length = 0.0 for arc in center_line_arcs: path_length += arc.GetLength()