From a987d2b2e5fd2f444ae756c915ca4ca5d363a23f Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 21 Jan 2019 17:43:48 +0800 Subject: [PATCH] kasli_tester: skip Grabber test when no Grabber is present --- .../kasli_basic/repository/kasli_tester.py | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/artiq/examples/kasli_basic/repository/kasli_tester.py b/artiq/examples/kasli_basic/repository/kasli_tester.py index 8cc708d53..e6ba1c68f 100644 --- a/artiq/examples/kasli_basic/repository/kasli_tester.py +++ b/artiq/examples/kasli_basic/repository/kasli_tester.py @@ -310,18 +310,19 @@ class KasliTester(EnvExperiment): print("ROI sums: {}".format(n)) def test_grabbers(self): - print("*** Testing Grabber Frame Grabbers.") - print("Activate the camera's frame grabber output, type 'g', press " - "ENTER, and trigger the camera.") - print("Just press ENTER to skip the test.") - if input().strip().lower() != "g": - print("skipping...") - return - rois = [[0, 0, 0, 2, 2], [1, 0, 0, 2048, 2048]] - print("ROIs: {}".format(rois)) - for card_n, (card_name, card_dev) in enumerate(self.grabbers): - print(card_name) - self.grabber_capture(card_dev, rois) + if self.grabbers: + print("*** Testing Grabber Frame Grabbers.") + print("Activate the camera's frame grabber output, type 'g', press " + "ENTER, and trigger the camera.") + print("Just press ENTER to skip the test.") + if input().strip().lower() != "g": + print("skipping...") + return + rois = [[0, 0, 0, 2, 2], [1, 0, 0, 2048, 2048]] + print("ROIs: {}".format(rois)) + for card_n, (card_name, card_dev) in enumerate(self.grabbers): + print(card_name) + self.grabber_capture(card_dev, rois) def run(self): print("****** Kasli system tester ******")