From eb44de9fedb5e790c5910b933c2aef6ee324a9be Mon Sep 17 00:00:00 2001 From: nxi Date: Wed, 18 Sep 2024 22:48:21 +1000 Subject: [PATCH] add meer stater support --- .../scripts/gumpy/commons/sics.py | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/framework/gumpy/org.gumtree.gumpy.scripts/scripts/gumpy/commons/sics.py b/framework/gumpy/org.gumtree.gumpy.scripts/scripts/gumpy/commons/sics.py index 968326b67..f91626fd1 100644 --- a/framework/gumpy/org.gumtree.gumpy.scripts/scripts/gumpy/commons/sics.py +++ b/framework/gumpy/org.gumtree.gumpy.scripts/scripts/gumpy/commons/sics.py @@ -551,6 +551,24 @@ def wait_until_value_reached(device, value, precision = 0.01, timeout_if_not_cha else: logger.log(str(device) + ' failed to reach value ' + str(value) + ' in ' + str(total_count) + ' seconds') +def drive_ms(id, value, controller_name = 'tc1'): + entries = dict() + if type(id) is list or type(id) is tuple: + for i in xrange(len(id)): + did = id[i] + dname = controller_name + '_' + 'MEER{0:02d}'.format(did) + '_ObjectTemp_LOOP_0_TARGET' + if type(value) is list or type(value) is tuple: + dval = value[i] + else: + dval = value + entries[dname] = dval + print("multi_drive " + str(entries)) + sics.multiDrive(entries) + else : + did = controller_name + '_' + 'MEER{0:02d}'.format(id) + '_ObjectTemp_LOOP_0_TARGET' + print("drive {} {}".format(did, value)) + sics.drive(did, value) + def drive_all_ms(value, controller_name = 'tc1'): entries = dict() if type(value) is list or type(value) is tuple: @@ -569,7 +587,7 @@ def drive_all_ms(value, controller_name = 'tc1'): dname = controller_name + '_' + 'MEER{0:02d}'.format(i + 1) + '_ObjectTemp_LOOP_0_TARGET' entries[dname] = value print("multi_drive " + str(entries)) - sics.multiDrive(entries) + sics.multi_drive(entries) def run_ms(id, value, controller_name = 'tc1'): if type(id) is list or type(id) is tuple: @@ -581,7 +599,7 @@ def run_ms(id, value, controller_name = 'tc1'): else: dval = value print("run " + dname + ' ' + str(dval)) -# sics.run(dname, dval) + sics.run(dname, dval) else : did = controller_name + '_' + 'MEER{0:02d}'.format(id) + '_ObjectTemp_LOOP_0_TARGET' print("run " + did + ' ' + str(value)) @@ -593,7 +611,7 @@ def run_all_ms(value, controller_name = 'tc1'): dname = controller_name + '_' + 'MEER{0:02d}'.format(i + 1) + '_ObjectTemp_LOOP_0_TARGET' dval = value[i] print("run " + dname + ' ' + str(dval)) -# sics.run(dname, dval) + sics.run(dname, dval) else : tc = sics.getDeviceController('/sample/' + controller_name) if tc is None :