pyedb 0.37.0__py3-none-any.whl → 0.39.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 -1
- pyedb/common/nets.py +53 -139
- pyedb/configuration/cfg_common.py +1 -1
- pyedb/configuration/cfg_components.py +229 -201
- pyedb/configuration/cfg_data.py +3 -1
- pyedb/configuration/cfg_general.py +4 -2
- pyedb/configuration/cfg_modeler.py +7 -7
- pyedb/configuration/cfg_package_definition.py +1 -1
- pyedb/configuration/cfg_padstacks.py +346 -290
- pyedb/configuration/cfg_ports_sources.py +243 -65
- pyedb/configuration/configuration.py +23 -3
- pyedb/dotnet/{application → database}/Variables.py +21 -21
- pyedb/dotnet/{edb_core → database}/cell/connectable.py +5 -5
- pyedb/dotnet/{edb_core → database}/cell/hierarchy/component.py +11 -11
- pyedb/dotnet/{edb_core → database}/cell/hierarchy/hierarchy_obj.py +1 -1
- pyedb/dotnet/{edb_core → database}/cell/hierarchy/model.py +1 -1
- pyedb/dotnet/{edb_core → database}/cell/layout.py +19 -19
- pyedb/dotnet/{edb_core → database}/cell/layout_obj.py +3 -3
- pyedb/dotnet/{edb_core → database}/cell/primitive/bondwire.py +1 -1
- pyedb/dotnet/{edb_core → database}/cell/primitive/path.py +4 -4
- pyedb/dotnet/{edb_core → database}/cell/primitive/primitive.py +14 -14
- pyedb/dotnet/{edb_core → database}/cell/terminal/bundle_terminal.py +2 -2
- pyedb/dotnet/{edb_core → database}/cell/terminal/edge_terminal.py +4 -4
- pyedb/dotnet/{edb_core → database}/cell/terminal/padstack_instance_terminal.py +2 -2
- pyedb/dotnet/{edb_core → database}/cell/terminal/pingroup_terminal.py +2 -2
- pyedb/dotnet/{edb_core → database}/cell/terminal/point_terminal.py +2 -2
- pyedb/dotnet/{edb_core → database}/cell/terminal/terminal.py +11 -11
- pyedb/dotnet/{edb_core → database}/cell/voltage_regulator.py +2 -2
- pyedb/dotnet/{edb_core → database}/components.py +101 -124
- pyedb/dotnet/{edb_core → database}/definition/component_def.py +5 -5
- pyedb/dotnet/{edb_core → database}/definition/component_model.py +1 -1
- pyedb/dotnet/{edb_core → database}/definition/definition_obj.py +1 -1
- pyedb/dotnet/{edb_core → database}/definition/definitions.py +2 -2
- pyedb/dotnet/{edb_core → database}/definition/package_def.py +4 -4
- pyedb/dotnet/{edb_core → database}/dotnet/database.py +8 -8
- pyedb/dotnet/{edb_core → database}/dotnet/primitive.py +9 -9
- pyedb/dotnet/{edb_core → database}/edb_data/control_file.py +12 -12
- pyedb/dotnet/{edb_core → database}/edb_data/hfss_extent_info.py +7 -7
- pyedb/dotnet/{edb_core → database}/edb_data/nets_data.py +10 -13
- pyedb/dotnet/{edb_core → database}/edb_data/padstacks_data.py +60 -73
- pyedb/dotnet/{edb_core → database}/edb_data/ports.py +4 -4
- pyedb/dotnet/{edb_core → database}/edb_data/primitives_data.py +5 -5
- pyedb/dotnet/{edb_core → database}/edb_data/raptor_x_simulation_setup_data.py +4 -4
- pyedb/dotnet/{edb_core → database}/edb_data/simulation_configuration.py +10 -10
- pyedb/dotnet/{edb_core → database}/edb_data/sources.py +4 -4
- pyedb/dotnet/{edb_core → database}/edb_data/variables.py +1 -1
- pyedb/dotnet/{edb_core → database}/geometry/polygon_data.py +4 -4
- pyedb/dotnet/{edb_core → database}/hfss.py +8 -8
- pyedb/dotnet/{edb_core → database}/layout_obj_instance.py +1 -1
- pyedb/dotnet/{edb_core → database}/layout_validation.py +2 -2
- pyedb/dotnet/{edb_core → database}/materials.py +23 -8
- pyedb/dotnet/{edb_core → database}/modeler.py +27 -27
- pyedb/dotnet/{edb_core → database}/net_class.py +8 -8
- pyedb/dotnet/{edb_core → database}/nets.py +12 -12
- pyedb/dotnet/{edb_core → database}/padstack.py +17 -16
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/mesh_operation.py +1 -1
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/settings.py +18 -3
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/sim_setup_info.py +2 -2
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/simulation_settings.py +1 -1
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/siw_dc_ir_settings.py +1 -1
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/sweep_data.py +4 -4
- pyedb/dotnet/{edb_core → database}/siwave.py +10 -10
- pyedb/dotnet/{edb_core → database}/stackup.py +12 -12
- pyedb/dotnet/{edb_core → database}/utilities/hfss_simulation_setup.py +15 -15
- pyedb/dotnet/{edb_core → database}/utilities/obj_base.py +1 -1
- pyedb/dotnet/{edb_core → database}/utilities/simulation_setup.py +4 -3
- pyedb/dotnet/{edb_core → database}/utilities/siwave_simulation_setup.py +6 -6
- pyedb/dotnet/edb.py +118 -113
- pyedb/extensions/pre_layout_design_toolkit/via_design.py +1151 -0
- pyedb/generic/design_types.py +26 -19
- pyedb/generic/general_methods.py +1 -1
- pyedb/generic/plot.py +0 -2
- pyedb/grpc/database/__init__.py +1 -0
- pyedb/grpc/database/components.py +2354 -0
- pyedb/grpc/database/control_file.py +1277 -0
- pyedb/grpc/database/definition/component_def.py +218 -0
- pyedb/grpc/database/definition/component_model.py +39 -0
- pyedb/grpc/database/definition/component_pin.py +32 -0
- pyedb/grpc/database/definition/materials.py +1207 -0
- pyedb/grpc/database/definition/n_port_component_model.py +34 -0
- pyedb/grpc/database/definition/package_def.py +227 -0
- pyedb/grpc/database/definition/padstack_def.py +842 -0
- pyedb/grpc/database/definitions.py +70 -0
- pyedb/grpc/database/general.py +43 -0
- pyedb/grpc/database/geometry/__init__.py +0 -0
- pyedb/grpc/database/geometry/arc_data.py +93 -0
- pyedb/grpc/database/geometry/point_3d_data.py +79 -0
- pyedb/grpc/database/geometry/point_data.py +30 -0
- pyedb/grpc/database/geometry/polygon_data.py +133 -0
- pyedb/grpc/database/hfss.py +1279 -0
- pyedb/grpc/database/hierarchy/__init__.py +0 -0
- pyedb/grpc/database/hierarchy/component.py +1301 -0
- pyedb/grpc/database/hierarchy/model.py +31 -0
- pyedb/grpc/database/hierarchy/netlist_model.py +30 -0
- pyedb/grpc/database/hierarchy/pin_pair_model.py +128 -0
- pyedb/grpc/database/hierarchy/pingroup.py +245 -0
- pyedb/grpc/database/hierarchy/s_parameter_model.py +33 -0
- pyedb/grpc/database/hierarchy/spice_model.py +48 -0
- pyedb/grpc/database/layers/__init__.py +0 -0
- pyedb/grpc/database/layers/layer.py +57 -0
- pyedb/grpc/database/layers/stackup_layer.py +410 -0
- pyedb/grpc/database/layout/__init__.py +0 -0
- pyedb/grpc/database/layout/cell.py +30 -0
- pyedb/grpc/database/layout/layout.py +196 -0
- pyedb/grpc/database/layout/voltage_regulator.py +149 -0
- pyedb/grpc/database/layout_validation.py +319 -0
- pyedb/grpc/database/modeler.py +1468 -0
- pyedb/grpc/database/net/__init__.py +0 -0
- pyedb/grpc/database/net/differential_pair.py +138 -0
- pyedb/grpc/database/net/extended_net.py +340 -0
- pyedb/grpc/database/net/net.py +198 -0
- pyedb/grpc/database/net/net_class.py +93 -0
- pyedb/grpc/database/nets.py +633 -0
- pyedb/grpc/database/padstacks.py +1500 -0
- pyedb/grpc/database/ports/__init__.py +0 -0
- pyedb/grpc/database/ports/ports.py +396 -0
- pyedb/grpc/database/primitive/__init__.py +3 -0
- pyedb/grpc/database/primitive/bondwire.py +181 -0
- pyedb/grpc/database/primitive/circle.py +75 -0
- pyedb/grpc/database/primitive/padstack_instance.py +1116 -0
- pyedb/grpc/database/primitive/path.py +346 -0
- pyedb/grpc/database/primitive/polygon.py +276 -0
- pyedb/grpc/database/primitive/primitive.py +739 -0
- pyedb/grpc/database/primitive/rectangle.py +146 -0
- pyedb/grpc/database/simulation_setup/__init__.py +0 -0
- pyedb/grpc/database/simulation_setup/adaptive_frequency.py +33 -0
- pyedb/grpc/database/simulation_setup/hfss_advanced_meshing_settings.py +32 -0
- pyedb/grpc/database/simulation_setup/hfss_advanced_settings.py +59 -0
- pyedb/grpc/database/simulation_setup/hfss_dcr_settings.py +35 -0
- pyedb/grpc/database/simulation_setup/hfss_general_settings.py +61 -0
- pyedb/grpc/database/simulation_setup/hfss_settings_options.py +78 -0
- pyedb/grpc/database/simulation_setup/hfss_simulation_settings.py +118 -0
- pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +355 -0
- pyedb/grpc/database/simulation_setup/hfss_solver_settings.py +34 -0
- pyedb/grpc/database/simulation_setup/mesh_operation.py +34 -0
- pyedb/grpc/database/simulation_setup/raptor_x_advanced_settings.py +34 -0
- pyedb/grpc/database/simulation_setup/raptor_x_general_settings.py +33 -0
- pyedb/grpc/database/simulation_setup/raptor_x_simulation_settings.py +64 -0
- pyedb/grpc/database/simulation_setup/raptor_x_simulation_setup.py +125 -0
- pyedb/grpc/database/simulation_setup/siwave_dcir_simulation_setup.py +34 -0
- pyedb/grpc/database/simulation_setup/siwave_simulation_setup.py +119 -0
- pyedb/grpc/database/simulation_setup/sweep_data.py +32 -0
- pyedb/grpc/database/siwave.py +1023 -0
- pyedb/grpc/database/source_excitations.py +2572 -0
- pyedb/grpc/database/stackup.py +2574 -0
- pyedb/grpc/database/terminal/__init__.py +0 -0
- pyedb/grpc/database/terminal/bundle_terminal.py +218 -0
- pyedb/grpc/database/terminal/edge_terminal.py +51 -0
- pyedb/grpc/database/terminal/padstack_instance_terminal.py +171 -0
- pyedb/grpc/database/terminal/pingroup_terminal.py +162 -0
- pyedb/grpc/database/terminal/point_terminal.py +99 -0
- pyedb/grpc/database/terminal/terminal.py +470 -0
- pyedb/grpc/database/utility/__init__.py +3 -0
- pyedb/grpc/database/utility/constants.py +25 -0
- pyedb/grpc/database/utility/heat_sink.py +124 -0
- pyedb/grpc/database/utility/hfss_extent_info.py +448 -0
- pyedb/grpc/database/utility/layout_statistics.py +277 -0
- pyedb/grpc/database/utility/rlc.py +80 -0
- pyedb/grpc/database/utility/simulation_configuration.py +3305 -0
- pyedb/grpc/database/utility/sources.py +388 -0
- pyedb/grpc/database/utility/sweep_data_distribution.py +83 -0
- pyedb/grpc/database/utility/xml_control_file.py +1277 -0
- pyedb/grpc/edb.py +4151 -0
- pyedb/grpc/edb_init.py +481 -0
- pyedb/grpc/rpc_session.py +177 -0
- pyedb/ipc2581/ecad/cad_data/assembly_drawing.py +3 -2
- pyedb/ipc2581/ecad/cad_data/feature.py +4 -3
- pyedb/ipc2581/ecad/cad_data/layer_feature.py +32 -20
- pyedb/ipc2581/ecad/cad_data/outline.py +3 -2
- pyedb/ipc2581/ecad/cad_data/package.py +4 -3
- pyedb/ipc2581/ecad/cad_data/path.py +82 -31
- pyedb/ipc2581/ecad/cad_data/polygon.py +122 -60
- pyedb/ipc2581/ecad/cad_data/profile.py +13 -12
- pyedb/ipc2581/ecad/cad_data/step.py +52 -20
- pyedb/ipc2581/ipc2581.py +47 -49
- pyedb/modeler/geometry_operators.py +1 -1
- {pyedb-0.37.0.dist-info → pyedb-0.39.0.dist-info}/METADATA +9 -6
- pyedb-0.39.0.dist-info/RECORD +288 -0
- pyedb-0.37.0.dist-info/RECORD +0 -194
- /pyedb/dotnet/{edb_core → database}/__init__.py +0 -0
- /pyedb/dotnet/{application → database/cell}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/cell → database/cell/hierarchy}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/hierarchy/netlist_model.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/hierarchy/pin_pair_model.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/hierarchy/s_parameter_model.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/hierarchy/spice_model.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/primitive/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/cell/hierarchy → database/cell/terminal}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/cell/terminal → database/definition}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/definition → database/dotnet}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/dotnet → database/edb_data}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/edb_data/design_options.py +0 -0
- /pyedb/dotnet/{edb_core → database}/edb_data/edbvalue.py +0 -0
- /pyedb/dotnet/{edb_core → database}/edb_data/layer_data.py +0 -0
- /pyedb/dotnet/{edb_core → database}/edb_data/utilities.py +0 -0
- /pyedb/dotnet/{edb_core → database}/general.py +0 -0
- /pyedb/dotnet/{edb_core/edb_data → database/geometry}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/geometry/point_data.py +0 -0
- /pyedb/dotnet/{edb_core → database}/sim_setup_data/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/sim_setup_data/data/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/sim_setup_data/data/adaptive_frequency_data.py +0 -0
- /pyedb/dotnet/{edb_core/geometry → database/sim_setup_data/io}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/sim_setup_data/io/siwave.py +0 -0
- /pyedb/dotnet/{edb_core → database}/utilities/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/utilities/heatsink.py +0 -0
- /pyedb/{dotnet/edb_core/sim_setup_data/io → grpc/database/definition}/__init__.py +0 -0
- {pyedb-0.37.0.dist-info → pyedb-0.39.0.dist-info}/LICENSE +0 -0
- {pyedb-0.37.0.dist-info → pyedb-0.39.0.dist-info}/WHEEL +0 -0
|
@@ -29,8 +29,9 @@ from pyedb.ipc2581.ecad.cad_data.feature import Feature, FeatureType
|
|
|
29
29
|
class LayerFeature(object):
|
|
30
30
|
"""Class describing IPC2581 layer feature."""
|
|
31
31
|
|
|
32
|
-
def __init__(self, ipc):
|
|
32
|
+
def __init__(self, ipc, pedb):
|
|
33
33
|
self._ipc = ipc
|
|
34
|
+
self._pedb = pedb
|
|
34
35
|
self.layer_name = ""
|
|
35
36
|
self.color = ""
|
|
36
37
|
self._features = []
|
|
@@ -48,12 +49,15 @@ class LayerFeature(object):
|
|
|
48
49
|
|
|
49
50
|
def add_feature(self, obj_instance=None): # pragma no cover
|
|
50
51
|
if obj_instance:
|
|
51
|
-
feature = Feature(self._ipc)
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
feature = Feature(self._ipc, self._pedb)
|
|
53
|
+
if obj_instance.net_name:
|
|
54
|
+
feature.net = obj_instance.net_name
|
|
55
|
+
else:
|
|
56
|
+
feature.net = ""
|
|
57
|
+
if obj_instance.type.lower() == "polygon":
|
|
54
58
|
feature.feature_type = FeatureType.Polygon
|
|
55
59
|
feature.polygon.add_poly_step(obj_instance)
|
|
56
|
-
elif obj_instance.type == "
|
|
60
|
+
elif obj_instance.type.lower() == "path":
|
|
57
61
|
feature.feature_type = FeatureType.Path
|
|
58
62
|
feature.path.add_path_step(obj_instance)
|
|
59
63
|
self.features.append(feature)
|
|
@@ -62,7 +66,7 @@ class LayerFeature(object):
|
|
|
62
66
|
|
|
63
67
|
def add_via_instance_feature(self, padstack_inst=None, padstackdef=None, layer_name=None): # pragma no cover
|
|
64
68
|
if padstack_inst and padstackdef:
|
|
65
|
-
feature = Feature(self._ipc)
|
|
69
|
+
feature = Feature(self._ipc, self._pedb)
|
|
66
70
|
def_name = padstackdef.name
|
|
67
71
|
position = padstack_inst.position if padstack_inst.position else padstack_inst.position
|
|
68
72
|
feature.padstack_instance.net = padstack_inst.net_name
|
|
@@ -71,11 +75,14 @@ class LayerFeature(object):
|
|
|
71
75
|
feature.feature_type = FeatureType.PadstackInstance
|
|
72
76
|
feature.padstack_instance.x = self._ipc.from_meter_to_units(position[0], self._ipc.units)
|
|
73
77
|
feature.padstack_instance.y = self._ipc.from_meter_to_units(position[1], self._ipc.units)
|
|
74
|
-
if
|
|
75
|
-
|
|
78
|
+
if not self._pedb.grpc:
|
|
79
|
+
if padstackdef._hole_params is None:
|
|
80
|
+
hole_props = [i.ToDouble() for i in padstackdef.hole_params[2]]
|
|
81
|
+
else:
|
|
82
|
+
hole_props = [i.ToDouble() for i in padstackdef._hole_params[2]]
|
|
83
|
+
feature.padstack_instance.diameter = float(hole_props[0]) if hole_props else 0
|
|
76
84
|
else:
|
|
77
|
-
|
|
78
|
-
feature.padstack_instance.diameter = float(hole_props[0]) if hole_props else 0
|
|
85
|
+
feature.padstack_instance.diameter = padstackdef.hole_diameter
|
|
79
86
|
feature.padstack_instance.hole_name = def_name
|
|
80
87
|
feature.padstack_instance.name = padstack_inst.name
|
|
81
88
|
try:
|
|
@@ -96,7 +103,7 @@ class LayerFeature(object):
|
|
|
96
103
|
pass
|
|
97
104
|
|
|
98
105
|
def add_drill_feature(self, via, diameter=0.0): # pragma no cover
|
|
99
|
-
feature = Feature(self._ipc)
|
|
106
|
+
feature = Feature(self._ipc, self._pedb)
|
|
100
107
|
feature.feature_type = FeatureType.Drill
|
|
101
108
|
feature.drill.net = via.net_name
|
|
102
109
|
position = via._position if via._position else via.position
|
|
@@ -113,14 +120,19 @@ class LayerFeature(object):
|
|
|
113
120
|
is_via = False
|
|
114
121
|
if not pin.start_layer == pin.stop_layer:
|
|
115
122
|
is_via = True
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
123
|
+
if not self._pedb.grpc:
|
|
124
|
+
pin_net = pin._edb_object.GetNet().GetName()
|
|
125
|
+
pos_rot = pin._edb_padstackinstance.GetPositionAndRotationValue()
|
|
126
|
+
pin_rotation = pos_rot[2].ToDouble()
|
|
127
|
+
if pin._edb_padstackinstance.IsLayoutPin():
|
|
128
|
+
out2 = pin._edb_padstackinstance.GetComponent().GetTransform().TransformPoint(pos_rot[1])
|
|
129
|
+
pin_position = [out2.X.ToDouble(), out2.Y.ToDouble()]
|
|
130
|
+
else:
|
|
131
|
+
pin_position = [pos_rot[1].X.ToDouble(), pos_rot[1].Y.ToDouble()]
|
|
122
132
|
else:
|
|
123
|
-
|
|
133
|
+
pin_net = pin.net_name
|
|
134
|
+
pin_rotation = pin.rotation
|
|
135
|
+
pin_position = pin.position
|
|
124
136
|
pin_x = self._ipc.from_meter_to_units(pin_position[0], self._ipc.units)
|
|
125
137
|
pin_y = self._ipc.from_meter_to_units(pin_position[1], self._ipc.units)
|
|
126
138
|
cmp_rot_deg = component.rotation * 180 / math.pi
|
|
@@ -131,11 +143,11 @@ class LayerFeature(object):
|
|
|
131
143
|
comp_placement_layer = component.placement_layer
|
|
132
144
|
if comp_placement_layer == top_bottom_layers[-1]:
|
|
133
145
|
mirror = True
|
|
134
|
-
feature = Feature(self._ipc)
|
|
146
|
+
feature = Feature(self._ipc, self._pedb)
|
|
135
147
|
feature.feature_type = FeatureType.PadstackInstance
|
|
136
148
|
feature.net = pin_net
|
|
137
149
|
feature.padstack_instance.net = pin_net
|
|
138
|
-
feature.padstack_instance.pin = pin.
|
|
150
|
+
feature.padstack_instance.pin = pin.name
|
|
139
151
|
feature.padstack_instance.x = pin_x
|
|
140
152
|
feature.padstack_instance.y = pin_y
|
|
141
153
|
feature.padstack_instance.rotation = rotation
|
|
@@ -27,9 +27,10 @@ from pyedb.ipc2581.ecad.cad_data.polygon import Polygon
|
|
|
27
27
|
class Outline:
|
|
28
28
|
"""Class describing an IPC2581 outline."""
|
|
29
29
|
|
|
30
|
-
def __init__(self, ipc):
|
|
30
|
+
def __init__(self, ipc, pedb):
|
|
31
31
|
self._ipc = ipc
|
|
32
|
-
self.
|
|
32
|
+
self._pedb = pedb
|
|
33
|
+
self.polygon = Polygon(self._ipc, pedb)
|
|
33
34
|
self.line_ref = ""
|
|
34
35
|
|
|
35
36
|
def write_xml(self, package): # pragma no cover
|
|
@@ -33,15 +33,16 @@ from pyedb.ipc2581.ecad.cad_data.polygon import PolyStep
|
|
|
33
33
|
class Package(object):
|
|
34
34
|
"""Class describing an IPC2581 package definition."""
|
|
35
35
|
|
|
36
|
-
def __init__(self, ipc):
|
|
36
|
+
def __init__(self, ipc, pedb):
|
|
37
37
|
self._ipc = ipc
|
|
38
|
+
self._pedb = pedb
|
|
38
39
|
self.name = ""
|
|
39
40
|
self.type = "OTHER"
|
|
40
41
|
self.pin_one = "1"
|
|
41
42
|
self.pin_orientation = "OTHER"
|
|
42
43
|
self.height = 0.1
|
|
43
|
-
self.assembly_drawing = AssemblyDrawing(self._ipc)
|
|
44
|
-
self.outline = Outline(self._ipc)
|
|
44
|
+
self.assembly_drawing = AssemblyDrawing(self._ipc, pedb)
|
|
45
|
+
self.outline = Outline(self._ipc, pedb)
|
|
45
46
|
self._pins = []
|
|
46
47
|
self.pickup_point = [0.0, 0.0]
|
|
47
48
|
|
|
@@ -28,8 +28,9 @@ from pyedb.ipc2581.ecad.cad_data.polygon import PolyStep, PolyType
|
|
|
28
28
|
class Path(object):
|
|
29
29
|
"""Class describing an IPC2581 trace."""
|
|
30
30
|
|
|
31
|
-
def __init__(self, ipc):
|
|
31
|
+
def __init__(self, ipc, pedb):
|
|
32
32
|
self._ipc = ipc
|
|
33
|
+
self._pedb = pedb
|
|
33
34
|
self.location_x = 0.0
|
|
34
35
|
self.location_y = 0.0
|
|
35
36
|
self.poly_steps = []
|
|
@@ -37,38 +38,22 @@ class Path(object):
|
|
|
37
38
|
self.width_ref_id = ""
|
|
38
39
|
|
|
39
40
|
def add_path_step(self, path_step=None): # pragma no cover
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
new_segment_tep.x = arc.Start.X.ToDouble()
|
|
53
|
-
new_segment_tep.y = arc.Start.Y.ToDouble()
|
|
54
|
-
self.poly_steps.append(new_segment_tep)
|
|
55
|
-
if arc.Height == 0:
|
|
41
|
+
if not self._pedb.grpc:
|
|
42
|
+
arcs = path_step.primitive_object.GetCenterLine().GetArcData()
|
|
43
|
+
if not arcs:
|
|
44
|
+
return
|
|
45
|
+
self.line_width = self._ipc.from_meter_to_units(path_step.primitive_object.GetWidth(), self._ipc.units)
|
|
46
|
+
self.width_ref_id = "ROUND_{}".format(self.line_width)
|
|
47
|
+
if not self.width_ref_id in self._ipc.content.dict_line.dict_lines:
|
|
48
|
+
entry_line = EntryLine()
|
|
49
|
+
entry_line.line_width = self.line_width
|
|
50
|
+
self._ipc.content.dict_line.dict_lines[self.width_ref_id] = entry_line
|
|
51
|
+
# first point
|
|
52
|
+
arc = arcs[0]
|
|
56
53
|
new_segment_tep = PolyStep()
|
|
57
|
-
new_segment_tep.
|
|
58
|
-
new_segment_tep.
|
|
59
|
-
new_segment_tep.y = arc.End.Y.ToDouble()
|
|
54
|
+
new_segment_tep.x = arc.Start.X.ToDouble()
|
|
55
|
+
new_segment_tep.y = arc.Start.Y.ToDouble()
|
|
60
56
|
self.poly_steps.append(new_segment_tep)
|
|
61
|
-
else:
|
|
62
|
-
arc_center = arc.GetCenter()
|
|
63
|
-
new_poly_step = PolyStep()
|
|
64
|
-
new_poly_step.poly_type = PolyType.Curve
|
|
65
|
-
new_poly_step.center_X = arc_center.X.ToDouble()
|
|
66
|
-
new_poly_step.center_y = arc_center.Y.ToDouble()
|
|
67
|
-
new_poly_step.x = arc.End.X.ToDouble()
|
|
68
|
-
new_poly_step.y = arc.End.Y.ToDouble()
|
|
69
|
-
new_poly_step.clock_wise = not arc.IsCCW()
|
|
70
|
-
self.poly_steps.append(new_poly_step)
|
|
71
|
-
for arc in list(arcs)[1:]:
|
|
72
57
|
if arc.Height == 0:
|
|
73
58
|
new_segment_tep = PolyStep()
|
|
74
59
|
new_segment_tep.poly_type = PolyType.Segment
|
|
@@ -85,6 +70,72 @@ class Path(object):
|
|
|
85
70
|
new_poly_step.y = arc.End.Y.ToDouble()
|
|
86
71
|
new_poly_step.clock_wise = not arc.IsCCW()
|
|
87
72
|
self.poly_steps.append(new_poly_step)
|
|
73
|
+
for arc in list(arcs)[1:]:
|
|
74
|
+
if arc.Height == 0:
|
|
75
|
+
new_segment_tep = PolyStep()
|
|
76
|
+
new_segment_tep.poly_type = PolyType.Segment
|
|
77
|
+
new_segment_tep.x = arc.End.X.ToDouble()
|
|
78
|
+
new_segment_tep.y = arc.End.Y.ToDouble()
|
|
79
|
+
self.poly_steps.append(new_segment_tep)
|
|
80
|
+
else:
|
|
81
|
+
arc_center = arc.GetCenter()
|
|
82
|
+
new_poly_step = PolyStep()
|
|
83
|
+
new_poly_step.poly_type = PolyType.Curve
|
|
84
|
+
new_poly_step.center_X = arc_center.X.ToDouble()
|
|
85
|
+
new_poly_step.center_y = arc_center.Y.ToDouble()
|
|
86
|
+
new_poly_step.x = arc.End.X.ToDouble()
|
|
87
|
+
new_poly_step.y = arc.End.Y.ToDouble()
|
|
88
|
+
new_poly_step.clock_wise = not arc.IsCCW()
|
|
89
|
+
self.poly_steps.append(new_poly_step)
|
|
90
|
+
else:
|
|
91
|
+
arcs = path_step.cast().center_line.arc_data
|
|
92
|
+
if not arcs:
|
|
93
|
+
return
|
|
94
|
+
self.line_width = self._ipc.from_meter_to_units(path_step.cast().width.value, self._ipc.units)
|
|
95
|
+
self.width_ref_id = "ROUND_{}".format(self.line_width)
|
|
96
|
+
if not self.width_ref_id in self._ipc.content.dict_line.dict_lines:
|
|
97
|
+
entry_line = EntryLine()
|
|
98
|
+
entry_line.line_width = self.line_width
|
|
99
|
+
self._ipc.content.dict_line.dict_lines[self.width_ref_id] = entry_line
|
|
100
|
+
# first point
|
|
101
|
+
arc = arcs[0]
|
|
102
|
+
new_segment_tep = PolyStep()
|
|
103
|
+
new_segment_tep.x = arc.start.x.value
|
|
104
|
+
new_segment_tep.y = arc.start.y.value
|
|
105
|
+
self.poly_steps.append(new_segment_tep)
|
|
106
|
+
if arc.height == 0:
|
|
107
|
+
new_segment_tep = PolyStep()
|
|
108
|
+
new_segment_tep.poly_type = PolyType.Segment
|
|
109
|
+
new_segment_tep.x = arc.end.x.value
|
|
110
|
+
new_segment_tep.y = arc.end.y.value
|
|
111
|
+
self.poly_steps.append(new_segment_tep)
|
|
112
|
+
else:
|
|
113
|
+
arc_center = arc.center
|
|
114
|
+
new_poly_step = PolyStep()
|
|
115
|
+
new_poly_step.poly_type = PolyType.Curve
|
|
116
|
+
new_poly_step.center_X = arc_center.x.value
|
|
117
|
+
new_poly_step.center_y = arc_center.y.value
|
|
118
|
+
new_poly_step.x = arc.end.x.value
|
|
119
|
+
new_poly_step.y = arc.end.y.value
|
|
120
|
+
new_poly_step.clock_wise = not arc.is_ccw
|
|
121
|
+
self.poly_steps.append(new_poly_step)
|
|
122
|
+
for arc in list(arcs)[1:]:
|
|
123
|
+
if arc.height == 0:
|
|
124
|
+
new_segment_tep = PolyStep()
|
|
125
|
+
new_segment_tep.poly_type = PolyType.Segment
|
|
126
|
+
new_segment_tep.x = arc.end.x.value
|
|
127
|
+
new_segment_tep.y = arc.end.y.value
|
|
128
|
+
self.poly_steps.append(new_segment_tep)
|
|
129
|
+
else:
|
|
130
|
+
arc_center = arc.center
|
|
131
|
+
new_poly_step = PolyStep()
|
|
132
|
+
new_poly_step.poly_type = PolyType.Curve
|
|
133
|
+
new_poly_step.center_X = arc_center.x.value
|
|
134
|
+
new_poly_step.center_y = arc_center.y.value
|
|
135
|
+
new_poly_step.x = arc.end.x.value
|
|
136
|
+
new_poly_step.y = arc.end.y.value
|
|
137
|
+
new_poly_step.clock_wise = not arc.is_ccw
|
|
138
|
+
self.poly_steps.append(new_poly_step)
|
|
88
139
|
|
|
89
140
|
def write_xml(self, net_root): # pragma no cover
|
|
90
141
|
if not self.poly_steps:
|
|
@@ -26,8 +26,9 @@ from pyedb.generic.general_methods import ET
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class Polygon(object):
|
|
29
|
-
def __init__(self, ipc):
|
|
29
|
+
def __init__(self, ipc, pedb):
|
|
30
30
|
self._ipc = ipc
|
|
31
|
+
self._pedb = pedb
|
|
31
32
|
self.is_void = False
|
|
32
33
|
self.poly_steps = []
|
|
33
34
|
self.solid_fill_id = ""
|
|
@@ -35,65 +36,126 @@ class Polygon(object):
|
|
|
35
36
|
|
|
36
37
|
def add_poly_step(self, polygon=None): # pragma no cover
|
|
37
38
|
if polygon:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
39
|
+
if not self._pedb.grpc:
|
|
40
|
+
polygon_data = polygon._edb_object.GetPolygonData()
|
|
41
|
+
if polygon_data.IsClosed():
|
|
42
|
+
arcs = polygon_data.GetArcData()
|
|
43
|
+
if not arcs:
|
|
44
|
+
return
|
|
45
|
+
# begin
|
|
46
|
+
new_segment_tep = PolyStep()
|
|
47
|
+
new_segment_tep.poly_type = PolyType.Segment
|
|
48
|
+
new_segment_tep.x = arcs[0].Start.X.ToDouble()
|
|
49
|
+
new_segment_tep.y = arcs[0].Start.Y.ToDouble()
|
|
50
|
+
self.poly_steps.append(new_segment_tep)
|
|
51
|
+
for arc in arcs:
|
|
52
|
+
if arc.Height == 0:
|
|
53
|
+
new_segment_tep = PolyStep()
|
|
54
|
+
new_segment_tep.poly_type = PolyType.Segment
|
|
55
|
+
new_segment_tep.x = arc.End.X.ToDouble()
|
|
56
|
+
new_segment_tep.y = arc.End.Y.ToDouble()
|
|
57
|
+
self.poly_steps.append(new_segment_tep)
|
|
58
|
+
else:
|
|
59
|
+
arc_center = arc.GetCenter()
|
|
60
|
+
new_poly_step = PolyStep()
|
|
61
|
+
new_poly_step.poly_type = PolyType.Curve
|
|
62
|
+
new_poly_step.center_X = arc_center.X.ToDouble()
|
|
63
|
+
new_poly_step.center_y = arc_center.Y.ToDouble()
|
|
64
|
+
new_poly_step.x = arc.End.X.ToDouble()
|
|
65
|
+
new_poly_step.y = arc.End.Y.ToDouble()
|
|
66
|
+
new_poly_step.clock_wise = not arc.IsCCW()
|
|
67
|
+
self.poly_steps.append(new_poly_step)
|
|
68
|
+
for void in polygon.voids:
|
|
69
|
+
void_polygon_data = void._edb_object.GetPolygonData()
|
|
70
|
+
if void_polygon_data.IsClosed():
|
|
71
|
+
void_arcs = void_polygon_data.GetArcData()
|
|
72
|
+
if not void_arcs:
|
|
73
|
+
return
|
|
74
|
+
void_polygon = Cutout(self._ipc)
|
|
75
|
+
self.cutout.append(void_polygon)
|
|
76
|
+
# begin
|
|
77
|
+
new_segment_tep = PolyStep()
|
|
78
|
+
new_segment_tep.poly_type = PolyType.Segment
|
|
79
|
+
new_segment_tep.x = void_arcs[0].Start.X.ToDouble()
|
|
80
|
+
new_segment_tep.y = void_arcs[0].Start.Y.ToDouble()
|
|
81
|
+
void_polygon.poly_steps.append(new_segment_tep)
|
|
82
|
+
for void_arc in void_arcs:
|
|
83
|
+
if void_arc.Height == 0:
|
|
84
|
+
new_segment_tep = PolyStep()
|
|
85
|
+
new_segment_tep.poly_type = PolyType.Segment
|
|
86
|
+
new_segment_tep.x = void_arc.End.X.ToDouble()
|
|
87
|
+
new_segment_tep.y = void_arc.End.Y.ToDouble()
|
|
88
|
+
void_polygon.poly_steps.append(new_segment_tep)
|
|
89
|
+
else:
|
|
90
|
+
arc_center = void_arc.GetCenter()
|
|
91
|
+
new_poly_step = PolyStep()
|
|
92
|
+
new_poly_step.poly_type = PolyType.Curve
|
|
93
|
+
new_poly_step.center_X = arc_center.X.ToDouble()
|
|
94
|
+
new_poly_step.center_y = arc_center.Y.ToDouble()
|
|
95
|
+
new_poly_step.x = void_arc.End.X.ToDouble()
|
|
96
|
+
new_poly_step.y = void_arc.End.Y.ToDouble()
|
|
97
|
+
new_poly_step.clock_wise = not void_arc.IsCCW()
|
|
98
|
+
void_polygon.poly_steps.append(new_poly_step)
|
|
99
|
+
else:
|
|
100
|
+
polygon_data = polygon.polygon_data
|
|
101
|
+
if polygon_data.is_closed:
|
|
102
|
+
arcs = polygon_data.arc_data
|
|
103
|
+
if not arcs:
|
|
104
|
+
return
|
|
105
|
+
# begin
|
|
106
|
+
new_segment_tep = PolyStep()
|
|
107
|
+
new_segment_tep.poly_type = PolyType.Segment
|
|
108
|
+
new_segment_tep.x = arcs[0].start.x.value
|
|
109
|
+
new_segment_tep.y = arcs[0].start.y.value
|
|
110
|
+
self.poly_steps.append(new_segment_tep)
|
|
111
|
+
for arc in arcs:
|
|
112
|
+
if arc.height == 0:
|
|
113
|
+
new_segment_tep = PolyStep()
|
|
114
|
+
new_segment_tep.poly_type = PolyType.Segment
|
|
115
|
+
new_segment_tep.x = arc.end.x.value
|
|
116
|
+
new_segment_tep.y = arc.end.y.value
|
|
117
|
+
self.poly_steps.append(new_segment_tep)
|
|
118
|
+
else:
|
|
119
|
+
arc_center = arc.center
|
|
120
|
+
new_poly_step = PolyStep()
|
|
121
|
+
new_poly_step.poly_type = PolyType.Curve
|
|
122
|
+
new_poly_step.center_X = arc_center.x.value
|
|
123
|
+
new_poly_step.center_y = arc_center.y.value
|
|
124
|
+
new_poly_step.x = arc.end.x.value
|
|
125
|
+
new_poly_step.y = arc.end.y.value
|
|
126
|
+
new_poly_step.clock_wise = not arc.is_ccw
|
|
127
|
+
self.poly_steps.append(new_poly_step)
|
|
128
|
+
for void in polygon.voids:
|
|
129
|
+
void_polygon_data = void.polygon_data
|
|
130
|
+
if void_polygon_data.is_closed:
|
|
131
|
+
void_arcs = void_polygon_data.arc_data
|
|
132
|
+
if not void_arcs:
|
|
133
|
+
return
|
|
134
|
+
void_polygon = Cutout(self._ipc)
|
|
135
|
+
self.cutout.append(void_polygon)
|
|
136
|
+
# begin
|
|
137
|
+
new_segment_tep = PolyStep()
|
|
138
|
+
new_segment_tep.poly_type = PolyType.Segment
|
|
139
|
+
new_segment_tep.x = void_arcs[0].start.x.value
|
|
140
|
+
new_segment_tep.y = void_arcs[0].start.y.value
|
|
141
|
+
void_polygon.poly_steps.append(new_segment_tep)
|
|
142
|
+
for void_arc in void_arcs:
|
|
143
|
+
if void_arc.height == 0:
|
|
144
|
+
new_segment_tep = PolyStep()
|
|
145
|
+
new_segment_tep.poly_type = PolyType.Segment
|
|
146
|
+
new_segment_tep.x = void_arc.end.x.value
|
|
147
|
+
new_segment_tep.y = void_arc.end.y.value
|
|
148
|
+
void_polygon.poly_steps.append(new_segment_tep)
|
|
149
|
+
else:
|
|
150
|
+
arc_center = void_arc.center
|
|
151
|
+
new_poly_step = PolyStep()
|
|
152
|
+
new_poly_step.poly_type = PolyType.Curve
|
|
153
|
+
new_poly_step.center_X = arc_center.x.value
|
|
154
|
+
new_poly_step.center_y = arc_center.y.value
|
|
155
|
+
new_poly_step.x = void_arc.end.x.value
|
|
156
|
+
new_poly_step.y = void_arc.end.y.value
|
|
157
|
+
new_poly_step.clock_wise = not void_arc.is_ccw
|
|
158
|
+
void_polygon.poly_steps.append(new_poly_step)
|
|
97
159
|
|
|
98
160
|
def add_cutout(self, cutout): # pragma no cover
|
|
99
161
|
if not isinstance(cutout, Cutout):
|
|
@@ -48,15 +48,16 @@ class Profile(object):
|
|
|
48
48
|
for poly in self.profile:
|
|
49
49
|
for feature in poly.features:
|
|
50
50
|
if feature.feature_type == 0:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
poly_step.
|
|
61
|
-
|
|
62
|
-
cutout
|
|
51
|
+
if feature.polygon.poly_steps:
|
|
52
|
+
polygon = ET.SubElement(profile, "Polygon")
|
|
53
|
+
polygon_begin = ET.SubElement(polygon, "PolyBegin")
|
|
54
|
+
polygon_begin.set(
|
|
55
|
+
"x", str(self._ipc.from_meter_to_units(feature.polygon.poly_steps[0].x, self._ipc.units))
|
|
56
|
+
)
|
|
57
|
+
polygon_begin.set(
|
|
58
|
+
"y", str(self._ipc.from_meter_to_units(feature.polygon.poly_steps[0].y, self._ipc.units))
|
|
59
|
+
)
|
|
60
|
+
for poly_step in feature.polygon.poly_steps[1:]:
|
|
61
|
+
poly_step.write_xml(polygon, self._ipc)
|
|
62
|
+
for cutout in feature.polygon.cutout:
|
|
63
|
+
cutout.write_xml(profile, self._ipc)
|