Skip to content

Commit 9e9cdb9

Browse files
committed
test modeler #2
1 parent 3d41455 commit 9e9cdb9

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

src/pyedb/grpc/database/modeler.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -530,25 +530,25 @@ def _create_path(
530530
531531
Parameters
532532
----------
533-
points : :class:`dotnet.database.layout.Shape`
533+
points: .:class:`dotnet.database.layout.Shape`
534534
List of points.
535535
layer_name : str
536536
Name of the layer on which to create the path.
537537
width : float, optional
538538
Width of the path. The default is ``1``.
539-
net_name : str, optional
539+
net_name: str, optional
540540
Name of the net. The default is ``""``.
541541
start_cap_style : str, optional
542542
Style of the cap at its start. Options are ``"Round"``,
543-
``"Extended",`` and ``"Flat"``. The default is
544-
``"Round"``.
543+
``"Extended", `` and ``"Flat"``. The default is
544+
``"Round".
545545
end_cap_style : str, optional
546546
Style of the cap at its end. Options are ``"Round"``,
547-
``"Extended",`` and ``"Flat"``. The default is
548-
``"Round"``.
547+
``"Extended", `` and ``"Flat"``. The default is
548+
``"Round".
549549
corner_style : str, optional
550550
Style of the corner. Options are ``"Round"``,
551-
``"Sharp"`` and ``"Mitered"``. The default is ``"Round"``.
551+
``"Sharp"`` and ``"Mitered"``. The default is ``"Round".
552552
553553
Returns
554554
-------
@@ -574,12 +574,23 @@ def _create_path(
574574
corner_style = GrpcPathCornerType.SHARP
575575
else:
576576
corner_style = GrpcPathCornerType.MITER
577+
_points = []
578+
for pt in points:
579+
_pt = []
580+
for coord in pt:
581+
coord = GrpcValue(coord, self._pedb.active_cell)
582+
_pt.append(coord)
583+
_points.append(_pt)
584+
points = _points
585+
586+
width = GrpcValue(width, self._pedb.active_cell)
587+
577588
polygon_data = GrpcPolygonData(points=[GrpcPointData(i) for i in points])
578589
path = Path.create(
579590
layout=self._active_layout,
580591
layer=layer_name,
581592
net=net,
582-
width=GrpcValue(width),
593+
width=width,
583594
end_cap1=start_cap_style,
584595
end_cap2=end_cap_style,
585596
corner_style=corner_style,
@@ -629,6 +640,7 @@ def create_trace(
629640
-------
630641
:class:`pyedb.dotnet.database.edb_data.primitives_data.Primitive`
631642
"""
643+
632644
primitive = self._create_path(
633645
points=path_list,
634646
layer_name=layer_name,

src/pyedb/grpc/database/stackup.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -505,18 +505,7 @@ def _create_stackup_layer(self, layer_name, thickness, layer_type="signal", mate
505505
else:
506506
_layer_type = GrpcLayerType.DIELECTRIC_LAYER
507507
material = "FR4_epoxy"
508-
if isinstance(thickness, str):
509-
if thickness in self._pedb.variables:
510-
thickness = GrpcValue(thickness, self._pedb.active_db)
511-
else:
512-
import re
513-
514-
_thickness = re.split("[-+#]", thickness)
515-
_variables = [val for val in _thickness if val in self._pedb.variables]
516-
if len(_variables) == len(_thickness):
517-
thickness = GrpcValue(thickness, self._pedb.active_db)
518-
else:
519-
thickness = GrpcValue(thickness)
508+
thickness = GrpcValue(thickness, self._pedb.active_db)
520509
layer = StackupLayer.create(
521510
name=layer_name,
522511
layer_type=_layer_type,

tests/grpc/system/test_edb_modeler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ def test_unite_polygon(self):
488488
t3_1 = edbapp.modeler.create_trace(
489489
width="MS_W",
490490
layer_name="trace1",
491-
path_list=[("-Via_S/2", "0"), ("-SL_S/2-SL_W/2", "16 mil"), ("+SL_S/2+MS_W/2", "100 mil")],
491+
path_list=[("-Via_S/2", "0"), ("-SL_S/2-SL_W/2", "16 mil"), ("SL_S/2+MS_W/2", "100 mil")],
492492
start_cap_style="FLat",
493493
end_cap_style="FLat",
494494
net_name="t3_1",

0 commit comments

Comments
 (0)