Skip to content

Commit

Permalink
add meer stater support
Browse files Browse the repository at this point in the history
  • Loading branch information
nxi committed Sep 18, 2024
1 parent 30449a0 commit eb44de9
Showing 1 changed file with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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))
Expand All @@ -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 :
Expand Down

0 comments on commit eb44de9

Please sign in to comment.