Skip to content
Snippets Groups Projects
Commit d6faf226 authored by Taya Snijder's avatar Taya Snijder
Browse files

removed value caching for RW attributes and instead fetch values from hardware

parent 45f70341
No related branches found
No related tags found
1 merge request!197Resolve L2SS-363 "01 12 2021 get rw values from hardware"
......@@ -70,19 +70,7 @@ class attribute_wrapper(attribute):
max_dim_y = 0
if access == AttrWriteType.READ_WRITE:
""" if the attribute is of READ_WRITE type, assign the RW and write function to it"""
@only_in_states([DevState.STANDBY, DevState.ON], log=False)
@fault_on_error()
def read_RW(device):
# print("read_RW {}, {}x{}, {}, {}".format(me.name, me.dim_x, me.dim_y, me.attr_type, me.value))
"""
read_RW returns the value that was last written to the attribute
"""
try:
return device.value_dict[self]
except Exception as e:
raise Exception(f"Attribute read_RW function error, attempted to read value_dict with key: `{self}`, are you sure this exists?") from e
""" if the attribute is of READ_WRITE type, assign the write function to it"""
@only_in_states([DevState.STANDBY, DevState.ON], log=False)
@fault_on_error()
......@@ -92,14 +80,11 @@ class attribute_wrapper(attribute):
"""
self.write_function(value)
device.value_dict[self] = value
self.fget = read_RW
self.fset = write_RW
else:
""" if the attribute is of READ type, assign the read function to it"""
""" Assign the read function to the attribute"""
@only_in_states([DevState.STANDBY, DevState.ON], log=False)
@fault_on_error()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment