pyedb 0.54.0__py3-none-any.whl → 0.55.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.
- pyedb/__init__.py +1 -8
- pyedb/configuration/cfg_boundaries.py +69 -151
- pyedb/configuration/cfg_components.py +201 -460
- pyedb/configuration/cfg_data.py +4 -2
- pyedb/configuration/cfg_general.py +13 -36
- pyedb/configuration/cfg_modeler.py +2 -1
- pyedb/configuration/cfg_nets.py +21 -35
- pyedb/configuration/cfg_operations.py +22 -151
- pyedb/configuration/cfg_package_definition.py +56 -112
- pyedb/configuration/cfg_padstacks.py +292 -688
- pyedb/configuration/cfg_pin_groups.py +32 -79
- pyedb/configuration/cfg_ports_sources.py +19 -6
- pyedb/configuration/cfg_s_parameter_models.py +67 -172
- pyedb/configuration/cfg_setup.py +102 -295
- pyedb/configuration/configuration.py +64 -5
- pyedb/dotnet/database/cell/connectable.py +38 -9
- pyedb/dotnet/database/cell/hierarchy/component.py +28 -28
- pyedb/dotnet/database/cell/hierarchy/model.py +1 -1
- pyedb/dotnet/database/cell/layout.py +63 -2
- pyedb/dotnet/database/cell/layout_obj.py +2 -2
- pyedb/dotnet/database/cell/primitive/path.py +6 -8
- pyedb/dotnet/database/cell/primitive/primitive.py +3 -24
- pyedb/dotnet/database/cell/terminal/edge_terminal.py +2 -2
- pyedb/dotnet/database/cell/terminal/padstack_instance_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/pingroup_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/point_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/terminal.py +24 -24
- pyedb/dotnet/database/cell/voltage_regulator.py +0 -21
- pyedb/dotnet/database/components.py +96 -88
- pyedb/dotnet/database/definition/component_def.py +4 -4
- pyedb/dotnet/database/definition/component_model.py +1 -1
- pyedb/dotnet/database/definition/package_def.py +2 -3
- pyedb/dotnet/database/dotnet/database.py +3 -199
- pyedb/dotnet/database/dotnet/primitive.py +3 -3
- pyedb/dotnet/database/edb_data/control_file.py +5 -5
- pyedb/dotnet/database/edb_data/hfss_extent_info.py +6 -6
- pyedb/dotnet/database/edb_data/layer_data.py +23 -23
- pyedb/dotnet/database/edb_data/padstacks_data.py +63 -88
- pyedb/dotnet/database/edb_data/primitives_data.py +5 -5
- pyedb/dotnet/database/edb_data/sources.py +6 -6
- pyedb/dotnet/database/edb_data/variables.py +1 -1
- pyedb/dotnet/database/geometry/point_data.py +14 -10
- pyedb/dotnet/database/geometry/polygon_data.py +3 -3
- pyedb/dotnet/database/hfss.py +46 -48
- pyedb/dotnet/database/layout_validation.py +14 -11
- pyedb/dotnet/database/materials.py +10 -11
- pyedb/dotnet/database/modeler.py +97 -91
- pyedb/dotnet/database/nets.py +19 -22
- pyedb/dotnet/database/padstack.py +84 -83
- pyedb/dotnet/database/siwave.py +42 -42
- pyedb/dotnet/database/stackup.py +140 -72
- pyedb/dotnet/database/utilities/heatsink.py +4 -4
- pyedb/dotnet/database/utilities/obj_base.py +2 -2
- pyedb/dotnet/database/utilities/simulation_setup.py +2 -2
- pyedb/dotnet/database/utilities/value.py +16 -16
- pyedb/dotnet/edb.py +228 -150
- pyedb/edb_logger.py +12 -27
- pyedb/extensions/via_design_backend.py +6 -3
- pyedb/generic/design_types.py +67 -29
- pyedb/generic/general_methods.py +0 -120
- pyedb/generic/process.py +44 -108
- pyedb/generic/settings.py +75 -19
- pyedb/grpc/database/components.py +2 -0
- pyedb/grpc/database/control_file.py +5 -5
- pyedb/grpc/database/definition/materials.py +1 -1
- pyedb/grpc/database/definition/package_def.py +3 -3
- pyedb/grpc/database/definition/padstack_def.py +53 -0
- pyedb/grpc/database/geometry/polygon_data.py +1 -1
- pyedb/grpc/database/layout/layout.py +8 -5
- pyedb/grpc/database/layout_validation.py +3 -3
- pyedb/grpc/database/modeler.py +9 -4
- pyedb/grpc/database/net/net.py +15 -14
- pyedb/grpc/database/nets.py +70 -0
- pyedb/grpc/database/padstacks.py +35 -17
- pyedb/grpc/database/primitive/padstack_instance.py +175 -7
- pyedb/grpc/database/siwave.py +1 -1
- pyedb/grpc/database/source_excitations.py +2 -4
- pyedb/grpc/database/stackup.py +1 -1
- pyedb/grpc/database/terminal/bundle_terminal.py +1 -1
- pyedb/grpc/database/terminal/padstack_instance_terminal.py +1 -1
- pyedb/grpc/database/terminal/pingroup_terminal.py +1 -1
- pyedb/grpc/database/utility/xml_control_file.py +5 -5
- pyedb/grpc/edb.py +73 -27
- pyedb/grpc/edb_init.py +3 -3
- pyedb/grpc/rpc_session.py +10 -10
- pyedb/libraries/common.py +366 -0
- pyedb/libraries/rf_libraries/base_functions.py +1358 -0
- pyedb/libraries/rf_libraries/planar_antennas.py +628 -0
- pyedb/misc/decorators.py +61 -0
- pyedb/misc/misc.py +0 -13
- pyedb/siwave.py +2 -2
- {pyedb-0.54.0.dist-info → pyedb-0.55.0.dist-info}/METADATA +1 -2
- {pyedb-0.54.0.dist-info → pyedb-0.55.0.dist-info}/RECORD +95 -91
- {pyedb-0.54.0.dist-info → pyedb-0.55.0.dist-info}/WHEEL +0 -0
- {pyedb-0.54.0.dist-info → pyedb-0.55.0.dist-info}/licenses/LICENSE +0 -0
pyedb/configuration/cfg_data.py
CHANGED
|
@@ -48,7 +48,9 @@ class CfgData(object):
|
|
|
48
48
|
self.boundaries = CfgBoundaries(self._pedb, kwargs.get("boundaries", {}))
|
|
49
49
|
|
|
50
50
|
self.nets = CfgNets(
|
|
51
|
-
self
|
|
51
|
+
self._pedb,
|
|
52
|
+
kwargs.get("nets", {}).get("signal_nets", []),
|
|
53
|
+
kwargs.get("nets", {}).get("power_ground_nets", []),
|
|
52
54
|
)
|
|
53
55
|
|
|
54
56
|
self.components = CfgComponents(self._pedb, components_data=kwargs.get("components", []))
|
|
@@ -73,7 +75,7 @@ class CfgData(object):
|
|
|
73
75
|
]
|
|
74
76
|
|
|
75
77
|
self.package_definitions = CfgPackageDefinitions(self._pedb, data=kwargs.get("package_definitions", []))
|
|
76
|
-
self.operations = CfgOperations(
|
|
78
|
+
self.operations = CfgOperations(**kwargs.get("operations", {}))
|
|
77
79
|
|
|
78
80
|
self.modeler = CfgModeler(self._pedb, data=kwargs.get("modeler", {}))
|
|
79
81
|
|
|
@@ -24,50 +24,27 @@
|
|
|
24
24
|
class CfgGeneral:
|
|
25
25
|
"""Manage configuration general settings."""
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
self.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
suppress_pads = self.pedb.active_cell.suppress_pads
|
|
39
|
-
data = {"anti_pads_always_on": anti_pads_always_on, "suppress_pads": suppress_pads}
|
|
40
|
-
return data
|
|
41
|
-
|
|
42
|
-
class DotNet(Grpc):
|
|
43
|
-
def __init__(self, parent):
|
|
44
|
-
super().__init__(parent)
|
|
45
|
-
|
|
46
|
-
def set_parameters_to_edb(self):
|
|
47
|
-
if self.parent.anti_pads_always_on is not None:
|
|
48
|
-
self.pedb.design_options.anti_pads_always_on = self.parent.anti_pads_always_on
|
|
49
|
-
if self.parent.suppress_pads is not None:
|
|
50
|
-
self.pedb.design_options.suppress_pads = self.parent.suppress_pads
|
|
51
|
-
|
|
52
|
-
def get_parameters_from_edb(self):
|
|
53
|
-
anti_pads_always_on = self.pedb.design_options.antipads_always_on
|
|
54
|
-
suppress_pads = self.pedb.design_options.suppress_pads
|
|
55
|
-
data = {"anti_pads_always_on": anti_pads_always_on, "suppress_pads": suppress_pads}
|
|
56
|
-
return data
|
|
27
|
+
def set_parameters_to_edb(self):
|
|
28
|
+
if self.anti_pads_always_on is not None:
|
|
29
|
+
self.pedb.design_options.anti_pads_always_on = self.anti_pads_always_on
|
|
30
|
+
if self.suppress_pads is not None:
|
|
31
|
+
self.pedb.design_options.suppress_pads = self.suppress_pads
|
|
32
|
+
|
|
33
|
+
def get_parameters_from_edb(self):
|
|
34
|
+
anti_pads_always_on = self.pedb.design_options.antipads_always_on
|
|
35
|
+
suppress_pads = self.pedb.design_options.suppress_pads
|
|
36
|
+
data = {"anti_pads_always_on": anti_pads_always_on, "suppress_pads": suppress_pads}
|
|
37
|
+
return data
|
|
57
38
|
|
|
58
39
|
def __init__(self, pedb, data):
|
|
59
40
|
self.pedb = pedb
|
|
60
|
-
if self.pedb.grpc:
|
|
61
|
-
self.api = self.Grpc(self)
|
|
62
|
-
else:
|
|
63
|
-
self.api = self.DotNet(self)
|
|
64
41
|
self.spice_model_library = data.get("spice_model_library", "")
|
|
65
42
|
self.s_parameter_library = data.get("s_parameter_library", "")
|
|
66
43
|
self.anti_pads_always_on = data.get("anti_pads_always_on", None)
|
|
67
44
|
self.suppress_pads = data.get("suppress_pads", None)
|
|
68
45
|
|
|
69
46
|
def apply(self):
|
|
70
|
-
self.
|
|
47
|
+
self.set_parameters_to_edb()
|
|
71
48
|
|
|
72
49
|
def get_data_from_db(self):
|
|
73
|
-
return self.
|
|
50
|
+
return self.get_parameters_from_edb()
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
# SOFTWARE.
|
|
22
|
-
|
|
22
|
+
from copy import deepcopy as copy
|
|
23
23
|
from dataclasses import dataclass, field
|
|
24
24
|
from typing import Any, Dict, List, Optional, TypedDict, Union
|
|
25
25
|
|
|
@@ -92,6 +92,7 @@ class CfgModeler:
|
|
|
92
92
|
self.add_trace(**trace_data)
|
|
93
93
|
|
|
94
94
|
for plane_data in data.get("planes", []):
|
|
95
|
+
plane_data = copy(plane_data)
|
|
95
96
|
shape = plane_data.pop("type")
|
|
96
97
|
if shape == "rectangle":
|
|
97
98
|
self.add_rectangular_plane(**plane_data)
|
pyedb/configuration/cfg_nets.py
CHANGED
|
@@ -24,39 +24,25 @@
|
|
|
24
24
|
class CfgNets:
|
|
25
25
|
"""Manage configuration net class."""
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
self.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
data = {"signal_nets": self.parent.signal_nets, "power_ground_nets": self.parent.power_nets}
|
|
47
|
-
return data
|
|
48
|
-
|
|
49
|
-
class DotNet(Grpc):
|
|
50
|
-
def __init__(self, parent):
|
|
51
|
-
self.parent = parent
|
|
52
|
-
super().__init__(parent)
|
|
53
|
-
|
|
54
|
-
def __init__(self, pdata, signal_nets=None, power_nets=None):
|
|
55
|
-
self._pedb = pdata._pedb
|
|
56
|
-
if self._pedb.grpc:
|
|
57
|
-
self.api = self.Grpc(self)
|
|
58
|
-
else:
|
|
59
|
-
self.api = self.DotNet(self)
|
|
27
|
+
def set_parameter_to_edb(self):
|
|
28
|
+
for signal_net in self.signal_nets:
|
|
29
|
+
if signal_net in self._pedb.nets:
|
|
30
|
+
self._pedb.nets.nets[signal_net].is_power_ground = False
|
|
31
|
+
for power_net in self.power_nets:
|
|
32
|
+
if power_net in self._pedb.nets:
|
|
33
|
+
self._pedb.nets.nets[power_net].is_power_ground = True
|
|
34
|
+
|
|
35
|
+
def get_parameter_from_edb(self):
|
|
36
|
+
"""Get net information."""
|
|
37
|
+
for net in self._pedb.nets.signal:
|
|
38
|
+
self.signal_nets.append(net)
|
|
39
|
+
for net in self._pedb.nets.power:
|
|
40
|
+
self.power_nets.append(net)
|
|
41
|
+
data = {"signal_nets": self.signal_nets, "power_ground_nets": self.power_nets}
|
|
42
|
+
return data
|
|
43
|
+
|
|
44
|
+
def __init__(self, pedb, signal_nets=None, power_nets=None):
|
|
45
|
+
self._pedb = pedb
|
|
60
46
|
self.signal_nets = []
|
|
61
47
|
self.power_nets = []
|
|
62
48
|
if signal_nets:
|
|
@@ -66,8 +52,8 @@ class CfgNets:
|
|
|
66
52
|
|
|
67
53
|
def apply(self):
|
|
68
54
|
"""Apply net on layout."""
|
|
69
|
-
self.
|
|
55
|
+
self.set_parameter_to_edb()
|
|
70
56
|
|
|
71
57
|
def get_data_from_db(self):
|
|
72
58
|
"""Get net information."""
|
|
73
|
-
return self.
|
|
59
|
+
return self.get_parameter_from_edb()
|
|
@@ -20,161 +20,32 @@
|
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
# SOFTWARE.
|
|
22
22
|
|
|
23
|
-
from
|
|
23
|
+
from typing import Any, Dict, List, Optional
|
|
24
24
|
|
|
25
|
+
from pydantic import BaseModel, Field
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
class Grpc:
|
|
28
|
-
def __init__(self, parent):
|
|
29
|
-
self.parent = parent
|
|
30
|
-
self._pedb = parent._pedb
|
|
27
|
+
# from pyedb.configuration.cfg_common import CfgBase
|
|
31
28
|
|
|
32
|
-
def get_parameters_from_edb(self):
|
|
33
|
-
if "pyedb_cutout" in self._pedb.stackup.all_layers:
|
|
34
|
-
polygons = self._pedb.layout.find_primitive(layer_name="pyedb_cutout")
|
|
35
|
-
if polygons:
|
|
36
|
-
poly = polygons[0]
|
|
37
|
-
self.parent.custom_extent = poly.polygon_data.points
|
|
38
|
-
net_names = []
|
|
39
|
-
for name, obj in self._pedb.nets.nets.items():
|
|
40
|
-
if obj.primitives:
|
|
41
|
-
if obj.primitives[0].layer.name == "pyedb_cutout":
|
|
42
|
-
continue
|
|
43
|
-
else:
|
|
44
|
-
net_names.append(name)
|
|
45
|
-
self.parent.reference_list = []
|
|
46
|
-
self.parent.signal_list = net_names
|
|
47
|
-
return self.parent.export_properties()
|
|
48
29
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
30
|
+
class CfgCutout(BaseModel):
|
|
31
|
+
auto_identify_nets: Optional[Dict] = {
|
|
32
|
+
"enabled": False,
|
|
33
|
+
"resistor_below": 100,
|
|
34
|
+
"inductor_below": 1,
|
|
35
|
+
"capacitor_above": 1,
|
|
36
|
+
}
|
|
37
|
+
signal_list: Optional[List[str]] = None
|
|
38
|
+
reference_list: Optional[List[str]] = None
|
|
39
|
+
extent_type: Optional[str] = "ConvexHull"
|
|
40
|
+
expansion_size: Optional[float] = 0.002
|
|
41
|
+
number_of_threads: Optional[int] = 1
|
|
42
|
+
custom_extent: Optional[Any] = None
|
|
43
|
+
custom_extent_units: str = Field(default="meter")
|
|
44
|
+
expansion_factor: Optional[float] = 0
|
|
52
45
|
|
|
53
|
-
def __init__(self, pedb, **kwargs):
|
|
54
|
-
self._pedb = pedb
|
|
55
|
-
if self._pedb.grpc:
|
|
56
|
-
self.api = self.Grpc(self)
|
|
57
|
-
else:
|
|
58
|
-
self.api = self.DotNet(self)
|
|
59
|
-
self.auto_identify_nets = kwargs.get("auto_identify_nets")
|
|
60
|
-
self.signal_list = kwargs.get("signal_list")
|
|
61
|
-
self.reference_list = kwargs.get("reference_list")
|
|
62
|
-
self.extent_type = kwargs.get("extent_type")
|
|
63
|
-
self.expansion_size = kwargs.get("expansion_size")
|
|
64
|
-
self.use_round_corner = kwargs.get("use_round_corner")
|
|
65
|
-
self.output_aedb_path = kwargs.get("output_aedb_path")
|
|
66
|
-
self.open_cutout_at_end = kwargs.get("open_cutout_at_end")
|
|
67
|
-
self.use_pyaedt_cutout = kwargs.get("use_pyaedt_cutout")
|
|
68
|
-
self.number_of_threads = kwargs.get("number_of_threads")
|
|
69
|
-
self.use_pyaedt_extent_computing = kwargs.get("use_pyaedt_extent_computing")
|
|
70
|
-
self.extent_defeature = kwargs.get("extent_defeature")
|
|
71
|
-
self.remove_single_pin_components = kwargs.get("remove_single_pin_components")
|
|
72
|
-
self.custom_extent = kwargs.get("custom_extent")
|
|
73
|
-
self.custom_extent_units = kwargs.get("custom_extent_units", "meter")
|
|
74
|
-
self.include_partial_instances = kwargs.get("include_partial_instances")
|
|
75
|
-
self.keep_voids = kwargs.get("keep_voids")
|
|
76
|
-
self.check_terminals = kwargs.get("check_terminals")
|
|
77
|
-
self.include_pingroups = kwargs.get("include_pingroups")
|
|
78
|
-
self.expansion_factor = kwargs.get("expansion_factor")
|
|
79
|
-
self.maximum_iterations = kwargs.get("maximum_iterations")
|
|
80
|
-
self.preserve_components_with_model = kwargs.get("preserve_components_with_model")
|
|
81
|
-
self.simple_pad_check = kwargs.get("simple_pad_check")
|
|
82
|
-
self.keep_lines_as_path = kwargs.get("keep_lines_as_path")
|
|
83
46
|
|
|
84
|
-
|
|
85
|
-
|
|
47
|
+
class CfgOperations(BaseModel):
|
|
48
|
+
cutout: Optional[CfgCutout] = None
|
|
86
49
|
|
|
87
|
-
def
|
|
88
|
-
|
|
89
|
-
"signal_list": self.signal_list,
|
|
90
|
-
"reference_list": self.reference_list,
|
|
91
|
-
"custom_extent": self.custom_extent,
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
class CfgOperations(CfgBase):
|
|
96
|
-
class Grpc:
|
|
97
|
-
def __init__(self, parent):
|
|
98
|
-
self.parent = parent
|
|
99
|
-
self._pedb = parent._pedb
|
|
100
|
-
|
|
101
|
-
def apply_on_edb(self):
|
|
102
|
-
if self.parent.op_cutout:
|
|
103
|
-
cutout_params = self.parent.op_cutout.get_attributes()
|
|
104
|
-
auto_identify_nets = cutout_params.pop("auto_identify_nets")
|
|
105
|
-
if auto_identify_nets["enabled"]:
|
|
106
|
-
reference_list = cutout_params.get("reference_list", [])
|
|
107
|
-
if auto_identify_nets:
|
|
108
|
-
self._pedb.nets.generate_extended_nets(
|
|
109
|
-
auto_identify_nets["resistor_below"],
|
|
110
|
-
auto_identify_nets["inductor_below"],
|
|
111
|
-
auto_identify_nets["capacitor_above"],
|
|
112
|
-
auto_identify_nets.get("exception_list", []),
|
|
113
|
-
)
|
|
114
|
-
signal_nets = []
|
|
115
|
-
for i in self._pedb.ports.values():
|
|
116
|
-
# Positive terminal
|
|
117
|
-
extended_net = i.net.extended_net
|
|
118
|
-
if extended_net:
|
|
119
|
-
temp = [i2 for i2 in extended_net.nets.keys() if i2 not in reference_list]
|
|
120
|
-
temp = [i2 for i2 in temp if i2 not in signal_nets]
|
|
121
|
-
signal_nets.extend(temp)
|
|
122
|
-
else:
|
|
123
|
-
signal_nets.append(i.net.name)
|
|
124
|
-
|
|
125
|
-
# Negative terminal
|
|
126
|
-
ref_net = i.ref_terminal.net if i.ref_terminal else None
|
|
127
|
-
if ref_net is None:
|
|
128
|
-
continue
|
|
129
|
-
elif ref_net.name not in reference_list:
|
|
130
|
-
extended_net = ref_net.extended_net
|
|
131
|
-
if extended_net:
|
|
132
|
-
temp = [i2 for i2 in extended_net.nets.keys() if i2 not in reference_list]
|
|
133
|
-
temp = [i2 for i2 in temp if i2 not in signal_nets]
|
|
134
|
-
signal_nets.extend(temp)
|
|
135
|
-
else:
|
|
136
|
-
signal_nets.append(ref_net.name)
|
|
137
|
-
|
|
138
|
-
cutout_params["signal_list"] = signal_nets
|
|
139
|
-
polygon_points = self._pedb.cutout(**cutout_params)
|
|
140
|
-
if "pyedb_cutout" not in self._pedb.stackup.all_layers:
|
|
141
|
-
self._pedb.stackup.add_document_layer(name="pyedb_cutout")
|
|
142
|
-
self._pedb.modeler.create_polygon(
|
|
143
|
-
polygon_points, layer_name="pyedb_cutout", net_name="pyedb_cutout"
|
|
144
|
-
)
|
|
145
|
-
|
|
146
|
-
def get_parameter_from_edb(self):
|
|
147
|
-
self.parent.op_cutout = CfgCutout(self._pedb)
|
|
148
|
-
data_from_db = self.parent.op_cutout.get_data_from_db()
|
|
149
|
-
if data_from_db:
|
|
150
|
-
return {"cutout": data_from_db}
|
|
151
|
-
else:
|
|
152
|
-
return {}
|
|
153
|
-
|
|
154
|
-
class DotNet(Grpc):
|
|
155
|
-
def __init__(self, parent):
|
|
156
|
-
super().__init__(parent)
|
|
157
|
-
|
|
158
|
-
def __init__(self, pedb, data):
|
|
159
|
-
self._pedb = pedb
|
|
160
|
-
if self._pedb.grpc:
|
|
161
|
-
self.api = self.Grpc(self)
|
|
162
|
-
else:
|
|
163
|
-
self.api = self.DotNet(self)
|
|
164
|
-
cutout = data.get("cutout", None)
|
|
165
|
-
if cutout:
|
|
166
|
-
auto_identify_nets = (
|
|
167
|
-
cutout.pop("auto_identify_nets")
|
|
168
|
-
if cutout.get("auto_identify_nets")
|
|
169
|
-
else {"enabled": False, "resistor_below": 100, "inductor_below": 1, "capacitor_above": 1}
|
|
170
|
-
)
|
|
171
|
-
self.op_cutout = CfgCutout(pedb, auto_identify_nets=auto_identify_nets, **cutout)
|
|
172
|
-
else:
|
|
173
|
-
self.op_cutout = None
|
|
174
|
-
|
|
175
|
-
def apply(self):
|
|
176
|
-
"""Imports operation information from JSON."""
|
|
177
|
-
self.api.apply_on_edb()
|
|
178
|
-
|
|
179
|
-
def get_data_from_db(self):
|
|
180
|
-
return self.api.get_parameter_from_edb()
|
|
50
|
+
def add_cutout(self, **kwargs):
|
|
51
|
+
self.cutout = CfgCutout(**kwargs)
|
|
@@ -63,123 +63,67 @@ class CfgHeatSink(CfgBase):
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
class CfgPackageDefinitions:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
hs = {}
|
|
121
|
-
hs_attrs = [i for i in dir(hs_obj) if not i.startswith("_")]
|
|
122
|
-
hs_attrs = [i for i in hs_attrs if i in CfgHeatSink().__dict__]
|
|
123
|
-
for hs_attr_name in hs_attrs:
|
|
124
|
-
hs[hs_attr_name] = getattr(hs_obj, hs_attr_name)
|
|
125
|
-
pkg["heatsink"] = hs
|
|
126
|
-
package_definitions.append(pkg)
|
|
127
|
-
|
|
128
|
-
return package_definitions
|
|
129
|
-
|
|
130
|
-
class DotNet(Grpc):
|
|
131
|
-
def __init__(self, parent):
|
|
132
|
-
super().__init__(parent)
|
|
133
|
-
|
|
134
|
-
def set_parameter_to_edb(self):
|
|
135
|
-
from pyedb.dotnet.database.definition.package_def import PackageDef
|
|
136
|
-
|
|
137
|
-
for pkg in self.parent.packages:
|
|
138
|
-
comp_def_from_db = self._pedb.definitions.component[pkg.component_definition]
|
|
139
|
-
if pkg.name in self._pedb.definitions.package:
|
|
140
|
-
self._pedb.definitions.package[pkg.name].delete()
|
|
141
|
-
|
|
142
|
-
if pkg.extent_bounding_box:
|
|
143
|
-
package_def = PackageDef(self._pedb, name=pkg.name, extent_bounding_box=pkg.extent_bounding_box)
|
|
144
|
-
else:
|
|
145
|
-
package_def = PackageDef(self._pedb, name=pkg.name, component_part_name=pkg.component_definition)
|
|
146
|
-
pkg.set_attributes(package_def)
|
|
147
|
-
|
|
148
|
-
if pkg.heatsink:
|
|
149
|
-
attrs = pkg.heatsink.get_attributes()
|
|
150
|
-
for attr, value in attrs.items():
|
|
151
|
-
package_def.set_heatsink(**attrs)
|
|
152
|
-
|
|
153
|
-
comp_list = dict()
|
|
154
|
-
if pkg.apply_to_all:
|
|
155
|
-
comp_list.update(
|
|
156
|
-
{
|
|
157
|
-
refdes: comp
|
|
158
|
-
for refdes, comp in comp_def_from_db.components.items()
|
|
159
|
-
if refdes not in pkg.components
|
|
160
|
-
}
|
|
161
|
-
)
|
|
162
|
-
else:
|
|
163
|
-
comp_list.update(
|
|
164
|
-
{
|
|
165
|
-
refdes: comp
|
|
166
|
-
for refdes, comp in comp_def_from_db.components.items()
|
|
167
|
-
if refdes in pkg.components
|
|
168
|
-
}
|
|
169
|
-
)
|
|
170
|
-
for _, i in comp_list.items():
|
|
171
|
-
i.package_def = pkg.name
|
|
66
|
+
def get_parameter_from_edb(self):
|
|
67
|
+
package_definitions = []
|
|
68
|
+
for pkg_name, pkg_obj in self._pedb.definitions.package.items():
|
|
69
|
+
pkg = {}
|
|
70
|
+
pkg_attrs = [i for i in dir(pkg_obj) if not i.startswith("_")]
|
|
71
|
+
pkg_attrs = {i for i in pkg_attrs if i in CfgPackage().__dict__}
|
|
72
|
+
for pkg_attr_name in pkg_attrs:
|
|
73
|
+
pkg[pkg_attr_name] = getattr(pkg_obj, pkg_attr_name)
|
|
74
|
+
hs_obj = pkg_obj.heatsink
|
|
75
|
+
if hs_obj:
|
|
76
|
+
hs = {}
|
|
77
|
+
hs_attrs = [i for i in dir(hs_obj) if not i.startswith("_")]
|
|
78
|
+
hs_attrs = [i for i in hs_attrs if i in CfgHeatSink().__dict__]
|
|
79
|
+
for hs_attr_name in hs_attrs:
|
|
80
|
+
hs[hs_attr_name] = getattr(hs_obj, hs_attr_name)
|
|
81
|
+
pkg["heatsink"] = hs
|
|
82
|
+
package_definitions.append(pkg)
|
|
83
|
+
|
|
84
|
+
return package_definitions
|
|
85
|
+
|
|
86
|
+
def set_parameter_to_edb(self):
|
|
87
|
+
from pyedb.dotnet.database.definition.package_def import PackageDef
|
|
88
|
+
|
|
89
|
+
for pkg in self.packages:
|
|
90
|
+
comp_def_from_db = self._pedb.definitions.component[pkg.component_definition]
|
|
91
|
+
if pkg.name in self._pedb.definitions.package:
|
|
92
|
+
self._pedb.definitions.package[pkg.name].delete()
|
|
93
|
+
|
|
94
|
+
if pkg.extent_bounding_box:
|
|
95
|
+
package_def = PackageDef(self._pedb, name=pkg.name, extent_bounding_box=pkg.extent_bounding_box)
|
|
96
|
+
else:
|
|
97
|
+
package_def = PackageDef(self._pedb, name=pkg.name, component_part_name=pkg.component_definition)
|
|
98
|
+
pkg.set_attributes(package_def)
|
|
99
|
+
|
|
100
|
+
if pkg.heatsink:
|
|
101
|
+
attrs = pkg.heatsink.get_attributes()
|
|
102
|
+
for attr, value in attrs.items():
|
|
103
|
+
package_def.set_heatsink(**attrs)
|
|
104
|
+
|
|
105
|
+
comp_list = dict()
|
|
106
|
+
if pkg.apply_to_all:
|
|
107
|
+
comp_list.update(
|
|
108
|
+
{
|
|
109
|
+
refdes: comp
|
|
110
|
+
for refdes, comp in comp_def_from_db.components.items()
|
|
111
|
+
if refdes not in pkg.components
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
else:
|
|
115
|
+
comp_list.update(
|
|
116
|
+
{refdes: comp for refdes, comp in comp_def_from_db.components.items() if refdes in pkg.components}
|
|
117
|
+
)
|
|
118
|
+
for _, i in comp_list.items():
|
|
119
|
+
i.package_def = pkg.name
|
|
172
120
|
|
|
173
121
|
def __init__(self, pedb, data):
|
|
174
122
|
self._pedb = pedb
|
|
175
|
-
if self._pedb.grpc:
|
|
176
|
-
self.api = self.Grpc(self)
|
|
177
|
-
else:
|
|
178
|
-
self.api = self.DotNet(self)
|
|
179
123
|
self.packages = [CfgPackage(**package) for package in data]
|
|
180
124
|
|
|
181
125
|
def apply(self):
|
|
182
|
-
self.
|
|
126
|
+
self.set_parameter_to_edb()
|
|
183
127
|
|
|
184
128
|
def get_data_from_db(self):
|
|
185
|
-
return self.
|
|
129
|
+
return self.get_parameter_from_edb()
|