diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2016-07-12 23:39:42 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2016-07-12 23:39:42 +0200 |
commit | 7bd1cbc78f676a5cf4dd40f70ddc5ffdcea43cd3 (patch) | |
tree | bf4d1f79dde10fe330423d44393a1544f6d2711d /tests/timeout.py | |
parent | 41ae09fe6725f8ddd6800e6cb629edc95f771840 (diff) | |
parent | c09eaa3be331f1746744ef2562360528a8358dd1 (diff) | |
download | uca-ufo-7bd1cbc78f676a5cf4dd40f70ddc5ffdcea43cd3.tar.gz uca-ufo-7bd1cbc78f676a5cf4dd40f70ddc5ffdcea43cd3.tar.bz2 uca-ufo-7bd1cbc78f676a5cf4dd40f70ddc5ffdcea43cd3.tar.xz uca-ufo-7bd1cbc78f676a5cf4dd40f70ddc5ffdcea43cd3.zip |
Merge branch 'master' of https://github.com/ufo-kit/uca-ufo
Diffstat (limited to 'tests/timeout.py')
-rw-r--r-- | tests/timeout.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/timeout.py b/tests/timeout.py new file mode 100644 index 0000000..eede1e7 --- /dev/null +++ b/tests/timeout.py @@ -0,0 +1,43 @@ +import time +import argparse +import PyTango + + +def grab(camera, timeout, do_trigger): + camera.timeout = timeout + camera.trigger_source = 1 + + try: + camera.Start() + except: + camera.Stop() + camera.Start() + + start = time.time() + + try: + if do_trigger: + camera.Trigger() + + frame = camera.image + end = time.time() + print("Success after {} s".format(end -start)) + except PyTango.DevFailed: + end = time.time() + print("Timeout after {} s".format(end - start)) + + camera.Stop() + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--device', '-d', type=str, required=True, + help="TANGO device path") + + args = parser.parse_args() + + camera = PyTango.DeviceProxy(args.device) + grab(camera, 100000, False) + grab(camera, 100000, True) + grab(camera, 300000, False) + grab(camera, 300000, True) |