Skip to content
Snippets Groups Projects
Commit d0c91828 authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-246: Update CP/MP names of SDP points now that they're capitalised

parent 35da0af0
No related branches found
No related tags found
1 merge request!51Resolve L2SS-246 "Capitalise sdp"
%% Cell type:code id:waiting-chance tags:
``` python
import time
```
%% Cell type:code id:moving-alexandria tags:
``` python
d=DeviceProxy("LTS/SDP/1")
```
%% Cell type:code id:ranking-aluminum tags:
``` python
state = str(d.state())
if state == "OFF":
d.initialise()
time.sleep(1)
state = str(d.state())
if state == "STANDBY":
d.on()
state = str(d.state())
if state == "ON":
print("Device is now in on state")
else:
print("warning, expected device to be in on state, is: ", state)
```
%% Output
warning, expected device to be in on state, is: FAULT
%% Cell type:code id:transsexual-battle tags:
``` python
values = [
[d.fpga_mask_RW, "fpga_mask_RW"],
[d.fpga_scrap_R, "fpga_scrap_R"],
[d.fpga_scrap_RW, "fpga_scrap_RW"],
[d.fpga_status_R, "fpga_status_R"],
[d.fpga_temp_R, "fpga_temp_R"],
[d.fpga_version_R, "fpga_version_R"],
[d.fpga_weights_R, "fpga_weights_R"],
[d.fpga_weights_RW, "fpga_weights_RW"],
[d.tr_busy_R, "tr_busy_R"],
[d.tr_reload_RW, "tr_reload_RW"],
# [d.tr_tod_R, "tr_tod_R"],
# [d.tr_uptime_R, "tr_uptime_R"]
[d.FPGA_mask_RW, "FPGA_mask_RW"],
[d.FPGA_scrap_R, "FPGA_scrap_R"],
[d.FPGA_scrap_RW, "FPGA_scrap_RW"],
[d.FPGA_status_R, "FPGA_status_R"],
[d.FPGA_temp_R, "FPGA_temp_R"],
[d.FPGA_version_R, "FPGA_version_R"],
[d.FPGA_weights_R, "FPGA_weights_R"],
[d.FPGA_weights_RW, "FPGA_weights_RW"],
[d.TR_busy_R, "TR_busy_R"],
[d.TR_reload_RW, "TR_reload_RW"],
# [d.TR_tod_R, "TR_tod_R"],
# [d.TR_uptime_R, "TR_uptime_R"]
]
for i in values:
print("🟦🟦🟦", i[1], ": ", i[0])
```
%% Cell type:code id:eligible-times tags:
``` python
attr_names = d.get_attribute_list()
for i in attr_names:
exec("value = print(i, d.{})".format(i))
```
%% Output
---------------------------------------------------------------------------
DevFailed Traceback (most recent call last)
<ipython-input-5-e44d5c52394a> in <module>
----> 1 d.tr_tod_R
----> 1 d.TR_tod_R
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __DeviceProxy__getattr(self, name)
319 attr_info = self.__get_attr_cache().get(name_l)
320 if attr_info:
--> 321 return __get_attribute_value(self, attr_info, name)
322
323 if name_l in self.__get_pipe_cache():
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __get_attribute_value(self, attr_info, name)
281 def __get_attribute_value(self, attr_info, name):
282 _, enum_class = attr_info
--> 283 attr_value = self.read_attribute(name).value
284 if enum_class:
285 return enum_class(attr_value)
/usr/local/lib/python3.7/dist-packages/tango/green.py in greener(obj, *args, **kwargs)
193 green_mode = access('green_mode', None)
194 executor = get_object_executor(obj, green_mode)
--> 195 return executor.run(fn, args, kwargs, wait=wait, timeout=timeout)
196
197 return greener
/usr/local/lib/python3.7/dist-packages/tango/green.py in run(self, fn, args, kwargs, wait, timeout)
107 # Sychronous (no delegation)
108 if not self.asynchronous or not self.in_executor_context():
--> 109 return fn(*args, **kwargs)
110 # Asynchronous delegation
111 accessor = self.delegate(fn, *args, **kwargs)
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __DeviceProxy__read_attribute(self, value, extract_as)
439
440 def __DeviceProxy__read_attribute(self, value, extract_as=ExtractAs.Numpy):
--> 441 return __check_read_attribute(self._read_attribute(value, extract_as))
442
443
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __check_read_attribute(dev_attr)
155 def __check_read_attribute(dev_attr):
156 if dev_attr.has_failed:
--> 157 raise DevFailed(*dev_attr.get_err_stack())
158 return dev_attr
159
DevFailed: DevFailed[
DevError[
desc = TypeError: Expecting a numeric type, but it is not. If you use a numpy type instead of python core types, then it must exactly match (ex: numpy.int32 for PyTango.DevLong)
origin = Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/tango/server.py", line 138, in read_attr
set_complex_value(attr, ret)
File "/usr/local/lib/python3.7/dist-packages/tango/server.py", line 115, in set_complex_value
attr.set_value(value)
TypeError: Expecting a numeric type, but it is not. If you use a numpy type instead of python core types, then it must exactly match (ex: numpy.int32 for PyTango.DevLong)
reason = PyDs_PythonError
severity = ERR]
DevError[
desc = Failed to read_attribute on device lts/sdp/1, attribute tr_tod_R
desc = Failed to read_attribute on device lts/sdp/1, attribute TR_tod_R
origin = DeviceProxy::read_attribute()
reason = API_AttributeFailed
severity = ERR]
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment