pyedb 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyedb might be problematic. Click here for more details.

Files changed (128) hide show
  1. pyedb/__init__.py +17 -0
  2. pyedb/dotnet/__init__.py +0 -0
  3. pyedb/dotnet/application/Variables.py +2261 -0
  4. pyedb/dotnet/application/__init__.py +0 -0
  5. pyedb/dotnet/clr_module.py +103 -0
  6. pyedb/dotnet/edb.py +4237 -0
  7. pyedb/dotnet/edb_core/__init__.py +1 -0
  8. pyedb/dotnet/edb_core/cell/__init__.py +0 -0
  9. pyedb/dotnet/edb_core/cell/hierarchy/__init__.py +0 -0
  10. pyedb/dotnet/edb_core/cell/hierarchy/model.py +66 -0
  11. pyedb/dotnet/edb_core/components.py +2669 -0
  12. pyedb/dotnet/edb_core/configuration.py +423 -0
  13. pyedb/dotnet/edb_core/definition/__init__.py +0 -0
  14. pyedb/dotnet/edb_core/definition/component_def.py +166 -0
  15. pyedb/dotnet/edb_core/definition/component_model.py +30 -0
  16. pyedb/dotnet/edb_core/definition/definition_obj.py +18 -0
  17. pyedb/dotnet/edb_core/definition/definitions.py +12 -0
  18. pyedb/dotnet/edb_core/dotnet/__init__.py +0 -0
  19. pyedb/dotnet/edb_core/dotnet/database.py +1218 -0
  20. pyedb/dotnet/edb_core/dotnet/layout.py +238 -0
  21. pyedb/dotnet/edb_core/dotnet/primitive.py +1517 -0
  22. pyedb/dotnet/edb_core/edb_data/__init__.py +0 -0
  23. pyedb/dotnet/edb_core/edb_data/components_data.py +938 -0
  24. pyedb/dotnet/edb_core/edb_data/connectable.py +113 -0
  25. pyedb/dotnet/edb_core/edb_data/control_file.py +1268 -0
  26. pyedb/dotnet/edb_core/edb_data/design_options.py +35 -0
  27. pyedb/dotnet/edb_core/edb_data/edbvalue.py +45 -0
  28. pyedb/dotnet/edb_core/edb_data/hfss_extent_info.py +330 -0
  29. pyedb/dotnet/edb_core/edb_data/hfss_simulation_setup_data.py +1607 -0
  30. pyedb/dotnet/edb_core/edb_data/layer_data.py +576 -0
  31. pyedb/dotnet/edb_core/edb_data/nets_data.py +281 -0
  32. pyedb/dotnet/edb_core/edb_data/obj_base.py +19 -0
  33. pyedb/dotnet/edb_core/edb_data/padstacks_data.py +2080 -0
  34. pyedb/dotnet/edb_core/edb_data/ports.py +287 -0
  35. pyedb/dotnet/edb_core/edb_data/primitives_data.py +1397 -0
  36. pyedb/dotnet/edb_core/edb_data/simulation_configuration.py +2914 -0
  37. pyedb/dotnet/edb_core/edb_data/simulation_setup.py +716 -0
  38. pyedb/dotnet/edb_core/edb_data/siwave_simulation_setup_data.py +1205 -0
  39. pyedb/dotnet/edb_core/edb_data/sources.py +514 -0
  40. pyedb/dotnet/edb_core/edb_data/terminals.py +632 -0
  41. pyedb/dotnet/edb_core/edb_data/utilities.py +148 -0
  42. pyedb/dotnet/edb_core/edb_data/variables.py +91 -0
  43. pyedb/dotnet/edb_core/general.py +181 -0
  44. pyedb/dotnet/edb_core/hfss.py +1646 -0
  45. pyedb/dotnet/edb_core/layout.py +1244 -0
  46. pyedb/dotnet/edb_core/layout_validation.py +272 -0
  47. pyedb/dotnet/edb_core/materials.py +939 -0
  48. pyedb/dotnet/edb_core/net_class.py +335 -0
  49. pyedb/dotnet/edb_core/nets.py +1215 -0
  50. pyedb/dotnet/edb_core/padstack.py +1389 -0
  51. pyedb/dotnet/edb_core/siwave.py +1427 -0
  52. pyedb/dotnet/edb_core/stackup.py +2703 -0
  53. pyedb/edb_logger.py +396 -0
  54. pyedb/generic/__init__.py +0 -0
  55. pyedb/generic/constants.py +1063 -0
  56. pyedb/generic/data_handlers.py +320 -0
  57. pyedb/generic/design_types.py +104 -0
  58. pyedb/generic/filesystem.py +150 -0
  59. pyedb/generic/general_methods.py +1535 -0
  60. pyedb/generic/plot.py +1840 -0
  61. pyedb/generic/process.py +285 -0
  62. pyedb/generic/settings.py +224 -0
  63. pyedb/ipc2581/__init__.py +0 -0
  64. pyedb/ipc2581/bom/__init__.py +0 -0
  65. pyedb/ipc2581/bom/bom.py +21 -0
  66. pyedb/ipc2581/bom/bom_item.py +32 -0
  67. pyedb/ipc2581/bom/characteristics.py +37 -0
  68. pyedb/ipc2581/bom/refdes.py +16 -0
  69. pyedb/ipc2581/content/__init__.py +0 -0
  70. pyedb/ipc2581/content/color.py +38 -0
  71. pyedb/ipc2581/content/content.py +55 -0
  72. pyedb/ipc2581/content/dictionary_color.py +29 -0
  73. pyedb/ipc2581/content/dictionary_fill.py +28 -0
  74. pyedb/ipc2581/content/dictionary_line.py +30 -0
  75. pyedb/ipc2581/content/entry_color.py +13 -0
  76. pyedb/ipc2581/content/entry_line.py +14 -0
  77. pyedb/ipc2581/content/fill.py +15 -0
  78. pyedb/ipc2581/content/layer_ref.py +10 -0
  79. pyedb/ipc2581/content/standard_geometries_dictionary.py +72 -0
  80. pyedb/ipc2581/ecad/__init__.py +0 -0
  81. pyedb/ipc2581/ecad/cad_data/__init__.py +0 -0
  82. pyedb/ipc2581/ecad/cad_data/assembly_drawing.py +26 -0
  83. pyedb/ipc2581/ecad/cad_data/cad_data.py +37 -0
  84. pyedb/ipc2581/ecad/cad_data/component.py +41 -0
  85. pyedb/ipc2581/ecad/cad_data/drill.py +30 -0
  86. pyedb/ipc2581/ecad/cad_data/feature.py +54 -0
  87. pyedb/ipc2581/ecad/cad_data/layer.py +41 -0
  88. pyedb/ipc2581/ecad/cad_data/layer_feature.py +151 -0
  89. pyedb/ipc2581/ecad/cad_data/logical_net.py +32 -0
  90. pyedb/ipc2581/ecad/cad_data/outline.py +25 -0
  91. pyedb/ipc2581/ecad/cad_data/package.py +104 -0
  92. pyedb/ipc2581/ecad/cad_data/padstack_def.py +38 -0
  93. pyedb/ipc2581/ecad/cad_data/padstack_hole_def.py +24 -0
  94. pyedb/ipc2581/ecad/cad_data/padstack_instance.py +62 -0
  95. pyedb/ipc2581/ecad/cad_data/padstack_pad_def.py +26 -0
  96. pyedb/ipc2581/ecad/cad_data/path.py +89 -0
  97. pyedb/ipc2581/ecad/cad_data/phy_net.py +80 -0
  98. pyedb/ipc2581/ecad/cad_data/pin.py +31 -0
  99. pyedb/ipc2581/ecad/cad_data/polygon.py +169 -0
  100. pyedb/ipc2581/ecad/cad_data/profile.py +40 -0
  101. pyedb/ipc2581/ecad/cad_data/stackup.py +31 -0
  102. pyedb/ipc2581/ecad/cad_data/stackup_group.py +42 -0
  103. pyedb/ipc2581/ecad/cad_data/stackup_layer.py +21 -0
  104. pyedb/ipc2581/ecad/cad_data/step.py +275 -0
  105. pyedb/ipc2581/ecad/cad_header.py +33 -0
  106. pyedb/ipc2581/ecad/ecad.py +19 -0
  107. pyedb/ipc2581/ecad/spec.py +46 -0
  108. pyedb/ipc2581/history_record.py +37 -0
  109. pyedb/ipc2581/ipc2581.py +387 -0
  110. pyedb/ipc2581/logistic_header.py +25 -0
  111. pyedb/misc/__init__.py +0 -0
  112. pyedb/misc/aedtlib_personalib_install.py +14 -0
  113. pyedb/misc/downloads.py +322 -0
  114. pyedb/misc/misc.py +67 -0
  115. pyedb/misc/pyedb.runtimeconfig.json +13 -0
  116. pyedb/misc/siw_feature_config/__init__.py +0 -0
  117. pyedb/misc/siw_feature_config/emc/__init__.py +0 -0
  118. pyedb/misc/siw_feature_config/emc/component_tags.py +46 -0
  119. pyedb/misc/siw_feature_config/emc/net_tags.py +37 -0
  120. pyedb/misc/siw_feature_config/emc/tag_library.py +62 -0
  121. pyedb/misc/siw_feature_config/emc/xml_generic.py +78 -0
  122. pyedb/misc/siw_feature_config/emc_rule_checker_settings.py +179 -0
  123. pyedb/misc/utilities.py +27 -0
  124. pyedb/modeler/geometry_operators.py +2082 -0
  125. pyedb-0.2.0.dist-info/LICENSE +21 -0
  126. pyedb-0.2.0.dist-info/METADATA +208 -0
  127. pyedb-0.2.0.dist-info/RECORD +128 -0
  128. pyedb-0.2.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,576 @@
1
+ from __future__ import absolute_import
2
+
3
+ import re
4
+
5
+ from pyedb.generic.general_methods import pyedb_function_handler
6
+
7
+
8
+ class LayerEdbClass(object):
9
+ """Manages Edb Layers. Replaces EDBLayer."""
10
+
11
+ def __init__(self, pclass, name):
12
+ self._pclass = pclass
13
+ self._name = name
14
+ self._color = ()
15
+ self._type = ""
16
+
17
+ @property
18
+ def _edb(self):
19
+ return self._pclass._pedb.edb_api
20
+
21
+ @property
22
+ def _edb_layer(self):
23
+ for l in self._pclass._edb_layer_list:
24
+ if l.GetName() == self._name:
25
+ return l.Clone()
26
+
27
+ @property
28
+ def is_stackup_layer(self):
29
+ """Determine whether this layer is a stackup layer.
30
+
31
+ Returns
32
+ -------
33
+ bool
34
+ True if this layer is a stackup layer, False otherwise.
35
+ """
36
+ return self._edb_layer.IsStackupLayer()
37
+
38
+ @property
39
+ def is_via_layer(self):
40
+ """Determine whether this layer is a via layer.
41
+
42
+ Returns
43
+ -------
44
+ bool
45
+ True if this layer is a via layer, False otherwise.
46
+ """
47
+ return self._edb_layer.IsViaLayer()
48
+
49
+ @property
50
+ def color(self):
51
+ """Color of the layer.
52
+
53
+ Returns
54
+ -------
55
+ tuple
56
+ RGB.
57
+ """
58
+ layer_color = self._edb_layer.GetColor()
59
+ return layer_color.Item1, layer_color.Item2, layer_color.Item3
60
+
61
+ @color.setter
62
+ def color(self, rgb):
63
+ layer_clone = self._edb_layer
64
+ layer_clone.SetColor(*rgb)
65
+ self._pclass._set_layout_stackup(layer_clone, "change_attribute")
66
+ self._color = rgb
67
+
68
+ @property
69
+ def transparency(self):
70
+ """Retrieve transparency of the layer.
71
+
72
+ Returns
73
+ -------
74
+ int
75
+ An integer between 0 and 100 with 0 being fully opaque and 100 being fully transparent.
76
+ """
77
+ return self._edb_layer.GetTransparency()
78
+
79
+ @transparency.setter
80
+ def transparency(self, trans):
81
+ layer_clone = self._edb_layer
82
+ layer_clone.SetTransparency(trans)
83
+ self._pclass._set_layout_stackup(layer_clone, "change_attribute")
84
+
85
+ @property
86
+ def name(self):
87
+ """Retrieve name of the layer.
88
+
89
+ Returns
90
+ -------
91
+ str
92
+ """
93
+ return self._edb_layer.GetName()
94
+
95
+ @name.setter
96
+ def name(self, name):
97
+ layer_clone = self._edb_layer
98
+ old_name = layer_clone.GetName()
99
+ layer_clone.SetName(name)
100
+ self._pclass._set_layout_stackup(layer_clone, "change_name", self._name)
101
+ self._name = name
102
+ for padstack_def in list(self._pclass._pedb.padstacks.definitions.values()):
103
+ padstack_def._update_layer_names(old_name=old_name, updated_name=name)
104
+
105
+ @property
106
+ def type(self):
107
+ """Retrieve type of the layer."""
108
+ return re.sub(r"Layer$", "", self._edb_layer.GetLayerType().ToString()).lower()
109
+
110
+ @type.setter
111
+ def type(self, new_type):
112
+ if new_type == self.type:
113
+ return
114
+ layer_clone = self._edb_layer
115
+ if new_type == "signal":
116
+ layer_clone.SetLayerType(self._edb.cell.layer_type.SignalLayer)
117
+ self._type = new_type
118
+ elif new_type == "dielectric":
119
+ layer_clone.SetLayerType(self._edb.cell.layer_type.DielectricLayer)
120
+ self._type = new_type
121
+ else:
122
+ return
123
+ self._pclass._set_layout_stackup(layer_clone, "change_attribute")
124
+
125
+
126
+ class StackupLayerEdbClass(LayerEdbClass):
127
+ def __init__(self, pclass, name):
128
+ super().__init__(pclass, name)
129
+ self._material = ""
130
+ self._conductivity = 0.0
131
+ self._permittivity = 0.0
132
+ self._loss_tangent = 0.0
133
+ self._dielectric_fill = ""
134
+ self._thickness = 0.0
135
+ self._etch_factor = 0.0
136
+ self._roughness_enabled = False
137
+ self._top_hallhuray_nodule_radius = 0.5e-6
138
+ self._top_hallhuray_surface_ratio = 2.9
139
+ self._bottom_hallhuray_nodule_radius = 0.5e-6
140
+ self._bottom_hallhuray_surface_ratio = 2.9
141
+ self._side_hallhuray_nodule_radius = 0.5e-6
142
+ self._side_hallhuray_surface_ratio = 2.9
143
+ self._material = None
144
+ self._upper_elevation = 0.0
145
+ self._lower_elevation = 0.0
146
+
147
+ @property
148
+ def lower_elevation(self):
149
+ """Lower elevation.
150
+
151
+ Returns
152
+ -------
153
+ float
154
+ Lower elevation.
155
+ """
156
+ self._lower_elevation = self._edb_layer.GetLowerElevation()
157
+ return self._lower_elevation
158
+
159
+ @lower_elevation.setter
160
+ def lower_elevation(self, value):
161
+ if self._pclass.mode == "Overlapping":
162
+ layer_clone = self._edb_layer
163
+ layer_clone.SetLowerElevation(self._pclass._edb_value(value))
164
+ self._pclass._set_layout_stackup(layer_clone, "change_attribute")
165
+
166
+ @property
167
+ def upper_elevation(self):
168
+ """Upper elevation.
169
+
170
+ Returns
171
+ -------
172
+ float
173
+ Upper elevation.
174
+ """
175
+ self._upper_elevation = self._edb_layer.GetUpperElevation()
176
+ return self._upper_elevation
177
+
178
+ @property
179
+ def is_negative(self):
180
+ """Determine whether this layer is a negative layer.
181
+
182
+ Returns
183
+ -------
184
+ bool
185
+ True if this layer is a negative layer, False otherwise.
186
+ """
187
+ return self._edb_layer.GetNegative()
188
+
189
+ @is_negative.setter
190
+ def is_negative(self, value):
191
+ layer_clone = self._edb_layer
192
+ layer_clone.SetNegative(value)
193
+ self._pclass._set_layout_stackup(layer_clone, "change_attribute")
194
+
195
+ @property
196
+ def material(self):
197
+ """Get/Set the material loss_tangent.
198
+
199
+ Returns
200
+ -------
201
+ float
202
+ """
203
+ return self._edb_layer.GetMaterial()
204
+
205
+ @material.setter
206
+ def material(self, name):
207
+ layer_clone = self._edb_layer
208
+ layer_clone.SetMaterial(name)
209
+ self._pclass._set_layout_stackup(layer_clone, "change_attribute")
210
+ self._material = name
211
+
212
+ @property
213
+ def conductivity(self):
214
+ """Get the material conductivity.
215
+
216
+ Returns
217
+ -------
218
+ float
219
+ """
220
+ if self.material in self._pclass._pedb.materials.materials:
221
+ self._conductivity = self._pclass._pedb.materials[self.material].conductivity
222
+ return self._conductivity
223
+
224
+ return None
225
+
226
+ @property
227
+ def permittivity(self):
228
+ """Get the material permittivity.
229
+
230
+ Returns
231
+ -------
232
+ float
233
+ """
234
+ if self.material in self._pclass._pedb.materials.materials:
235
+ self._permittivity = self._pclass._pedb.materials[self.material].permittivity
236
+ return self._permittivity
237
+ return None
238
+
239
+ @property
240
+ def loss_tangent(self):
241
+ """Get the material loss_tangent.
242
+
243
+ Returns
244
+ -------
245
+ float
246
+ """
247
+ if self.material in self._pclass._pedb.materials.materials:
248
+ self._loss_tangent = self._pclass._pedb.materials[self.material].loss_tangent
249
+ return self._loss_tangent
250
+ return None
251
+
252
+ @property
253
+ def dielectric_fill(self):
254
+ """Retrieve material name of the layer dielectric fill."""
255
+ if self.type == "signal":
256
+ self._dielectric_fill = self._edb_layer.GetFillMaterial()
257
+ return self._dielectric_fill
258
+ else:
259
+ return
260
+
261
+ @dielectric_fill.setter
262
+ def dielectric_fill(self, name):
263
+ if self.type == "signal":
264
+ layer_clone = self._edb_layer
265
+ layer_clone.SetFillMaterial(name)
266
+ self._pclass._set_layout_stackup(layer_clone, "change_attribute")
267
+ self._dielectric_fill = name
268
+ else:
269
+ pass
270
+
271
+ @property
272
+ def thickness(self):
273
+ """Retrieve thickness of the layer.
274
+
275
+ Returns
276
+ -------
277
+ float
278
+ """
279
+ if not self.is_stackup_layer: # pragma: no cover
280
+ return
281
+ self._thickness = self._edb_layer.GetThicknessValue().ToDouble()
282
+ return self._thickness
283
+
284
+ @thickness.setter
285
+ def thickness(self, value):
286
+ if not self.is_stackup_layer: # pragma: no cover
287
+ return
288
+ layer_clone = self._edb_layer
289
+ layer_clone.SetThickness(self._pclass._edb_value(value))
290
+ self._pclass._set_layout_stackup(layer_clone, "change_attribute")
291
+ self._thickness = value
292
+
293
+ @property
294
+ def etch_factor(self):
295
+ """Retrieve etch factor of this layer.
296
+
297
+ Returns
298
+ -------
299
+ float
300
+ """
301
+ self._etch_factor = self._edb_layer.GetEtchFactor().ToDouble()
302
+ return self._etch_factor
303
+
304
+ @etch_factor.setter
305
+ def etch_factor(self, value):
306
+ if not self.is_stackup_layer: # pragma: no cover
307
+ return
308
+ if not value:
309
+ layer_clone = self._edb_layer
310
+ layer_clone.SetEtchFactorEnabled(False)
311
+ else:
312
+ layer_clone = self._edb_layer
313
+ layer_clone.SetEtchFactorEnabled(True)
314
+ layer_clone.SetEtchFactor(self._pclass._edb_value(value))
315
+ self._pclass._set_layout_stackup(layer_clone, "change_attribute")
316
+ self._etch_factor = value
317
+
318
+ @property
319
+ def roughness_enabled(self):
320
+ """Determine whether roughness is enabled on this layer.
321
+
322
+ Returns
323
+ -------
324
+ bool
325
+ """
326
+ if not self.is_stackup_layer: # pragma: no cover
327
+ return
328
+ self._roughness_enabled = self._edb_layer.IsRoughnessEnabled()
329
+ return self._roughness_enabled
330
+
331
+ @roughness_enabled.setter
332
+ def roughness_enabled(self, set_enable):
333
+ if not self.is_stackup_layer: # pragma: no cover
334
+ return
335
+ self._roughness_enabled = set_enable
336
+ if set_enable:
337
+ layer_clone = self._edb_layer
338
+ layer_clone.SetRoughnessEnabled(True)
339
+ self._pclass._set_layout_stackup(layer_clone, "change_attribute")
340
+ self.assign_roughness_model()
341
+ else:
342
+ layer_clone = self._edb_layer
343
+ layer_clone.SetRoughnessEnabled(False)
344
+ self._pclass._set_layout_stackup(layer_clone, "change_attribute")
345
+
346
+ @property
347
+ def top_hallhuray_nodule_radius(self):
348
+ """Retrieve huray model nodule radius on top of the conductor."""
349
+ top_roughness_model = self.get_roughness_model("top")
350
+ if top_roughness_model:
351
+ self._top_hallhuray_nodule_radius = top_roughness_model.NoduleRadius.ToDouble()
352
+ return self._top_hallhuray_nodule_radius
353
+
354
+ @top_hallhuray_nodule_radius.setter
355
+ def top_hallhuray_nodule_radius(self, value):
356
+ self._top_hallhuray_nodule_radius = value
357
+
358
+ @property
359
+ def top_hallhuray_surface_ratio(self):
360
+ """Retrieve huray model surface ratio on top of the conductor."""
361
+ top_roughness_model = self.get_roughness_model("top")
362
+ if top_roughness_model:
363
+ self._top_hallhuray_surface_ratio = top_roughness_model.SurfaceRatio.ToDouble()
364
+ return self._top_hallhuray_surface_ratio
365
+
366
+ @top_hallhuray_surface_ratio.setter
367
+ def top_hallhuray_surface_ratio(self, value):
368
+ self._top_hallhuray_surface_ratio = value
369
+
370
+ @property
371
+ def bottom_hallhuray_nodule_radius(self):
372
+ """Retrieve huray model nodule radius on bottom of the conductor."""
373
+ bottom_roughness_model = self.get_roughness_model("bottom")
374
+ if bottom_roughness_model:
375
+ self._bottom_hallhuray_nodule_radius = bottom_roughness_model.NoduleRadius.ToDouble()
376
+ return self._bottom_hallhuray_nodule_radius
377
+
378
+ @bottom_hallhuray_nodule_radius.setter
379
+ def bottom_hallhuray_nodule_radius(self, value):
380
+ self._bottom_hallhuray_nodule_radius = value
381
+
382
+ @property
383
+ def bottom_hallhuray_surface_ratio(self):
384
+ """Retrieve huray model surface ratio on bottom of the conductor."""
385
+ bottom_roughness_model = self.get_roughness_model("bottom")
386
+ if bottom_roughness_model:
387
+ self._bottom_hallhuray_surface_ratio = bottom_roughness_model.SurfaceRatio.ToDouble()
388
+ return self._bottom_hallhuray_surface_ratio
389
+
390
+ @bottom_hallhuray_surface_ratio.setter
391
+ def bottom_hallhuray_surface_ratio(self, value):
392
+ self._bottom_hallhuray_surface_ratio = value
393
+
394
+ @property
395
+ def side_hallhuray_nodule_radius(self):
396
+ """Retrieve huray model nodule radius on sides of the conductor."""
397
+ side_roughness_model = self.get_roughness_model("side")
398
+ if side_roughness_model:
399
+ self._side_hallhuray_nodule_radius = side_roughness_model.NoduleRadius.ToDouble()
400
+ return self._side_hallhuray_nodule_radius
401
+
402
+ @side_hallhuray_nodule_radius.setter
403
+ def side_hallhuray_nodule_radius(self, value):
404
+ self._side_hallhuray_nodule_radius = value
405
+
406
+ @property
407
+ def side_hallhuray_surface_ratio(self):
408
+ """Retrieve huray model surface ratio on sides of the conductor."""
409
+ side_roughness_model = self.get_roughness_model("side")
410
+ if side_roughness_model:
411
+ self._side_hallhuray_surface_ratio = side_roughness_model.SurfaceRatio.ToDouble()
412
+ return self._side_hallhuray_surface_ratio
413
+
414
+ @side_hallhuray_surface_ratio.setter
415
+ def side_hallhuray_surface_ratio(self, value):
416
+ self._side_hallhuray_surface_ratio = value
417
+
418
+ @pyedb_function_handler()
419
+ def get_roughness_model(self, surface="top"):
420
+ """Get roughness model of the layer.
421
+
422
+ Parameters
423
+ ----------
424
+ surface : str, optional
425
+ Where to fetch roughness model. The default is ``"top"``. Options are ``"top"``, ``"bottom"``, ``"side"``.
426
+
427
+ Returns
428
+ -------
429
+ ``"Ansys.Ansoft.Edb.Cell.RoughnessModel"``
430
+
431
+ """
432
+ if not self.is_stackup_layer: # pragma: no cover
433
+ return
434
+ if surface == "top":
435
+ return self._edb_layer.GetRoughnessModel(self._pclass._pedb.edb_api.Cell.RoughnessModel.Region.Top)
436
+ elif surface == "bottom":
437
+ return self._edb_layer.GetRoughnessModel(self._pclass._pedb.edb_api.Cell.RoughnessModel.Region.Bottom)
438
+ elif surface == "side":
439
+ return self._edb_layer.GetRoughnessModel(self._pclass._pedb.edb_api.Cell.RoughnessModel.Region.Side)
440
+
441
+ @pyedb_function_handler()
442
+ def assign_roughness_model(
443
+ self,
444
+ model_type="huray",
445
+ huray_radius="0.5um",
446
+ huray_surface_ratio="2.9",
447
+ groisse_roughness="1um",
448
+ apply_on_surface="all",
449
+ ):
450
+ """Assign roughness model on this layer.
451
+
452
+ Parameters
453
+ ----------
454
+ model_type : str, optional
455
+ Type of roughness model. The default is ``"huray"``. Options are ``"huray"``, ``"groisse"``.
456
+ huray_radius : str, float, optional
457
+ Radius of huray model. The default is ``"0.5um"``.
458
+ huray_surface_ratio : str, float, optional.
459
+ Surface ratio of huray model. The default is ``"2.9"``.
460
+ groisse_roughness : str, float, optional
461
+ Roughness of groisse model. The default is ``"1um"``.
462
+ apply_on_surface : str, optional.
463
+ Where to assign roughness model. The default is ``"all"``. Options are ``"top"``, ``"bottom"``,
464
+ ``"side"``.
465
+
466
+ Returns
467
+ -------
468
+
469
+ """
470
+ if not self.is_stackup_layer: # pragma: no cover
471
+ return
472
+
473
+ radius = self._pclass._edb_value(huray_radius)
474
+ self._hurray_nodule_radius = huray_radius
475
+ surface_ratio = self._pclass._edb_value(huray_surface_ratio)
476
+ self._hurray_surface_ratio = huray_surface_ratio
477
+ groisse_roughness = self._pclass._edb_value(groisse_roughness)
478
+ regions = []
479
+ if apply_on_surface == "all":
480
+ self._side_roughness = "all"
481
+ regions = [
482
+ self._pclass._pedb.edb_api.Cell.RoughnessModel.Region.Top,
483
+ self._pclass._pedb.edb_api.Cell.RoughnessModel.Region.Side,
484
+ self._pclass._pedb.edb_api.Cell.RoughnessModel.Region.Bottom,
485
+ ]
486
+ elif apply_on_surface == "top":
487
+ self._side_roughness = "top"
488
+ regions = [self._pclass._pedb.edb_api.Cell.RoughnessModel.Region.Top]
489
+ elif apply_on_surface == "bottom":
490
+ self._side_roughness = "bottom"
491
+ regions = [self._pclass._pedb.edb_api.Cell.RoughnessModel.Region.Bottom]
492
+ elif apply_on_surface == "side":
493
+ self._side_roughness = "side"
494
+ regions = [self._pclass._pedb.edb_api.Cell.RoughnessModel.Region.Side]
495
+
496
+ layer_clone = self._edb_layer
497
+ layer_clone.SetRoughnessEnabled(True)
498
+ for r in regions:
499
+ if model_type == "huray":
500
+ model = self._pclass._pedb.edb_api.Cell.HurrayRoughnessModel(radius, surface_ratio)
501
+ else:
502
+ model = self._pclass._pedb.edb_api.Cell.GroisseRoughnessModel(groisse_roughness)
503
+ layer_clone.SetRoughnessModel(r, model)
504
+ return self._pclass._set_layout_stackup(layer_clone, "change_attribute")
505
+
506
+ @pyedb_function_handler()
507
+ def _json_format(self):
508
+ dict_out = {}
509
+ self._color = self.color
510
+ self._dielectric_fill = self.dielectric_fill
511
+ self._etch_factor = self.etch_factor
512
+ self._material = self.material
513
+ self._name = self.name
514
+ self._roughness_enabled = self.roughness_enabled
515
+ self._thickness = self.thickness
516
+ self._type = self.type
517
+ self._roughness_enabled = self.roughness_enabled
518
+ self._top_hallhuray_nodule_radius = self.top_hallhuray_nodule_radius
519
+ self._top_hallhuray_surface_ratio = self.top_hallhuray_surface_ratio
520
+ self._side_hallhuray_nodule_radius = self.side_hallhuray_nodule_radius
521
+ self._side_hallhuray_surface_ratio = self.side_hallhuray_surface_ratio
522
+ self._bottom_hallhuray_nodule_radius = self.bottom_hallhuray_nodule_radius
523
+ self._bottom_hallhuray_surface_ratio = self.bottom_hallhuray_surface_ratio
524
+ for k, v in self.__dict__.items():
525
+ if (
526
+ not k == "_pclass"
527
+ and not k == "_conductivity"
528
+ and not k == "_permittivity"
529
+ and not k == "_loss_tangent"
530
+ ):
531
+ dict_out[k[1:]] = v
532
+ return dict_out
533
+
534
+ def _load_layer(self, layer):
535
+ if layer:
536
+ self.color = layer["color"]
537
+ self.type = layer["type"]
538
+ if isinstance(layer["material"], str):
539
+ self.material = layer["material"]
540
+ else:
541
+ self._pclass._pedb.materials._load_materials(layer["material"])
542
+ self.material = layer["material"]["name"]
543
+ if layer["dielectric_fill"]:
544
+ if isinstance(layer["dielectric_fill"], str):
545
+ self.dielectric_fill = layer["dielectric_fill"]
546
+ else:
547
+ self._pclass._pedb.materials._load_materials(layer["dielectric_fill"])
548
+ self.dielectric_fill = layer["dielectric_fill"]["name"]
549
+ self.thickness = layer["thickness"]
550
+ self.etch_factor = layer["etch_factor"]
551
+ self.roughness_enabled = layer["roughness_enabled"]
552
+ if self.roughness_enabled:
553
+ self.top_hallhuray_nodule_radius = layer["top_hallhuray_nodule_radius"]
554
+ self.top_hallhuray_surface_ratio = layer["top_hallhuray_surface_ratio"]
555
+ self.assign_roughness_model(
556
+ "huray",
557
+ layer["top_hallhuray_nodule_radius"],
558
+ layer["top_hallhuray_surface_ratio"],
559
+ apply_on_surface="top",
560
+ )
561
+ self.bottom_hallhuray_nodule_radius = layer["bottom_hallhuray_nodule_radius"]
562
+ self.bottom_hallhuray_surface_ratio = layer["bottom_hallhuray_surface_ratio"]
563
+ self.assign_roughness_model(
564
+ "huray",
565
+ layer["bottom_hallhuray_nodule_radius"],
566
+ layer["bottom_hallhuray_surface_ratio"],
567
+ apply_on_surface="bottom",
568
+ )
569
+ self.side_hallhuray_nodule_radius = layer["side_hallhuray_nodule_radius"]
570
+ self.side_hallhuray_surface_ratio = layer["side_hallhuray_surface_ratio"]
571
+ self.assign_roughness_model(
572
+ "huray",
573
+ layer["side_hallhuray_nodule_radius"],
574
+ layer["side_hallhuray_surface_ratio"],
575
+ apply_on_surface="side",
576
+ )