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

updated small things

parent 544ceb95
No related branches found
No related tags found
1 merge request!164Resolve L2SS-334 "2021 10 21 replace streams with logger"
...@@ -154,7 +154,7 @@ class attribute_wrapper(attribute): ...@@ -154,7 +154,7 @@ class attribute_wrapper(attribute):
try: try:
self.read_function, self.write_function = client.setup_attribute(self.comms_annotation, self) self.read_function, self.write_function = client.setup_attribute(self.comms_annotation, self)
except Exception as e: except Exception as e:
raise Exception("Exception while setting %s attribute with annotation: '%s'", client.__class__.__name__, self.comms_annotation) from e raise Exception(f"Exception while setting {client.__class__.__name__} attribute with annotation: '{self.comms_annotation}'") from e
async def async_set_comm_client(self, client): async def async_set_comm_client(self, client):
""" """
...@@ -163,7 +163,7 @@ class attribute_wrapper(attribute): ...@@ -163,7 +163,7 @@ class attribute_wrapper(attribute):
try: try:
self.read_function, self.write_function = await client.setup_attribute(self.comms_annotation, self) self.read_function, self.write_function = await client.setup_attribute(self.comms_annotation, self)
except Exception as e: except Exception as e:
raise Exception("Exception while setting %s attribute with annotation: '%s'", client.__class__.__name__, self.comms_annotation) from e raise Exception(f"Exception while setting {client.__class__.__name__} attribute with annotation: '{self.comms_annotation}'") from e
def set_pass_func(self): def set_pass_func(self):
def pass_func(value=None): def pass_func(value=None):
......
%% Cell type:code id:waiting-chance tags: %% Cell type:code id:waiting-chance tags:
``` python ``` python
import time import time
import numpy import numpy
``` ```
%% Cell type:code id:moving-alexandria tags: %% Cell type:code id:moving-alexandria tags:
``` python ``` python
d=DeviceProxy("LTS/SST/1") d=DeviceProxy("LTS/UNB2/1")
``` ```
%% Cell type:code id:ranking-aluminum tags: %% Cell type:code id:ranking-aluminum tags:
``` python ``` python
state = str(d.state()) state = str(d.state())
if state == "OFF": if state == "OFF":
d.initialise() d.initialise()
time.sleep(1) time.sleep(1)
state = str(d.state()) state = str(d.state())
if state == "STANDBY": if state == "STANDBY":
d.on() d.on()
state = str(d.state()) state = str(d.state())
if state == "ON": if state == "ON":
print("Device is now in on state") print("Device is now in on state")
else:
print(f"Device is now in {state} state")
``` ```
%% Output %% Output
Device is now in on state Device is now in on state
%% Cell type:code id:beneficial-evidence tags: %% Cell type:code id:beneficial-evidence tags:
``` python ``` python
attr_names = d.get_attribute_list() attr_names = d.get_attribute_list()
print(attr_names)
print("\r\nAttributes:")
for i in attr_names: for i in attr_names:
exec("value = print(i, d.{})".format(i)) print(">>>\t",i)
#exec("value = print(i, d.{})".format(i))
print("Missing Attributes: \n", d.opcua_missing_attributes_R)
``` ```
%% Output %% Output
packet_count_R [55] ['version_R', 'opcua_missing_attributes_R', 'UNB2TR_translator_busy_R', 'UNB2_DC_DC_48V_12V_IOUT_R', 'UNB2_DC_DC_48V_12V_TEMP_R', 'UNB2_DC_DC_48V_12V_VIN_R', 'UNB2_DC_DC_48V_12V_VOUT_R', 'UNB2_EEPROM_Serial_Number_R', 'UNB2_EEPROM_Unique_ID_R', 'UNB2_FPGA_DDR4_SLOT_TEMP_R', 'UNB2_FPGA_POL_CORE_IOUT_R', 'UNB2_FPGA_POL_CORE_TEMP_R', 'UNB2_FPGA_POL_CORE_VOUT_R', 'UNB2_FPGA_POL_ERAM_IOUT_R', 'UNB2_FPGA_POL_ERAM_TEMP_R', 'UNB2_FPGA_POL_ERAM_VOUT_R', 'UNB2_FPGA_POL_HGXB_IOUT_R', 'UNB2_FPGA_POL_HGXB_TEMP_R', 'UNB2_FPGA_POL_HGXB_VOUT_R', 'UNB2_FPGA_POL_PGM_IOUT_R', 'UNB2_FPGA_POL_PGM_TEMP_R', 'UNB2_FPGA_POL_PGM_VOUT_R', 'UNB2_FPGA_POL_RXGXB_IOUT_R', 'UNB2_FPGA_POL_RXGXB_TEMP_R', 'UNB2_FPGA_POL_RXGXB_VOUT_R', 'UNB2_FPGA_POL_TXGXB_IOUT_R', 'UNB2_FPGA_POL_TXGXB_TEMP_R', 'UNB2_FPGA_POL_TXGXB_VOUT_R', 'UNB2_FPGA_QSFP_CAGE_LOS_R', 'UNB2_FPGA_QSFP_CAGE_TEMP_R', 'UNB2_Front_Panel_LED_R', 'UNB2_Front_Panel_LED_RW', 'UNB2_I2C_bus_DDR4_error_R', 'UNB2_I2C_bus_error_R', 'UNB2_I2C_bus_FPGA_PS_error_R', 'UNB2_I2C_bus_PS_error_R', 'UNB2_I2C_bus_QSFP_error_R', 'UNB2_mask_RW', 'UNB2_POL_CLOCK_IOUT_R', 'UNB2_POL_CLOCK_TEMP_R', 'UNB2_POL_CLOCK_VOUT_R', 'UNB2_POL_QSFP_N01_IOUT_R', 'UNB2_POL_QSFP_N01_TEMP_R', 'UNB2_POL_QSFP_N01_VOUT_R', 'UNB2_POL_QSFP_N23_IOUT_R', 'UNB2_POL_QSFP_N23_TEMP_R', 'UNB2_POL_QSFP_N23_VOUT_R', 'UNB2_POL_SWITCH_1V2_IOUT_R', 'UNB2_POL_SWITCH_1V2_TEMP_R', 'UNB2_POL_SWITCH_1V2_VOUT_R', 'UNB2_POL_SWITCH_PHY_IOUT_R', 'UNB2_POL_SWITCH_PHY_TEMP_R', 'UNB2_POL_SWITCH_PHY_VOUT_R', 'UNB2_PWR_off_R', 'UNB2_PWR_off_RW', 'State', 'Status']
last_packet_timestamp_R [1623249385]
queue_percentage_used_R [0.] Attributes:
State <function __get_command_func.<locals>.f at 0x7fcb205fd0d0> >>> version_R
Status <function __get_command_func.<locals>.f at 0x7fcb205fd0d0> >>> opcua_missing_attributes_R
>>> UNB2TR_translator_busy_R
>>> UNB2_DC_DC_48V_12V_IOUT_R
>>> UNB2_DC_DC_48V_12V_TEMP_R
>>> UNB2_DC_DC_48V_12V_VIN_R
>>> UNB2_DC_DC_48V_12V_VOUT_R
>>> UNB2_EEPROM_Serial_Number_R
>>> UNB2_EEPROM_Unique_ID_R
>>> UNB2_FPGA_DDR4_SLOT_TEMP_R
>>> UNB2_FPGA_POL_CORE_IOUT_R
>>> UNB2_FPGA_POL_CORE_TEMP_R
>>> UNB2_FPGA_POL_CORE_VOUT_R
>>> UNB2_FPGA_POL_ERAM_IOUT_R
>>> UNB2_FPGA_POL_ERAM_TEMP_R
>>> UNB2_FPGA_POL_ERAM_VOUT_R
>>> UNB2_FPGA_POL_HGXB_IOUT_R
>>> UNB2_FPGA_POL_HGXB_TEMP_R
>>> UNB2_FPGA_POL_HGXB_VOUT_R
>>> UNB2_FPGA_POL_PGM_IOUT_R
>>> UNB2_FPGA_POL_PGM_TEMP_R
>>> UNB2_FPGA_POL_PGM_VOUT_R
>>> UNB2_FPGA_POL_RXGXB_IOUT_R
>>> UNB2_FPGA_POL_RXGXB_TEMP_R
>>> UNB2_FPGA_POL_RXGXB_VOUT_R
>>> UNB2_FPGA_POL_TXGXB_IOUT_R
>>> UNB2_FPGA_POL_TXGXB_TEMP_R
>>> UNB2_FPGA_POL_TXGXB_VOUT_R
>>> UNB2_FPGA_QSFP_CAGE_LOS_R
>>> UNB2_FPGA_QSFP_CAGE_TEMP_R
>>> UNB2_Front_Panel_LED_R
>>> UNB2_Front_Panel_LED_RW
>>> UNB2_I2C_bus_DDR4_error_R
>>> UNB2_I2C_bus_error_R
>>> UNB2_I2C_bus_FPGA_PS_error_R
>>> UNB2_I2C_bus_PS_error_R
>>> UNB2_I2C_bus_QSFP_error_R
>>> UNB2_mask_RW
>>> UNB2_POL_CLOCK_IOUT_R
>>> UNB2_POL_CLOCK_TEMP_R
>>> UNB2_POL_CLOCK_VOUT_R
>>> UNB2_POL_QSFP_N01_IOUT_R
>>> UNB2_POL_QSFP_N01_TEMP_R
>>> UNB2_POL_QSFP_N01_VOUT_R
>>> UNB2_POL_QSFP_N23_IOUT_R
>>> UNB2_POL_QSFP_N23_TEMP_R
>>> UNB2_POL_QSFP_N23_VOUT_R
>>> UNB2_POL_SWITCH_1V2_IOUT_R
>>> UNB2_POL_SWITCH_1V2_TEMP_R
>>> UNB2_POL_SWITCH_1V2_VOUT_R
>>> UNB2_POL_SWITCH_PHY_IOUT_R
>>> UNB2_POL_SWITCH_PHY_TEMP_R
>>> UNB2_POL_SWITCH_PHY_VOUT_R
>>> UNB2_PWR_off_R
>>> UNB2_PWR_off_RW
>>> State
>>> Status
Missing Attributes:
('2:UNB2TR_translator_busy_R', '2:UNB2_EEPROM_Serial_Number_R', '2:UNB2_I2C_bus_DDR4_error_R', '2:UNB2_I2C_bus_error_R', '2:UNB2_I2C_bus_FPGA_PS_error_R', '2:UNB2_I2C_bus_PS_error_R', '2:UNB2_I2C_bus_QSFP_error_R', '2:UNB2_PWR_off_R', '2:UNB2_PWR_off_RW')
%% Cell type:code id:sporting-current tags: %% Cell type:code id:sporting-current tags:
``` python ``` python
d.RCU_mask_RW = [False, False, False, False, False, False, False, False, False, False, False, False, 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, False, False, False, False,
False, False, False, False, False, False, False, False,] False, False, False, False, False, False, False, False,]
time.sleep(1) time.sleep(1)
print(d.RCU_mask_RW) print(d.RCU_mask_RW)
monitor_rate = d.RCU_monitor_rate_RW monitor_rate = d.RCU_monitor_rate_RW
print("current monitoring rate: {}, setting to {}".format(monitor_rate, monitor_rate + 1)) print("current monitoring rate: {}, setting to {}".format(monitor_rate, monitor_rate + 1))
monitor_rate = monitor_rate + 1 monitor_rate = monitor_rate + 1
time.sleep(1) time.sleep(1)
``` ```
%% Output %% Output
3.0 [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]
---------------------------------------------------------------------------
ConnectionFailed Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __DeviceProxy__getattr(self, name)
326 try:
--> 327 self.__refresh_cmd_cache()
328 except Exception as e:
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __DeviceProxy__refresh_cmd_cache(self)
241 def __DeviceProxy__refresh_cmd_cache(self):
--> 242 cmd_list = self.command_list_query()
243 cmd_cache = {}
ConnectionFailed: DevFailed[
DevError[
desc = Device lts/sst/1 is not exported (hint: try starting the device server)
origin = DeviceProxy::get_corba_name()
reason = API_DeviceNotExported
severity = ERR]
]
The above exception was the direct cause of the following exception:
AttributeError Traceback (most recent call last)
/tmp/ipykernel_22/1020840340.py in <module>
5 print(d.RCU_mask_RW)
6
----> 7 monitor_rate = d.RCU_monitor_rate_RW
8 print("current monitoring rate: {}, setting to {}".format(monitor_rate, monitor_rate + 1))
9 monitor_rate = monitor_rate + 1
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __DeviceProxy__getattr(self, name)
353 return self.read_pipe(name)
354
--> 355 six.raise_from(AttributeError(name), cause)
356
357
/usr/local/lib/python3.7/dist-packages/six.py in raise_from(value, from_value)
AttributeError: RCU_monitor_rate_RW
%% Cell type:code id:sharing-mechanics tags: %% Cell type:code id:sharing-mechanics tags:
``` python ``` python
``` ```
%% Cell type:code id:ruled-tracy tags: %% Cell type:code id:ruled-tracy tags:
``` python ``` python
``` ```
......
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