Script execution
This commit is contained in:
@@ -194,10 +194,21 @@ def plot_base_plate(points = None, show_detect = True, title = None):
|
||||
(xmin, xmax) = block.x_range
|
||||
(ymin, ymax) = block.y_range
|
||||
(xmin, ymin, xmax, ymax ) = block.roi
|
||||
r = plot_rectangle(p, xmin, ymin, xmax, ymax, width =1, color=colors[ get_blocks().index(block)], name = block.id)
|
||||
index = get_blocks().index(block)
|
||||
r = plot_rectangle(p, xmin, ymin, xmax, ymax, width =1, color=colors[index], name = block.id)
|
||||
#In the first time the plot shows, it takes some time for the color to be assigned
|
||||
#while r.color is None:
|
||||
# time.sleep(0.001)
|
||||
if block.id in ('A', 'F'):
|
||||
x, y = (xmin + xmax)/2, ymax + 5
|
||||
elif block.id in ('C', 'D'):
|
||||
x, y = (xmin + xmax)/2, ymin - 5
|
||||
elif block.id == 'B':
|
||||
x, y = xmax + 5, (ymin + ymax)/2
|
||||
elif block.id == 'E':
|
||||
x, y = xmin - 5, (ymin + ymax)/2
|
||||
|
||||
p.addText(x,y, str(block.id), r.color)
|
||||
|
||||
for puck in get_pucks(block.id):
|
||||
(xu, yu) = puck.led_uni
|
||||
@@ -229,3 +240,6 @@ def plot_base_plate(points = None, show_detect = True, title = None):
|
||||
plot_cross(p,point[0], point[1], size = 10, width = w, color = c, name = "P"+ str(points.index(point)))
|
||||
#plot_point(p,point[0], point[1], size = 5, color = Color.BLACK, name = "Pc"+ str(points.index(point)))
|
||||
|
||||
points = [(100, 140), (130, 77), (120, 130), (110, 100)]
|
||||
detect_pucks(points)
|
||||
plot_base_plate(points)
|
||||
|
||||
Reference in New Issue
Block a user