From 31dace8e9a9df76fb76e76e18e0a062f2fac9e3a Mon Sep 17 00:00:00 2001 From: gac-x04sa Date: Tue, 26 Feb 2019 13:46:56 +0100 Subject: [PATCH] Script execution --- script/local.py | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/script/local.py b/script/local.py index cdb2eda..18d3d2e 100644 --- a/script/local.py +++ b/script/local.py @@ -160,31 +160,35 @@ def trigger_detectors(position, scan): global count_id, image_filename count_time = get_count_time() pix_is_on = pixel in scan.readables - mythen.abort() + myt_is_on = mythen in scan.readables + if myt_is_on: + mythen.abort() open_shutter() try: if (count_time != 0): if pix_is_on: pixel.set_expose(count_time) pixel.start() - - if (count_time > 0): - mythen.set_acquire_time(count_time) - mythen.set_acquire_mode("Single") - mythen.start() - else: - print "Preset monitor counting is not supported\!" + + if myt_is_on: + if (count_time > 0): + mythen.set_acquire_time(count_time) + mythen.set_acquire_mode("Single") + mythen.start() + else: + print "Preset monitor counting is not supported\!" if pix_is_on: pixel.wait_finished(10.0) - - i = 0 - while (mythen.is_acquiring()): - time.sleep (0.05) - i += 1 - if (i * 0.05 >= count_time * 2): - print "MYTHEN Izero times out, status: " + str(mythen.get_status()) - break + + if myt_is_on: + i = 0 + while (mythen.is_acquiring()): + time.sleep (0.05) + i += 1 + if (i * 0.05 >= count_time * 2): + print "MYTHEN Izero times out, status: " + str(mythen.get_status()) + break if pix_is_on: image_filename = pixel.get_image_filename()