-
Notifications
You must be signed in to change notification settings - Fork 0
/
PartPlacement.py
54 lines (46 loc) · 1.56 KB
/
PartPlacement.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
class PartPlacement():
"""PartPlacement contains all coordinate and physical info for a given component."""
def __init__(self,
component_ID,
feeder_ID = 0,
speed = 0,
height = 0,
rotation = 0,
designator = None,
head = 1,
x = 0.0,
y = 0.0,
place_component = True,
check_vacuum = True,
use_vision = True,
centroid_correction_x = 0,
centroid_correction_y = 0,
footprint = None,
value = None,
comment = None
):
self.component_ID = component_ID
self.feeder_ID = feeder_ID
self.speed = speed
self.height = height
self.rotation = rotation
self.designator = designator
self.head = head
self.x = x
self.y = y
self.place_component = place_component
self.check_vacuum = check_vacuum
self.use_vision = use_vision
self.centroid_correction_x = centroid_correction_x
self.centroid_correction_y = centroid_correction_y
self.footprint = footprint
self.value = value
self.comment = comment
# Print the name in a format that is easy to read in CharmHigh program
def component_name(self):
out = "{}".format(self.value)
if self.footprint:
out += "-{}".format(self.footprint)
return out
def __repr__(self):
return "<Component " + str(self.component_ID) + ": " + "Des: "+ self.designator + ", " + self.component_name() + "; " + "Feeder: " + str(self.feeder_ID) + ">"