From 82ed0b7359ab3ba667c418eb2ddebc81f316237e Mon Sep 17 00:00:00 2001 From: gac-S_Changer Date: Tue, 11 Jul 2017 09:41:56 +0200 Subject: [PATCH] Script execution --- script/setup/Layout.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/script/setup/Layout.py b/script/setup/Layout.py index 7485511..6e61506 100644 --- a/script/setup/Layout.py +++ b/script/setup/Layout.py @@ -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)