diff --git a/script/test/TestLayout.py b/script/test/TestLayout.py index e8b8015..8cf9c1e 100644 --- a/script/test/TestLayout.py +++ b/script/test/TestLayout.py @@ -1,33 +1,34 @@ from plotutils import * -colors = (Color.RED, Color.BLUE, Color.MAGENTA, Color(128,0,128), Color(0,128,0), Color(255,128,0)) -p = plot(None)[0] -plot_point(p, 0, 0, size = 10, color = Color.GRAY, name = "Center") -#p.setLegendVisible(True) -for block in get_blocks(): - print block.id - print block - (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) - #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) +def plot_base_plate(title = None) + colors = (Color.RED, Color.BLUE, Color.MAGENTA, Color(128,0,128), Color(0,128,0), Color(255,128,0)) + p = plot(None, title=title)[0] + plot_point(p, 0, 0, size = 10, color = Color.GRAY, name = "Center") + #p.setLegendVisible(True) + for block in get_blocks(): + print block.id + print block + (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) + #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) + + for puck in get_pucks(block.id): + print puck.number + (xu, yu) = puck.led_uni + (xm, ym) = puck.led_mini + plot_point(p, xu, yu, size = 3, color = r.color, name = str(puck.number)+"u") + plot_point(p, xm, ym, size = 7, color = r.color, name = str(puck.number)+"m") + plot_circle(p, xu, yu, LED_TOLERANCE, width = 0, color = r.color, name = str(puck.number)+"uc") + plot_circle(p, xm, ym, LED_TOLERANCE, width = 0, color = r.color, name = str(puck.number)+"mc") + p.addText((xu+xm)/2, (yu+ym)/2, str(puck.number), r.color) + plot_circle(p, xm, ym, PUCK_SIZE/2, width = 0, color = Color.GRAY, name = str(puck.number)) - for puck in get_pucks(block.id): - print puck.number - (xu, yu) = puck.led_uni - (xm, ym) = puck.led_mini - plot_point(p, xu, yu, size = 3, color = r.color, name = str(puck.number)+"u") - plot_point(p, xm, ym, size = 7, color = r.color, name = str(puck.number)+"m") - plot_circle(p, xu, yu, LED_TOLERANCE, width = 0, color = r.color, name = str(puck.number)+"uc") - plot_circle(p, xm, ym, LED_TOLERANCE, width = 0, color = r.color, name = str(puck.number)+"mc") - p.addText((xu+xm)/2, (yu+ym)/2, str(puck.number), r.color) - plot_circle(p, xm, ym, PUCK_SIZE/2, width = 0, color = Color.GRAY, name = str(puck.number)) - - - + +