Skip to content
Snippets Groups Projects
Commit 536be947 authored by BRONES Romain's avatar BRONES Romain
Browse files

Add captureattr util function

parent 6c3923c2
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,32 @@ def searchattr(prx, attr, ignorecase=True):
else:
return [a for a in prx.get_attribute_list() if attr in a]
def captureattr(prx):
"""
Capture all attributes in the device, return a python dict.
PARAMETERS
----------
prx: tango.DeviceProxy
Proxy to the device.
RETURN
------
attrs: dict
keys are attributes names, values are values.
"""
attrs=dict()
attrlist=prx.get_attribute_list()
R= prx.read_attributes(attrlist, wait=True)
for r in R:
attrs[r.name.lower()]=r.value
return attrs
###############################################################################
# FUNCTIONS ON TANGO DATABASE
###############################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment