Skip to content
Snippets Groups Projects

Resolve L2SS-334 "2021 10 21 replace streams with logger"

Merged Resolve L2SS-334 "2021 10 21 replace streams with logger"
All threads resolved!
Merged Taya Snijder requested to merge L2SS-334_2021-10-21_replace_streams_with_logger into master
All threads resolved!
Files
20
 
%% Cell type:code id:waiting-chance tags:
 
``` python
 
import time
 
import numpy
 
%% Cell type:code id:moving-alexandria tags:
 
``` python
 
d=DeviceProxy("LTS/XST/1")
 
%% Output
 
---------------------------------------------------------------------------
 
DevFailed Traceback (most recent call last)
 
/tmp/ipykernel_22/3496973635.py in <module>
 
----> 1 d=DeviceProxy("LTS/XST/1")
 
 
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __DeviceProxy__init__(self, *args, **kwargs)
 
205 self._executors[GreenMode.Gevent] = kwargs.pop('threadpool', None)
 
206 self._executors[GreenMode.Asyncio] = kwargs.pop('asyncio_executor', None)
 
--> 207 return DeviceProxy.__init_orig__(self, *args, **kwargs)
 
208
 
209
 
DevFailed: DevFailed[
 
DevError[
 
desc = device lts/xst/1 not defined in the database !
 
origin = DataBase::ImportDevice()
 
reason = DB_DeviceNotDefined
 
severity = ERR]
 
 
DevError[
 
desc = Failed to execute command_inout on device sys/database/2, command DbImportDevice
 
origin = Connection::command_inout()
 
reason = API_CommandFailed
 
severity = ERR]
 
 
DevError[
 
desc = Can't connect to device lts/xst/1
 
origin = DeviceProxy::DeviceProxy
 
reason = API_DeviceNotDefined
 
severity = ERR]
 
]
 
%% 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")
 
%% Output
 
---------------------------------------------------------------------------
 
NameError Traceback (most recent call last)
 
/tmp/ipykernel_22/3213548382.py in <module>
 
----> 1 state = str(d.state())
 
2
 
3 if state == "OFF":
 
4 d.initialise()
 
5 time.sleep(1)
 
NameError: name 'd' is not defined
 
%% Cell type:code id:beneficial-evidence tags:
 
``` python
 
attr_names = d.get_attribute_list()
 
 
for i in attr_names:
 
exec("value = print(i, d.{})".format(i))
 
%% Output
 
packet_count_R [55]
 
last_packet_timestamp_R [1623249385]
 
queue_percentage_used_R [0.]
 
State <function __get_command_func.<locals>.f at 0x7fcb205fd0d0>
 
Status <function __get_command_func.<locals>.f at 0x7fcb205fd0d0>
 
%% Cell type:code id:sporting-current tags:
 
``` python
 
d.RCU_mask_RW = [False, False, False, False, False, False, False, False, False, False, False, False,
 
False, False, False, False, False, False, False, False, False, False, False, False,
 
False, False, False, False, False, False, False, False,]
 
time.sleep(1)
 
print(d.RCU_mask_RW)
 
 
monitor_rate = d.RCU_monitor_rate_RW
 
print("current monitoring rate: {}, setting to {}".format(monitor_rate, monitor_rate + 1))
 
monitor_rate = monitor_rate + 1
 
 
time.sleep(1)
 
%% Output
 
3.0
 
%% Cell type:code id:sharing-mechanics tags:
 
``` python
 
%% Cell type:code id:ruled-tracy tags:
 
``` python
Loading