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.
- pyedb/__init__.py +17 -0
- pyedb/dotnet/__init__.py +0 -0
- pyedb/dotnet/application/Variables.py +2261 -0
- pyedb/dotnet/application/__init__.py +0 -0
- pyedb/dotnet/clr_module.py +103 -0
- pyedb/dotnet/edb.py +4237 -0
- pyedb/dotnet/edb_core/__init__.py +1 -0
- pyedb/dotnet/edb_core/cell/__init__.py +0 -0
- pyedb/dotnet/edb_core/cell/hierarchy/__init__.py +0 -0
- pyedb/dotnet/edb_core/cell/hierarchy/model.py +66 -0
- pyedb/dotnet/edb_core/components.py +2669 -0
- pyedb/dotnet/edb_core/configuration.py +423 -0
- pyedb/dotnet/edb_core/definition/__init__.py +0 -0
- pyedb/dotnet/edb_core/definition/component_def.py +166 -0
- pyedb/dotnet/edb_core/definition/component_model.py +30 -0
- pyedb/dotnet/edb_core/definition/definition_obj.py +18 -0
- pyedb/dotnet/edb_core/definition/definitions.py +12 -0
- pyedb/dotnet/edb_core/dotnet/__init__.py +0 -0
- pyedb/dotnet/edb_core/dotnet/database.py +1218 -0
- pyedb/dotnet/edb_core/dotnet/layout.py +238 -0
- pyedb/dotnet/edb_core/dotnet/primitive.py +1517 -0
- pyedb/dotnet/edb_core/edb_data/__init__.py +0 -0
- pyedb/dotnet/edb_core/edb_data/components_data.py +938 -0
- pyedb/dotnet/edb_core/edb_data/connectable.py +113 -0
- pyedb/dotnet/edb_core/edb_data/control_file.py +1268 -0
- pyedb/dotnet/edb_core/edb_data/design_options.py +35 -0
- pyedb/dotnet/edb_core/edb_data/edbvalue.py +45 -0
- pyedb/dotnet/edb_core/edb_data/hfss_extent_info.py +330 -0
- pyedb/dotnet/edb_core/edb_data/hfss_simulation_setup_data.py +1607 -0
- pyedb/dotnet/edb_core/edb_data/layer_data.py +576 -0
- pyedb/dotnet/edb_core/edb_data/nets_data.py +281 -0
- pyedb/dotnet/edb_core/edb_data/obj_base.py +19 -0
- pyedb/dotnet/edb_core/edb_data/padstacks_data.py +2080 -0
- pyedb/dotnet/edb_core/edb_data/ports.py +287 -0
- pyedb/dotnet/edb_core/edb_data/primitives_data.py +1397 -0
- pyedb/dotnet/edb_core/edb_data/simulation_configuration.py +2914 -0
- pyedb/dotnet/edb_core/edb_data/simulation_setup.py +716 -0
- pyedb/dotnet/edb_core/edb_data/siwave_simulation_setup_data.py +1205 -0
- pyedb/dotnet/edb_core/edb_data/sources.py +514 -0
- pyedb/dotnet/edb_core/edb_data/terminals.py +632 -0
- pyedb/dotnet/edb_core/edb_data/utilities.py +148 -0
- pyedb/dotnet/edb_core/edb_data/variables.py +91 -0
- pyedb/dotnet/edb_core/general.py +181 -0
- pyedb/dotnet/edb_core/hfss.py +1646 -0
- pyedb/dotnet/edb_core/layout.py +1244 -0
- pyedb/dotnet/edb_core/layout_validation.py +272 -0
- pyedb/dotnet/edb_core/materials.py +939 -0
- pyedb/dotnet/edb_core/net_class.py +335 -0
- pyedb/dotnet/edb_core/nets.py +1215 -0
- pyedb/dotnet/edb_core/padstack.py +1389 -0
- pyedb/dotnet/edb_core/siwave.py +1427 -0
- pyedb/dotnet/edb_core/stackup.py +2703 -0
- pyedb/edb_logger.py +396 -0
- pyedb/generic/__init__.py +0 -0
- pyedb/generic/constants.py +1063 -0
- pyedb/generic/data_handlers.py +320 -0
- pyedb/generic/design_types.py +104 -0
- pyedb/generic/filesystem.py +150 -0
- pyedb/generic/general_methods.py +1535 -0
- pyedb/generic/plot.py +1840 -0
- pyedb/generic/process.py +285 -0
- pyedb/generic/settings.py +224 -0
- pyedb/ipc2581/__init__.py +0 -0
- pyedb/ipc2581/bom/__init__.py +0 -0
- pyedb/ipc2581/bom/bom.py +21 -0
- pyedb/ipc2581/bom/bom_item.py +32 -0
- pyedb/ipc2581/bom/characteristics.py +37 -0
- pyedb/ipc2581/bom/refdes.py +16 -0
- pyedb/ipc2581/content/__init__.py +0 -0
- pyedb/ipc2581/content/color.py +38 -0
- pyedb/ipc2581/content/content.py +55 -0
- pyedb/ipc2581/content/dictionary_color.py +29 -0
- pyedb/ipc2581/content/dictionary_fill.py +28 -0
- pyedb/ipc2581/content/dictionary_line.py +30 -0
- pyedb/ipc2581/content/entry_color.py +13 -0
- pyedb/ipc2581/content/entry_line.py +14 -0
- pyedb/ipc2581/content/fill.py +15 -0
- pyedb/ipc2581/content/layer_ref.py +10 -0
- pyedb/ipc2581/content/standard_geometries_dictionary.py +72 -0
- pyedb/ipc2581/ecad/__init__.py +0 -0
- pyedb/ipc2581/ecad/cad_data/__init__.py +0 -0
- pyedb/ipc2581/ecad/cad_data/assembly_drawing.py +26 -0
- pyedb/ipc2581/ecad/cad_data/cad_data.py +37 -0
- pyedb/ipc2581/ecad/cad_data/component.py +41 -0
- pyedb/ipc2581/ecad/cad_data/drill.py +30 -0
- pyedb/ipc2581/ecad/cad_data/feature.py +54 -0
- pyedb/ipc2581/ecad/cad_data/layer.py +41 -0
- pyedb/ipc2581/ecad/cad_data/layer_feature.py +151 -0
- pyedb/ipc2581/ecad/cad_data/logical_net.py +32 -0
- pyedb/ipc2581/ecad/cad_data/outline.py +25 -0
- pyedb/ipc2581/ecad/cad_data/package.py +104 -0
- pyedb/ipc2581/ecad/cad_data/padstack_def.py +38 -0
- pyedb/ipc2581/ecad/cad_data/padstack_hole_def.py +24 -0
- pyedb/ipc2581/ecad/cad_data/padstack_instance.py +62 -0
- pyedb/ipc2581/ecad/cad_data/padstack_pad_def.py +26 -0
- pyedb/ipc2581/ecad/cad_data/path.py +89 -0
- pyedb/ipc2581/ecad/cad_data/phy_net.py +80 -0
- pyedb/ipc2581/ecad/cad_data/pin.py +31 -0
- pyedb/ipc2581/ecad/cad_data/polygon.py +169 -0
- pyedb/ipc2581/ecad/cad_data/profile.py +40 -0
- pyedb/ipc2581/ecad/cad_data/stackup.py +31 -0
- pyedb/ipc2581/ecad/cad_data/stackup_group.py +42 -0
- pyedb/ipc2581/ecad/cad_data/stackup_layer.py +21 -0
- pyedb/ipc2581/ecad/cad_data/step.py +275 -0
- pyedb/ipc2581/ecad/cad_header.py +33 -0
- pyedb/ipc2581/ecad/ecad.py +19 -0
- pyedb/ipc2581/ecad/spec.py +46 -0
- pyedb/ipc2581/history_record.py +37 -0
- pyedb/ipc2581/ipc2581.py +387 -0
- pyedb/ipc2581/logistic_header.py +25 -0
- pyedb/misc/__init__.py +0 -0
- pyedb/misc/aedtlib_personalib_install.py +14 -0
- pyedb/misc/downloads.py +322 -0
- pyedb/misc/misc.py +67 -0
- pyedb/misc/pyedb.runtimeconfig.json +13 -0
- pyedb/misc/siw_feature_config/__init__.py +0 -0
- pyedb/misc/siw_feature_config/emc/__init__.py +0 -0
- pyedb/misc/siw_feature_config/emc/component_tags.py +46 -0
- pyedb/misc/siw_feature_config/emc/net_tags.py +37 -0
- pyedb/misc/siw_feature_config/emc/tag_library.py +62 -0
- pyedb/misc/siw_feature_config/emc/xml_generic.py +78 -0
- pyedb/misc/siw_feature_config/emc_rule_checker_settings.py +179 -0
- pyedb/misc/utilities.py +27 -0
- pyedb/modeler/geometry_operators.py +2082 -0
- pyedb-0.2.0.dist-info/LICENSE +21 -0
- pyedb-0.2.0.dist-info/METADATA +208 -0
- pyedb-0.2.0.dist-info/RECORD +128 -0
- pyedb-0.2.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from pyedb.generic.general_methods import ET
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class LogicalNet(object):
|
|
5
|
+
"""Class describing an IPC2581 logical net."""
|
|
6
|
+
|
|
7
|
+
def __init__(self):
|
|
8
|
+
self.name = ""
|
|
9
|
+
self.pin_ref = []
|
|
10
|
+
|
|
11
|
+
def write_xml(self, step): # pragma no cover
|
|
12
|
+
if step:
|
|
13
|
+
logical_net = ET.SubElement(step, "LogicalNet")
|
|
14
|
+
logical_net.set("name", self.name)
|
|
15
|
+
for pin in self.pin_ref:
|
|
16
|
+
pin.write_xml(logical_net)
|
|
17
|
+
|
|
18
|
+
def get_pin_ref_def(self): # pragma no cover
|
|
19
|
+
return PinRef()
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class PinRef(object):
|
|
23
|
+
"""Class describing an IPC2581 logical net."""
|
|
24
|
+
|
|
25
|
+
def __init__(self):
|
|
26
|
+
self.pin = ""
|
|
27
|
+
self.component_ref = ""
|
|
28
|
+
|
|
29
|
+
def write_xml(self, logical_net): # pragma no cover
|
|
30
|
+
pin_ref = ET.SubElement(logical_net, "PinRef")
|
|
31
|
+
pin_ref.set("pin", self.pin)
|
|
32
|
+
pin_ref.set("componentRef", self.component_ref)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from pyedb.generic.general_methods import ET
|
|
2
|
+
from pyedb.ipc2581.ecad.cad_data.polygon import Polygon
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Outline:
|
|
6
|
+
"""Class describing an IPC2581 outline."""
|
|
7
|
+
|
|
8
|
+
def __init__(self, ipc):
|
|
9
|
+
self._ipc = ipc
|
|
10
|
+
self.polygon = Polygon(self._ipc)
|
|
11
|
+
self.line_ref = ""
|
|
12
|
+
|
|
13
|
+
def write_xml(self, package): # pragma no cover
|
|
14
|
+
outline = ET.SubElement(package, "Outline")
|
|
15
|
+
polygon = ET.SubElement(outline, "Polygon")
|
|
16
|
+
polygon_begin = ET.SubElement(polygon, "PolyBegin")
|
|
17
|
+
if self.polygon.poly_steps:
|
|
18
|
+
polygon_begin.set("x", str(self.polygon.poly_steps[0].x))
|
|
19
|
+
polygon_begin.set("y", str(self.polygon.poly_steps[0].y))
|
|
20
|
+
for poly_step in self.polygon.poly_steps[1:]:
|
|
21
|
+
polygon_segment = ET.SubElement(polygon, "PolyStepSegment")
|
|
22
|
+
polygon_segment.set("x", str(poly_step.x))
|
|
23
|
+
polygon_segment.set("y", str(poly_step.y))
|
|
24
|
+
line_desc_ref = ET.SubElement(outline, "LineDescRef")
|
|
25
|
+
line_desc_ref.set("id", self.line_ref)
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import math
|
|
2
|
+
|
|
3
|
+
from pyedb.generic.general_methods import ET, pyedb_function_handler
|
|
4
|
+
from pyedb.ipc2581.content.entry_line import EntryLine
|
|
5
|
+
from pyedb.ipc2581.ecad.cad_data.assembly_drawing import AssemblyDrawing
|
|
6
|
+
from pyedb.ipc2581.ecad.cad_data.outline import Outline
|
|
7
|
+
from pyedb.ipc2581.ecad.cad_data.pin import Pin
|
|
8
|
+
from pyedb.ipc2581.ecad.cad_data.polygon import PolyStep
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Package(object):
|
|
12
|
+
"""Class describing an IPC2581 package definition."""
|
|
13
|
+
|
|
14
|
+
def __init__(self, ipc):
|
|
15
|
+
self._ipc = ipc
|
|
16
|
+
self.name = ""
|
|
17
|
+
self.type = "OTHER"
|
|
18
|
+
self.pin_one = "1"
|
|
19
|
+
self.pin_orientation = "OTHER"
|
|
20
|
+
self.height = 0.1
|
|
21
|
+
self.assembly_drawing = AssemblyDrawing(self._ipc)
|
|
22
|
+
self.outline = Outline(self._ipc)
|
|
23
|
+
self._pins = []
|
|
24
|
+
self.pickup_point = [0.0, 0.0]
|
|
25
|
+
|
|
26
|
+
@property
|
|
27
|
+
def pins(self):
|
|
28
|
+
return self._pins
|
|
29
|
+
|
|
30
|
+
@pins.setter
|
|
31
|
+
def pins(self, value): # pragma no cover
|
|
32
|
+
if isinstance(value, list):
|
|
33
|
+
if len([pin for pin in value if isinstance(pin, Pin)]) == len(value):
|
|
34
|
+
self._pins = value
|
|
35
|
+
|
|
36
|
+
@pyedb_function_handler()
|
|
37
|
+
def add_pin(self, number=0, x=0.0, y=0.0, rotation=0.0, primitive_ref=""): # pragma no cover
|
|
38
|
+
added_pin = Pin()
|
|
39
|
+
added_pin.x = x
|
|
40
|
+
added_pin.y = y
|
|
41
|
+
added_pin.rotation = rotation * 180 / math.pi
|
|
42
|
+
added_pin.number = number
|
|
43
|
+
added_pin.primitive_def = primitive_ref
|
|
44
|
+
self.pins.append(added_pin)
|
|
45
|
+
|
|
46
|
+
@pyedb_function_handler()
|
|
47
|
+
def add_component_outline(self, component): # pragma no cover
|
|
48
|
+
if component:
|
|
49
|
+
_bbox = component.bounding_box
|
|
50
|
+
_rot = component.rotation
|
|
51
|
+
average_x = (_bbox[0] + _bbox[2]) / 2
|
|
52
|
+
average_y = (_bbox[1] + _bbox[3]) / 2
|
|
53
|
+
bb1x = _bbox[0] - average_x
|
|
54
|
+
bb1y = _bbox[1] - average_y
|
|
55
|
+
bb2x = _bbox[2] - average_x
|
|
56
|
+
bb2y = _bbox[3] - average_y
|
|
57
|
+
|
|
58
|
+
bb1x_rot = bb1x
|
|
59
|
+
bb2x_rot = bb2x
|
|
60
|
+
bb1y_rot = bb1y
|
|
61
|
+
bb2y_rot = bb2y
|
|
62
|
+
if _rot >= math.pi / 4 and _rot <= 0.75 * math.pi:
|
|
63
|
+
bb = bb1x_rot
|
|
64
|
+
bb1x_rot = bb1y_rot
|
|
65
|
+
bb1y_rot = bb
|
|
66
|
+
bb = bb2x_rot
|
|
67
|
+
bb2x_rot = bb2y_rot
|
|
68
|
+
bb2y_rot = bb
|
|
69
|
+
poly_step1 = PolyStep()
|
|
70
|
+
poly_step2 = PolyStep()
|
|
71
|
+
poly_step3 = PolyStep()
|
|
72
|
+
poly_step4 = PolyStep()
|
|
73
|
+
poly_step5 = PolyStep()
|
|
74
|
+
poly_step1.x = str(self._ipc.from_meter_to_units(bb1x_rot, self._ipc.units))
|
|
75
|
+
poly_step1.y = str(self._ipc.from_meter_to_units(bb1y_rot, self._ipc.units))
|
|
76
|
+
poly_step2.x = str(self._ipc.from_meter_to_units(bb2x_rot, self._ipc.units))
|
|
77
|
+
poly_step2.y = str(self._ipc.from_meter_to_units(bb1y_rot, self._ipc.units))
|
|
78
|
+
poly_step3.x = str(self._ipc.from_meter_to_units(bb2x_rot, self._ipc.units))
|
|
79
|
+
poly_step3.y = str(self._ipc.from_meter_to_units(bb2y_rot, self._ipc.units))
|
|
80
|
+
poly_step4.x = str(self._ipc.from_meter_to_units(bb1x_rot, self._ipc.units))
|
|
81
|
+
poly_step4.y = str(self._ipc.from_meter_to_units(bb2y_rot, self._ipc.units))
|
|
82
|
+
poly_step5.x = str(self._ipc.from_meter_to_units(bb1x_rot, self._ipc.units))
|
|
83
|
+
poly_step5.y = str(self._ipc.from_meter_to_units(bb1y_rot, self._ipc.units))
|
|
84
|
+
self.outline.polygon.poly_steps = [poly_step1, poly_step2, poly_step3, poly_step4, poly_step5]
|
|
85
|
+
if not "ROUND_0" in self._ipc.content.dict_line.dict_lines:
|
|
86
|
+
entry_line = EntryLine()
|
|
87
|
+
entry_line.line_width = 0.0
|
|
88
|
+
self._ipc.content.dict_line.dict_lines["ROUND_0"] = entry_line
|
|
89
|
+
self.outline.line_ref = "ROUND_0"
|
|
90
|
+
self.assembly_drawing.polygon.poly_steps = [poly_step1, poly_step2, poly_step3, poly_step4, poly_step5]
|
|
91
|
+
self.assembly_drawing.line_ref = "ROUND_0"
|
|
92
|
+
|
|
93
|
+
@pyedb_function_handler()
|
|
94
|
+
def write_xml(self, step): # pragma no cover
|
|
95
|
+
package = ET.SubElement(step, "Package")
|
|
96
|
+
package.set("name", self.name)
|
|
97
|
+
package.set("type", self.type)
|
|
98
|
+
package.set("pinOne", self.pin_one)
|
|
99
|
+
package.set("pinOneOrientation", self.pin_orientation)
|
|
100
|
+
package.set("height", str(self.height))
|
|
101
|
+
self.outline.write_xml(package)
|
|
102
|
+
self.assembly_drawing.write_xml(package)
|
|
103
|
+
for pin in self.pins:
|
|
104
|
+
pin.write_xml(package)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from pyedb.generic.general_methods import ET
|
|
2
|
+
from pyedb.ipc2581.ecad.cad_data.padstack_hole_def import PadstackHoleDef
|
|
3
|
+
from pyedb.ipc2581.ecad.cad_data.padstack_pad_def import PadstackPadDef
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class PadstackDef(object):
|
|
7
|
+
"""Class describing an IPC2581 padstack definition."""
|
|
8
|
+
|
|
9
|
+
def __init__(self):
|
|
10
|
+
self.name = ""
|
|
11
|
+
self.padstack_hole_def = PadstackHoleDef()
|
|
12
|
+
self._padstack_pad_def = []
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def padstack_pad_def(self):
|
|
16
|
+
return self._padstack_pad_def
|
|
17
|
+
|
|
18
|
+
@padstack_pad_def.setter
|
|
19
|
+
def padstack_pad_def(self, value): # pragma no cover
|
|
20
|
+
if isinstance(value, list):
|
|
21
|
+
if len([pad for pad in value if isinstance(pad, PadstackPadDef)]) == len(value):
|
|
22
|
+
self._padstack_pad_def = value
|
|
23
|
+
|
|
24
|
+
def add_padstack_pad_def(self, layer="", pad_use="REGULAR", x="0", y="0", primitive_ref=""): # pragma no cover
|
|
25
|
+
pad = PadstackPadDef()
|
|
26
|
+
pad.layer_ref = layer
|
|
27
|
+
pad.pad_use = pad_use
|
|
28
|
+
pad.x = x
|
|
29
|
+
pad.y = y
|
|
30
|
+
pad.primitive_ref = primitive_ref
|
|
31
|
+
self.padstack_pad_def.append(pad)
|
|
32
|
+
|
|
33
|
+
def write_xml(self, step): # pragma no cover
|
|
34
|
+
padstack_def = ET.SubElement(step, "PadStackDef")
|
|
35
|
+
padstack_def.set("name", self.name)
|
|
36
|
+
self.padstack_hole_def.write_xml(padstack_def)
|
|
37
|
+
for pad in self.padstack_pad_def:
|
|
38
|
+
pad.write_xml(padstack_def)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from pyedb.generic.general_methods import ET
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class PadstackHoleDef(object):
|
|
5
|
+
"""Class describing an ICP2581 padstack hole definition."""
|
|
6
|
+
|
|
7
|
+
def __init__(self):
|
|
8
|
+
self.name = ""
|
|
9
|
+
self.diameter = 0
|
|
10
|
+
self.plating_status = "PLATED"
|
|
11
|
+
self.plus_tol = 0
|
|
12
|
+
self.minus_tol = 0
|
|
13
|
+
self.x = 0
|
|
14
|
+
self.y = 0
|
|
15
|
+
|
|
16
|
+
def write_xml(self, padstackdef): # pragma no cover
|
|
17
|
+
padstack_hole = ET.SubElement(padstackdef, "PadstackHoleDef")
|
|
18
|
+
padstack_hole.set("name", self.name)
|
|
19
|
+
padstack_hole.set("diameter", str(self.diameter))
|
|
20
|
+
padstack_hole.set("platingStatus", str(self.plating_status))
|
|
21
|
+
padstack_hole.set("plusTol", str(self.plus_tol))
|
|
22
|
+
padstack_hole.set("minusTol", str(self.minus_tol))
|
|
23
|
+
padstack_hole.set("x", str(self.x))
|
|
24
|
+
padstack_hole.set("y", str(self.y))
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
from pyedb.generic.general_methods import ET
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class PadstackInstance(object):
|
|
5
|
+
"""Class describing an IPC2581 padstack instance."""
|
|
6
|
+
|
|
7
|
+
def __init__(self):
|
|
8
|
+
self.isvia = False
|
|
9
|
+
self.padstack_def = ""
|
|
10
|
+
self.standard_primimtive_ref = ""
|
|
11
|
+
self.pin = ""
|
|
12
|
+
self.x = ""
|
|
13
|
+
self.y = ""
|
|
14
|
+
self.rotation = ""
|
|
15
|
+
self.refdes = ""
|
|
16
|
+
self.net = ""
|
|
17
|
+
self.mirror = False
|
|
18
|
+
|
|
19
|
+
def write_xml(self, net_root): # pragma no cover
|
|
20
|
+
if self.isvia:
|
|
21
|
+
net_root.set("testPoint", "false")
|
|
22
|
+
net_root.set("plate", "true")
|
|
23
|
+
net_root.set("padUsage", "VIA")
|
|
24
|
+
non_standard_attribute = ET.SubElement(net_root, "NonstandardAttribute")
|
|
25
|
+
non_standard_attribute.set("name", "PADSTACK_USAGE")
|
|
26
|
+
non_standard_attribute.set("value", "Through")
|
|
27
|
+
non_standard_attribute.set("type", "STRING")
|
|
28
|
+
pad = ET.SubElement(net_root, "Pad")
|
|
29
|
+
pad.set("padstackDefRef", self.padstack_def)
|
|
30
|
+
xform = ET.SubElement(pad, "Xform")
|
|
31
|
+
xform.set("rotation", "0")
|
|
32
|
+
xform.set("mirror", str(self.mirror).lower())
|
|
33
|
+
location = ET.SubElement(pad, "Location")
|
|
34
|
+
location.set("x", str(self.x))
|
|
35
|
+
location.set("y", str(self.y))
|
|
36
|
+
primitive_ref = ET.SubElement(pad, "StandardPrimitiveRef")
|
|
37
|
+
primitive_ref.set("id", self.standard_primimtive_ref)
|
|
38
|
+
if self.refdes:
|
|
39
|
+
pin_ref = ET.SubElement(pad, "PinRef")
|
|
40
|
+
pin_ref.set("pin", self.pin)
|
|
41
|
+
pin_ref.set("componentRef", self.refdes)
|
|
42
|
+
else:
|
|
43
|
+
net_root.set("testPoint", "false")
|
|
44
|
+
net_root.set("plate", "true")
|
|
45
|
+
non_standard_attribute = ET.SubElement(net_root, "NonstandardAttribute")
|
|
46
|
+
non_standard_attribute.set("name", "PADSTACK_USAGE")
|
|
47
|
+
non_standard_attribute.set("value", "Through")
|
|
48
|
+
non_standard_attribute.set("type", "STRING")
|
|
49
|
+
pad = ET.SubElement(net_root, "Pad")
|
|
50
|
+
pad.set("padstackDefRef", self.padstack_def)
|
|
51
|
+
xform = ET.SubElement(pad, "Xform")
|
|
52
|
+
xform.set("rotation", str(self.rotation))
|
|
53
|
+
xform.set("mirror", str(self.mirror).lower())
|
|
54
|
+
location = ET.SubElement(pad, "Location")
|
|
55
|
+
location.set("x", str(self.x))
|
|
56
|
+
location.set("y", str(self.y))
|
|
57
|
+
primitive_ref = ET.SubElement(pad, "StandardPrimitiveRef")
|
|
58
|
+
primitive_ref.set("id", self.standard_primimtive_ref)
|
|
59
|
+
if self.refdes:
|
|
60
|
+
pin_ref = ET.SubElement(pad, "PinRef")
|
|
61
|
+
pin_ref.set("pin", self.pin)
|
|
62
|
+
pin_ref.set("componentRef", self.refdes)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from pyedb.generic.general_methods import ET
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class PadstackPadDef(object):
|
|
5
|
+
"""Class describing an IPC2581 padstack definition."""
|
|
6
|
+
|
|
7
|
+
def __init__(self):
|
|
8
|
+
self.layer_ref = ""
|
|
9
|
+
self.pad_use = "REGULAR"
|
|
10
|
+
self.x = 0.0
|
|
11
|
+
self.y = 0.0
|
|
12
|
+
self.primitive_ref = "CIRCLE_DEFAULT"
|
|
13
|
+
|
|
14
|
+
def write_xml(self, padstack_def): # pragma no cover
|
|
15
|
+
pad_def = ET.SubElement(padstack_def, "PadstackPadDef")
|
|
16
|
+
pad_def.set("layerRef", self.layer_ref)
|
|
17
|
+
pad_def.set("padUse", self.pad_use)
|
|
18
|
+
location = ET.SubElement(pad_def, "Location")
|
|
19
|
+
location.set("x", str(self.x))
|
|
20
|
+
location.set("y", str(self.y))
|
|
21
|
+
standard_primitive = ET.SubElement(pad_def, "StandardPrimitiveRef")
|
|
22
|
+
standard_primitive.set("id", self.primitive_ref)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class PadUse(object):
|
|
26
|
+
(Regular, Antipad, Thermal) = range(0, 3)
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
from pyedb.generic.general_methods import ET, pyedb_function_handler
|
|
2
|
+
from pyedb.ipc2581.content.entry_line import EntryLine
|
|
3
|
+
from pyedb.ipc2581.ecad.cad_data.polygon import PolyStep, PolyType
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Path(object):
|
|
7
|
+
"""Class describing an IPC2581 trace."""
|
|
8
|
+
|
|
9
|
+
def __init__(self, ipc):
|
|
10
|
+
self._ipc = ipc
|
|
11
|
+
self.location_x = 0.0
|
|
12
|
+
self.location_y = 0.0
|
|
13
|
+
self.poly_steps = []
|
|
14
|
+
self.entry_line = EntryLine()
|
|
15
|
+
self.width_ref_id = ""
|
|
16
|
+
|
|
17
|
+
@pyedb_function_handler()
|
|
18
|
+
def add_path_step(self, path_step=None): # pragma no cover
|
|
19
|
+
arcs = path_step.primitive_object.GetCenterLine().GetArcData()
|
|
20
|
+
if not arcs:
|
|
21
|
+
return
|
|
22
|
+
self.line_width = self._ipc.from_meter_to_units(path_step.primitive_object.GetWidth(), self._ipc.units)
|
|
23
|
+
self.width_ref_id = "ROUND_{}".format(self.line_width)
|
|
24
|
+
if not self.width_ref_id in self._ipc.content.dict_line.dict_lines:
|
|
25
|
+
entry_line = EntryLine()
|
|
26
|
+
entry_line.line_width = self.line_width
|
|
27
|
+
self._ipc.content.dict_line.dict_lines[self.width_ref_id] = entry_line
|
|
28
|
+
# first point
|
|
29
|
+
arc = arcs[0]
|
|
30
|
+
new_segment_tep = PolyStep()
|
|
31
|
+
new_segment_tep.x = arc.Start.X.ToDouble()
|
|
32
|
+
new_segment_tep.y = arc.Start.Y.ToDouble()
|
|
33
|
+
self.poly_steps.append(new_segment_tep)
|
|
34
|
+
if arc.Height == 0:
|
|
35
|
+
new_segment_tep = PolyStep()
|
|
36
|
+
new_segment_tep.poly_type = PolyType.Segment
|
|
37
|
+
new_segment_tep.x = arc.End.X.ToDouble()
|
|
38
|
+
new_segment_tep.y = arc.End.Y.ToDouble()
|
|
39
|
+
self.poly_steps.append(new_segment_tep)
|
|
40
|
+
else:
|
|
41
|
+
arc_center = arc.GetCenter()
|
|
42
|
+
new_poly_step = PolyStep()
|
|
43
|
+
new_poly_step.poly_type = PolyType.Curve
|
|
44
|
+
new_poly_step.center_X = arc_center.X.ToDouble()
|
|
45
|
+
new_poly_step.center_y = arc_center.Y.ToDouble()
|
|
46
|
+
new_poly_step.x = arc.End.X.ToDouble()
|
|
47
|
+
new_poly_step.y = arc.End.Y.ToDouble()
|
|
48
|
+
new_poly_step.clock_wise = not arc.IsCCW()
|
|
49
|
+
self.poly_steps.append(new_poly_step)
|
|
50
|
+
for arc in list(arcs)[1:]:
|
|
51
|
+
if arc.Height == 0:
|
|
52
|
+
new_segment_tep = PolyStep()
|
|
53
|
+
new_segment_tep.poly_type = PolyType.Segment
|
|
54
|
+
new_segment_tep.x = arc.End.X.ToDouble()
|
|
55
|
+
new_segment_tep.y = arc.End.Y.ToDouble()
|
|
56
|
+
self.poly_steps.append(new_segment_tep)
|
|
57
|
+
else:
|
|
58
|
+
arc_center = arc.GetCenter()
|
|
59
|
+
new_poly_step = PolyStep()
|
|
60
|
+
new_poly_step.poly_type = PolyType.Curve
|
|
61
|
+
new_poly_step.center_X = arc_center.X.ToDouble()
|
|
62
|
+
new_poly_step.center_y = arc_center.Y.ToDouble()
|
|
63
|
+
new_poly_step.x = arc.End.X.ToDouble()
|
|
64
|
+
new_poly_step.y = arc.End.Y.ToDouble()
|
|
65
|
+
new_poly_step.clock_wise = not arc.IsCCW()
|
|
66
|
+
self.poly_steps.append(new_poly_step)
|
|
67
|
+
|
|
68
|
+
@pyedb_function_handler()
|
|
69
|
+
def write_xml(self, net_root): # pragma no cover
|
|
70
|
+
if not self.poly_steps:
|
|
71
|
+
return
|
|
72
|
+
feature = ET.SubElement(net_root, "Features")
|
|
73
|
+
location = ET.SubElement(feature, "Location")
|
|
74
|
+
location.set("x", "0")
|
|
75
|
+
location.set("y", "0")
|
|
76
|
+
polyline = ET.SubElement(feature, "Polyline")
|
|
77
|
+
polyline_begin = ET.SubElement(polyline, "PolyBegin")
|
|
78
|
+
polyline_begin.set("x", str(self._ipc.from_meter_to_units(self.poly_steps[0].x, self._ipc.units)))
|
|
79
|
+
polyline_begin.set("y", str(self._ipc.from_meter_to_units(self.poly_steps[0].y, self._ipc.units)))
|
|
80
|
+
for poly_step in self.poly_steps[1:]:
|
|
81
|
+
poly_step.write_xml(polyline, self._ipc)
|
|
82
|
+
line_disc_ref = ET.SubElement(polyline, "LineDescRef")
|
|
83
|
+
line_disc_ref.set("id", self.width_ref_id)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class PathStep(object):
|
|
87
|
+
def __init__(self):
|
|
88
|
+
self.x = 0.0
|
|
89
|
+
self.y = 0.0
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
from pyedb.generic.general_methods import ET
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class PhyNet(object):
|
|
5
|
+
"""Class describing an IPC2581 physical net."""
|
|
6
|
+
|
|
7
|
+
def __init__(self):
|
|
8
|
+
self._name = ""
|
|
9
|
+
self._phy_net_points = []
|
|
10
|
+
|
|
11
|
+
@property
|
|
12
|
+
def name(self):
|
|
13
|
+
return self._name
|
|
14
|
+
|
|
15
|
+
@name.setter
|
|
16
|
+
def name(self, value): # pragma no cover
|
|
17
|
+
if isinstance(value, str):
|
|
18
|
+
self._name = value
|
|
19
|
+
|
|
20
|
+
@property
|
|
21
|
+
def phy_net_points(self):
|
|
22
|
+
return self._phy_net_points
|
|
23
|
+
|
|
24
|
+
@phy_net_points.setter
|
|
25
|
+
def phy_net_points(self, value): # pragma no cover
|
|
26
|
+
if isinstance(value, list):
|
|
27
|
+
if len([net for net in value if isinstance(net, PhyNetPoint)]) == len(value):
|
|
28
|
+
self._phy_net_points = value
|
|
29
|
+
|
|
30
|
+
def add_phy_net_point(self, point=None): # pragma no cover
|
|
31
|
+
if isinstance(point, PhyNetPoint):
|
|
32
|
+
self._phy_net_points.append(point)
|
|
33
|
+
|
|
34
|
+
def write_xml(self, step): # pragma no cover
|
|
35
|
+
if step:
|
|
36
|
+
phy_net = ET.SubElement(step, "PhyNet")
|
|
37
|
+
for phy_net_point in self.phy_net_points:
|
|
38
|
+
phy_net_point.write_xml(phy_net)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class PhyNetPoint(object):
|
|
42
|
+
"""Class describing an IPC2581 physical net point."""
|
|
43
|
+
|
|
44
|
+
def __init__(self):
|
|
45
|
+
self.x = 0.0
|
|
46
|
+
self.y = 0.0
|
|
47
|
+
self.layer_ref = ""
|
|
48
|
+
self.net_node_type = ""
|
|
49
|
+
self._exposure = ExposureType().Exposed
|
|
50
|
+
self.via = ""
|
|
51
|
+
self.standard_primitive_id = ""
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def exposure(self):
|
|
55
|
+
if self._exposure == ExposureType.Exposed:
|
|
56
|
+
return "EXPOSED"
|
|
57
|
+
elif self._exposure == ExposureType.CoveredPrimary:
|
|
58
|
+
return "COVERED_PRIMARY"
|
|
59
|
+
elif self._exposure == ExposureType.CoveredSecondary:
|
|
60
|
+
return "COVERED_SECONDARY"
|
|
61
|
+
|
|
62
|
+
def write_xml(self, phynet): # pragma no cover
|
|
63
|
+
if phynet:
|
|
64
|
+
phynet_point = ET.SubElement(phynet, "PhyNetPoint")
|
|
65
|
+
phynet_point.set("x", self.x)
|
|
66
|
+
phynet_point.set("y", self.y)
|
|
67
|
+
phynet_point.set("layerRef", self.layer_ref)
|
|
68
|
+
phynet_point.set("netNode", self.net_node_type)
|
|
69
|
+
phynet_point.set("exposure", self.exposure)
|
|
70
|
+
phynet_point.set("via", self.via)
|
|
71
|
+
primitive_ref = ET.SubElement(phynet_point, "StandardPrimitiveRef")
|
|
72
|
+
primitive_ref.set("id", self.standard_primitive_id)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class NetNodeType(object):
|
|
76
|
+
(Middle, End) = range(0, 2)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class ExposureType(object):
|
|
80
|
+
(CoveredPrimary, CoveredSecondary, Exposed) = range(0, 3)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from pyedb.generic.general_methods import ET
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Pin(object):
|
|
5
|
+
"""Class describing an ICP2581 component pin."""
|
|
6
|
+
|
|
7
|
+
def __init__(self):
|
|
8
|
+
self.number = ""
|
|
9
|
+
self.electrical_type = "ELECTRICAL"
|
|
10
|
+
self.x = 0.0
|
|
11
|
+
self.y = 0.0
|
|
12
|
+
self.rotation = 0.0
|
|
13
|
+
self.primitive_def = ""
|
|
14
|
+
self.is_via = False
|
|
15
|
+
|
|
16
|
+
def write_xml(self, package): # pragma no cover
|
|
17
|
+
pin = ET.SubElement(package, "Pin")
|
|
18
|
+
pin.set("number", str(self.number))
|
|
19
|
+
pin.set("type", "THRU")
|
|
20
|
+
pin.set("electricalType", self.electrical_type)
|
|
21
|
+
xform = ET.SubElement(pin, "Xform")
|
|
22
|
+
xform.set("rotation", str(self.rotation))
|
|
23
|
+
location = ET.SubElement(pin, "Location")
|
|
24
|
+
location.set("x", str(self.x))
|
|
25
|
+
location.set("y", str(self.y))
|
|
26
|
+
primitive_ref = ET.SubElement(pin, "StandardPrimitiveRef")
|
|
27
|
+
primitive_ref.set("id", self.primitive_def)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class Type(object):
|
|
31
|
+
(Thru, Surface) = range(0, 2)
|