Skip to content
Snippets Groups Projects
Commit c4d52d71 authored by Jasper Annyas's avatar Jasper Annyas
Browse files

L2SS-357:Renamed PCC to RECV

parent b9f19d4b
No related branches found
No related tags found
1 merge request!134Resolve L2SS-357 "Rename pcc to recv"
Showing
with 186 additions and 187 deletions
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
} }
} }
}, },
"PCC": { "RECV": {
"LTS": { "LTS": {
"PCC": { "RECV": {
"LTS/PCC/1": { "LTS/RECV/1": {
"attribute_properties": { "attribute_properties": {
"Ant_mask_RW": { "Ant_mask_RW": {
"archive_period": [ "archive_period": [
......
{ {
"servers": { "servers": {
"PCC": { "RECV": {
"LTS": { "LTS": {
"PCC": { "RECV": {
"LTS/PCC/1": { "LTS/RECV/1": {
"properties": { "properties": {
"OPC_Server_Name": [ "OPC_Server_Name": [
"pypcc-sim" "pyrecv-sim"
], ],
"OPC_Server_Port": [ "OPC_Server_Port": [
"4842" "4842"
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
} }
} }
}, },
"PCC": { "RECV": {
"LTS": { "LTS": {
"PCC": { "RECV": {
"LTS/PCC/1": { "LTS/RECV/1": {
"attribute_properties": { "attribute_properties": {
"Ant_mask_RW": { "Ant_mask_RW": {
"archive_period": [ "archive_period": [
......
{ {
"servers": { "servers": {
"PCC": { "RECV": {
"LTS": { "LTS": {
"PCC": { "RECV": {
"LTS/PCC/1": { "LTS/RECV/1": {
"properties": { "properties": {
"OPC_Server_Name": [ "OPC_Server_Name": [
"pypcc-sim" "pyrecv-sim"
], ],
"OPC_Server_Port": [ "OPC_Server_Port": [
"4842" "4842"
......
{ {
"servers": { "servers": {
"PCC": { "RECV": {
"1": { "1": {
"PCC": { "RECV": {
"LTS/PCC/1": { "LTS/RECV/1": {
"properties": { "properties": {
"OPC_Server_Name": [ "OPC_Server_Name": [
"ltspi.astron.nl" "ltspi.astron.nl"
......
{ {
"servers": { "servers": {
"PCC": { "RECV": {
"1": { "1": {
"PCC": { "RECV": {
"LTS/PCC/1": { "LTS/RECV/1": {
"properties": { "properties": {
"OPC_Server_Name": [ "OPC_Server_Name": [
"host.docker.internal" "host.docker.internal"
......
{ {
"servers": { "servers": {
"PCC": { "RECV": {
"LTS": { "LTS": {
"PCC": { "RECV": {
"LTS/PCC/1": { "LTS/RECV/1": {
"properties": { "properties": {
"OPC_Server_Name": [ "OPC_Server_Name": [
"okeanos" "okeanos"
......
{ {
"servers": { "servers": {
"PCC": { "RECV": {
"LTS": { "LTS": {
"PCC": { "RECV": {
"LTS/PCC/1": { "LTS/RECV/1": {
"properties": { "properties": {
"OPC_Server_Name": [ "OPC_Server_Name": [
"arm2" "arm2"
......
{ {
"servers": { "servers": {
"PCC": { "RECV": {
"1": { "1": {
"PCC": { "RECV": {
"LTS/PCC/1": { "LTS/RECV/1": {
"properties": { "properties": {
"OPC_Server_Name": [ "OPC_Server_Name": [
"host.docker.internal" "host.docker.internal"
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# This file is part of the PCC project # This file is part of the XXX project
# #
# #
# #
# Distributed under the terms of the APACHE license. # Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info. # See LICENSE.txt for more info.
""" PCC Device Server for LOFAR2.0 """Hardware Device Server for LOFAR2.0
""" """
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# This file is part of the PCC project # This file is part of the RECV project
# #
# #
# #
# Distributed under the terms of the APACHE license. # Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info. # See LICENSE.txt for more info.
""" PCC Device Server for LOFAR2.0 """ RECV Device Server for LOFAR2.0
""" """
...@@ -33,10 +33,10 @@ from devices.hardware_device import hardware_device ...@@ -33,10 +33,10 @@ from devices.hardware_device import hardware_device
from common.lofar_logging import device_logging_to_python, log_exceptions from common.lofar_logging import device_logging_to_python, log_exceptions
from common.lofar_git import get_version from common.lofar_git import get_version
__all__ = ["PCC", "main"] __all__ = ["RECV", "main"]
@device_logging_to_python() @device_logging_to_python()
class PCC(hardware_device): class RECV(hardware_device):
""" """
**Properties:** **Properties:**
...@@ -77,38 +77,38 @@ class PCC(hardware_device): ...@@ -77,38 +77,38 @@ class PCC(hardware_device):
# Attributes # Attributes
# ---------- # ----------
version_R = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version()) version_R = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version())
Ant_mask_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:Ant_mask_RW"], datatype=numpy.bool_, dims=(3, 32), access=AttrWriteType.READ_WRITE) Ant_mask_RW = attribute_wrapper(comms_annotation=["2:RECV", "2:Ant_mask_RW"], datatype=numpy.bool_, dims=(3, 32), access=AttrWriteType.READ_WRITE)
CLK_Enable_PWR_R = attribute_wrapper(comms_annotation=["2:PCC", "2:CLK_Enable_PWR_R"], datatype=numpy.bool_) CLK_Enable_PWR_R = attribute_wrapper(comms_annotation=["2:RECV", "2:CLK_Enable_PWR_R"], datatype=numpy.bool_)
CLK_I2C_STATUS_R = attribute_wrapper(comms_annotation=["2:PCC", "2:CLK_I2C_STATUS_R"], datatype=numpy.int64) CLK_I2C_STATUS_R = attribute_wrapper(comms_annotation=["2:RECV", "2:CLK_I2C_STATUS_R"], datatype=numpy.int64)
CLK_PLL_error_R = attribute_wrapper(comms_annotation=["2:PCC", "2:CLK_PLL_error_R"], datatype=numpy.bool_) CLK_PLL_error_R = attribute_wrapper(comms_annotation=["2:RECV", "2:CLK_PLL_error_R"], datatype=numpy.bool_)
CLK_PLL_locked_R = attribute_wrapper(comms_annotation=["2:PCC", "2:CLK_PLL_locked_R"], datatype=numpy.bool_) CLK_PLL_locked_R = attribute_wrapper(comms_annotation=["2:RECV", "2:CLK_PLL_locked_R"], datatype=numpy.bool_)
CLK_monitor_rate_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:CLK_monitor_rate_RW"], datatype=numpy.int64, access=AttrWriteType.READ_WRITE) CLK_monitor_rate_RW = attribute_wrapper(comms_annotation=["2:RECV", "2:CLK_monitor_rate_RW"], datatype=numpy.int64, access=AttrWriteType.READ_WRITE)
CLK_translator_busy_R = attribute_wrapper(comms_annotation=["2:PCC", "2:CLK_translator_busy_R"], datatype=numpy.bool_) CLK_translator_busy_R = attribute_wrapper(comms_annotation=["2:RECV", "2:CLK_translator_busy_R"], datatype=numpy.bool_)
HBA_element_beamformer_delays_R = attribute_wrapper(comms_annotation=["2:PCC", "2:HBA_element_beamformer_delays_R"], datatype=numpy.int64, dims=(32, 96)) HBA_element_beamformer_delays_R = attribute_wrapper(comms_annotation=["2:RECV", "2:HBA_element_beamformer_delays_R"], datatype=numpy.int64, dims=(32, 96))
HBA_element_beamformer_delays_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:HBA_element_beamformer_delays_RW"], datatype=numpy.int64, dims=(32, 96), access=AttrWriteType.READ_WRITE) HBA_element_beamformer_delays_RW = attribute_wrapper(comms_annotation=["2:RECV", "2:HBA_element_beamformer_delays_RW"], datatype=numpy.int64, dims=(32, 96), access=AttrWriteType.READ_WRITE)
HBA_element_led_R = attribute_wrapper(comms_annotation=["2:PCC", "2:HBA_element_led_R"], datatype=numpy.int64, dims=(32, 96)) HBA_element_led_R = attribute_wrapper(comms_annotation=["2:RECV", "2:HBA_element_led_R"], datatype=numpy.int64, dims=(32, 96))
HBA_element_led_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:HBA_element_led_RW"], datatype=numpy.int64, dims=(32, 96), access=AttrWriteType.READ_WRITE) HBA_element_led_RW = attribute_wrapper(comms_annotation=["2:RECV", "2:HBA_element_led_RW"], datatype=numpy.int64, dims=(32, 96), access=AttrWriteType.READ_WRITE)
HBA_element_LNA_pwr_R = attribute_wrapper(comms_annotation=["2:PCC", "2:HBA_element_LNA_pwr_R"], datatype=numpy.int64, dims=(32, 96)) HBA_element_LNA_pwr_R = attribute_wrapper(comms_annotation=["2:RECV", "2:HBA_element_LNA_pwr_R"], datatype=numpy.int64, dims=(32, 96))
HBA_element_LNA_pwr_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:HBA_element_LNA_pwr_RW"], datatype=numpy.int64, dims=(32, 96), access=AttrWriteType.READ_WRITE) HBA_element_LNA_pwr_RW = attribute_wrapper(comms_annotation=["2:RECV", "2:HBA_element_LNA_pwr_RW"], datatype=numpy.int64, dims=(32, 96), access=AttrWriteType.READ_WRITE)
HBA_element_pwr_R = attribute_wrapper(comms_annotation=["2:PCC", "2:HBA_element_pwr_R"], datatype=numpy.int64, dims=(32, 96)) HBA_element_pwr_R = attribute_wrapper(comms_annotation=["2:RECV", "2:HBA_element_pwr_R"], datatype=numpy.int64, dims=(32, 96))
HBA_element_pwr_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:HBA_element_pwr_RW"], datatype=numpy.int64, dims=(32, 96), access=AttrWriteType.READ_WRITE) HBA_element_pwr_RW = attribute_wrapper(comms_annotation=["2:RECV", "2:HBA_element_pwr_RW"], datatype=numpy.int64, dims=(32, 96), access=AttrWriteType.READ_WRITE)
RCU_ADC_lock_R = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_ADC_lock_R"], datatype=numpy.int64, dims=(3, 32)) RCU_ADC_lock_R = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_ADC_lock_R"], datatype=numpy.int64, dims=(3, 32))
RCU_attenuator_R = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_attenuator_R"], datatype=numpy.int64, dims=(3, 32)) RCU_attenuator_R = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_attenuator_R"], datatype=numpy.int64, dims=(3, 32))
RCU_attenuator_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_attenuator_RW"], datatype=numpy.int64, dims=(3, 32), access=AttrWriteType.READ_WRITE) RCU_attenuator_RW = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_attenuator_RW"], datatype=numpy.int64, dims=(3, 32), access=AttrWriteType.READ_WRITE)
RCU_band_R = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_band_R"], datatype=numpy.int64, dims=(3, 32)) RCU_band_R = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_band_R"], datatype=numpy.int64, dims=(3, 32))
RCU_band_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_band_RW"], datatype=numpy.int64, dims=(3, 32), access=AttrWriteType.READ_WRITE) RCU_band_RW = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_band_RW"], datatype=numpy.int64, dims=(3, 32), access=AttrWriteType.READ_WRITE)
RCU_I2C_STATUS_R = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_I2C_STATUS_R"], datatype=numpy.int64, dims=(32,)) RCU_I2C_STATUS_R = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_I2C_STATUS_R"], datatype=numpy.int64, dims=(32,))
RCU_ID_R = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_ID_R"], datatype=numpy.int64, dims=(32,)) RCU_ID_R = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_ID_R"], datatype=numpy.int64, dims=(32,))
RCU_LED0_R = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_LED0_R"], datatype=numpy.bool_, dims=(32,)) RCU_LED0_R = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_LED0_R"], datatype=numpy.bool_, dims=(32,))
RCU_LED0_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_LED0_RW"], datatype=numpy.bool_, dims=(32,), access=AttrWriteType.READ_WRITE) RCU_LED0_RW = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_LED0_RW"], datatype=numpy.bool_, dims=(32,), access=AttrWriteType.READ_WRITE)
RCU_LED1_R = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_LED1_R"], datatype=numpy.bool_, dims=(32,)) RCU_LED1_R = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_LED1_R"], datatype=numpy.bool_, dims=(32,))
RCU_LED1_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_LED1_RW"], datatype=numpy.bool_, dims=(32,), access=AttrWriteType.READ_WRITE) RCU_LED1_RW = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_LED1_RW"], datatype=numpy.bool_, dims=(32,), access=AttrWriteType.READ_WRITE)
RCU_mask_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_mask_RW"], datatype=numpy.bool_, dims=(32,), access=AttrWriteType.READ_WRITE) RCU_mask_RW = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_mask_RW"], datatype=numpy.bool_, dims=(32,), access=AttrWriteType.READ_WRITE)
RCU_monitor_rate_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_monitor_rate_RW"], datatype=numpy.int64, access=AttrWriteType.READ_WRITE) RCU_monitor_rate_RW = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_monitor_rate_RW"], datatype=numpy.int64, access=AttrWriteType.READ_WRITE)
RCU_Pwr_dig_R = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_Pwr_dig_R"], datatype=numpy.bool_, dims=(32,)) RCU_Pwr_dig_R = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_Pwr_dig_R"], datatype=numpy.bool_, dims=(32,))
RCU_temperature_R = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_temperature_R"], datatype=numpy.float64, dims=(32,)) RCU_temperature_R = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_temperature_R"], datatype=numpy.float64, dims=(32,))
RCU_translator_busy_R = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_translator_busy_R"], datatype=numpy.bool_) RCU_translator_busy_R = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_translator_busy_R"], datatype=numpy.bool_)
RCU_version_R = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_version_R"], datatype=numpy.str_, dims=(32,)) RCU_version_R = attribute_wrapper(comms_annotation=["2:RECV", "2:RCU_version_R"], datatype=numpy.str_, dims=(32,))
@log_exceptions() @log_exceptions()
def delete_device(self): def delete_device(self):
...@@ -156,7 +156,7 @@ class PCC(hardware_device): ...@@ -156,7 +156,7 @@ class PCC(hardware_device):
except Exception as e: except Exception as e:
# use the pass function instead of setting read/write fails # use the pass function instead of setting read/write fails
i.set_pass_func() i.set_pass_func()
self.warn_stream("error while setting the PCC attribute {} read/write function. {}".format(i, e)) self.warn_stream("error while setting the RECV attribute {} read/write function. {}".format(i, e))
self.OPCua_client.start() self.OPCua_client.start()
...@@ -247,12 +247,12 @@ class PCC(hardware_device): ...@@ -247,12 +247,12 @@ class PCC(hardware_device):
# Run server # Run server
# ---------- # ----------
def main(args=None, **kwargs): def main(args=None, **kwargs):
"""Main function of the PCC module.""" """Main function of the RECV module."""
from common.lofar_logging import configure_logger from common.lofar_logging import configure_logger
configure_logger() configure_logger()
return run((PCC,), args=args, **kwargs) return run((RECV,), args=args, **kwargs)
if __name__ == '__main__': if __name__ == '__main__':
......
This diff is collapsed.
...@@ -106,7 +106,7 @@ class ini_device(hardware_device): ...@@ -106,7 +106,7 @@ class ini_device(hardware_device):
# -------- # --------
def configure_for_initialise(self): def configure_for_initialise(self):
""" user code here. is called when the sate is set to INIT """ """ user code here. is called when the sate is set to INIT """
"""Initialises the attributes and properties of the PCC.""" """Initialises the attributes and properties of the Hardware."""
# set up the OPC ua client # set up the OPC ua client
self.ini_client = ini_client("example.ini", self.Fault, self) self.ini_client = ini_client("example.ini", self.Fault, self)
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# This file is part of the PCC project # This file is part of theRECV project
# #
# #
# #
...@@ -116,7 +116,7 @@ class SNMP(hardware_device): ...@@ -116,7 +116,7 @@ class SNMP(hardware_device):
# Run server # Run server
# ---------- # ----------
def main(args=None, **kwargs): def main(args=None, **kwargs):
"""Main function of the PCC module.""" """Main function of the module."""
from common.lofar_logging import configure_logger from common.lofar_logging import configure_logger
import logging import logging
......
...@@ -7,7 +7,7 @@ container will be build by the makefiles but should only be started by the ...@@ -7,7 +7,7 @@ container will be build by the makefiles but should only be started by the
dedicated integration test script. This script will ensure that other containers dedicated integration test script. This script will ensure that other containers
are running and are in the required state. are running and are in the required state.
* Launch pypcc-sim and sdptr-sim simulators. * Launch pyrecv-sim and sdptr-sim simulators.
* Reconfigure dsconfig to use these simulators. * Reconfigure dsconfig to use these simulators.
* Create and start the integration-test container. * Create and start the integration-test container.
......
...@@ -12,16 +12,15 @@ from opcua import Client ...@@ -12,16 +12,15 @@ from opcua import Client
from integration_test import base from integration_test import base
class TestAPSCTSim(base.IntegrationTestCase): class TestUNB2Sim(base.IntegrationTestCase):
def setUp(self): def setUp(self):
super(TestAPSCTSim, self).setUp() super(TestUNB2Sim, self).setUp()
def test_opcua_connection(self): def test_opcua_connection(self):
"""Check if we can connect to apsct-sim""" """Check if we can connect to unb2-sim"""
#TODO(Corne): Replace to APSCT name once simulator name has changed client = Client("opc.tcp://pyrecv-sim:4842")
client = Client("opc.tcp://pypcc-sim:4842")
root_node = None root_node = None
try: try:
......
...@@ -15,14 +15,14 @@ from tango._tango import DevState ...@@ -15,14 +15,14 @@ from tango._tango import DevState
from integration_test import base from integration_test import base
class TestDevicePCC(base.IntegrationTestCase): class TestDeviceRECV(base.IntegrationTestCase):
def setUp(self): def setUp(self):
super(TestDevicePCC, self).setUp() super(TestDeviceRECV, self).setUp()
def tearDown(self): def tearDown(self):
"""Turn device Off in teardown to prevent blocking tests""" """Turn device Off in teardown to prevent blocking tests"""
d = DeviceProxy("LTS/PCC/1") d = DeviceProxy("LTS/RECV/1")
try: try:
d.Off() d.Off()
...@@ -30,26 +30,26 @@ class TestDevicePCC(base.IntegrationTestCase): ...@@ -30,26 +30,26 @@ class TestDevicePCC(base.IntegrationTestCase):
"""Failing to turn Off devices should not raise errors here""" """Failing to turn Off devices should not raise errors here"""
print(f"Failed to turn device off in teardown {e}") print(f"Failed to turn device off in teardown {e}")
def test_device_proxy_pcc(self): def test_device_proxy_recv(self):
"""Test if we can successfully create a DeviceProxy and fetch state""" """Test if we can successfully create a DeviceProxy and fetch state"""
d = DeviceProxy("LTS/PCC/1") d = DeviceProxy("LTS/RECV/1")
self.assertEqual(DevState.OFF, d.state()) self.assertEqual(DevState.OFF, d.state())
def test_device_pcc_initialize(self): def test_device_recv_initialize(self):
"""Test if we can transition to standby""" """Test if we can transition to standby"""
d = DeviceProxy("LTS/PCC/1") d = DeviceProxy("LTS/RECV/1")
d.initialise() d.initialise()
self.assertEqual(DevState.STANDBY, d.state()) self.assertEqual(DevState.STANDBY, d.state())
def test_device_pcc_on(self): def test_device_recv_on(self):
"""Test if we can transition to on""" """Test if we can transition to on"""
d = DeviceProxy("LTS/PCC/1") d = DeviceProxy("LTS/RECV/1")
d.initialise() d.initialise()
......
...@@ -27,4 +27,4 @@ package_dir=./ ...@@ -27,4 +27,4 @@ package_dir=./
[entry_points] [entry_points]
console_scripts = console_scripts =
SDP = SDP:main SDP = SDP:main
PCC = PCC:main RECV = RECV:main
...@@ -222,7 +222,7 @@ class AttributeFormatException(Exception): ...@@ -222,7 +222,7 @@ class AttributeFormatException(Exception):
""" """
Exception that handles wrong attribute naming Exception that handles wrong attribute naming
""" """
def __init__(self, message="Wrong Tango attribute format! Try: domain/family/member/attribute (e.g. LTS/PCC/1/temperature)"): def __init__(self, message="Wrong Tango attribute format! Try: domain/family/member/attribute (e.g. LTS/RECV/1/temperature)"):
self.message = message self.message = message
super().__init__(self.message) super().__init__(self.message)
......
...@@ -60,10 +60,10 @@ def lts_cold_start(): ...@@ -60,10 +60,10 @@ def lts_cold_start():
# Define the LOFAR2.0 specific log format # Define the LOFAR2.0 specific log format
configure_logging() configure_logging()
# Get a reference to the PCC device, do not # Get a reference to the RECV device, do not
# force a restart of the already running Tango # force a restart of the already running Tango
# device. # device.
pcc = startup("LTS/PCC/1") recv = startup("LTS/RECV/1")
# Getting CLK, RCU & RCU ADCs into proper shape for use by real people. # Getting CLK, RCU & RCU ADCs into proper shape for use by real people.
# #
...@@ -86,51 +86,51 @@ def lts_cold_start(): ...@@ -86,51 +86,51 @@ def lts_cold_start():
# #
# #
# Steps 1.1 & 1.2 # Steps 1.1 & 1.2
pcc.CLK_off() recv.CLK_off()
# 2021-04-30, Thomas # 2021-04-30, Thomas
# This should be refactored into a function. # This should be refactored into a function.
timeout = 10.0 timeout = 10.0
while pcc.CLK_translator_busy_R is True: while recv.CLK_translator_busy_R is True:
logging.debug("Waiting on \"CLK_translator_busy_R\" to become \"True\"...") logging.debug("Waiting on \"CLK_translator_busy_R\" to become \"True\"...")
timeout = timeout - 1.0 timeout = timeout - 1.0
if timeout < 1.0: if timeout < 1.0:
# Switching the PCC clock off should never take longer than # Switching the RECV clock off should never take longer than
# 10 seconds. Here we ran into a timeout. # 10 seconds. Here we ran into a timeout.
# Clean up and raise an exception. # Clean up and raise an exception.
pcc.off() recv.off()
raise Exception("After calling \"CLK_off\" a timeout occured while waiting for \"CLK_translator_busy_R\" to become \"True\". Please investigate the reason why the PCC translator never set \"CLK_translator_busy_R\" to \"True\". Aborting start-up procedure.") raise Exception("After calling \"CLK_off\" a timeout occured while waiting for \"CLK_translator_busy_R\" to become \"True\". Please investigate the reason why the RECV translator never set \"CLK_translator_busy_R\" to \"True\". Aborting start-up procedure.")
sleep(1.0) sleep(1.0)
# Steps 1.3 & 1.4 # Steps 1.3 & 1.4
pcc.CLK_on() recv.CLK_on()
# Per Paulus this should never take longer than 2 seconds. # Per Paulus this should never take longer than 2 seconds.
# 2021-04-30, Thomas # 2021-04-30, Thomas
# This should be refactored into a function. # This should be refactored into a function.
timeout = 2.0 timeout = 2.0
while pcc.CLK_translator_busy_R is True: while recv.CLK_translator_busy_R is True:
logging.debug("After calling \"CLK_on()\" Waiting on \"CLK_translator_busy_R\" to become \"True\"...") logging.debug("After calling \"CLK_on()\" Waiting on \"CLK_translator_busy_R\" to become \"True\"...")
timeout = timeout - 1.0 timeout = timeout - 1.0
if timeout < 1.0: if timeout < 1.0:
# Switching the PCC clock on should never take longer than # Switching theRECV clock on should never take longer than
# a couple of seconds. Here we ran into a timeout. # a couple of seconds. Here we ran into a timeout.
# Clean up and raise an exception. # Clean up and raise an exception.
pcc.off() recv.off()
raise Exception("After calling \"CLK_on\" a timeout occured while waiting for \"CLK_translator_busy_R\" to become \"True\". Please investigate the reason why the PCC translator never set \"CLK_translator_busy_R\" to \"True\". Aborting start-up procedure.") raise Exception("After calling \"CLK_on\" a timeout occured while waiting for \"CLK_translator_busy_R\" to become \"True\". Please investigate the reason why the RECV translator never set \"CLK_translator_busy_R\" to \"True\". Aborting start-up procedure.")
sleep(1.0) sleep(1.0)
# 1.5 Check if CLK_PLL_locked_R == True # 1.5 Check if CLK_PLL_locked_R == True
# 2021-04-30, Thomas # 2021-04-30, Thomas
# This should be refactored into a function. # This should be refactored into a function.
clk_locked = pcc.CLK_PLL_locked_R clk_locked = recv.CLK_PLL_locked_R
if clk_locked is True: if clk_locked is True:
logging.info("CLK signal is locked.") logging.info("CLK signal is locked.")
else: else:
# CLK signal is not locked # CLK signal is not locked
clk_i2c_status = pcc.CLK_I2C_STATUS_R clk_i2c_status = recv.CLK_I2C_STATUS_R
exception_text = "CLK I2C is not working. Please investigate! Maybe power cycle subrack to restart CLK board and translator. Aborting start-up procedure." exception_text = "CLK I2C is not working. Please investigate! Maybe power cycle subrack to restart CLK board and translator. Aborting start-up procedure."
if i2c_status <= 0: if i2c_status <= 0:
exception_text = "CLK signal is not locked. Please investigate! The subrack probably do not receive clock input or the CLK PCB is broken. Aborting start-up procedure." exception_text = "CLK signal is not locked. Please investigate! The subrack probably do not receive clock input or the CLK PCB is broken. Aborting start-up procedure."
pcc.off() recv.off()
raise Exception(exception_text) raise Exception(exception_text)
# Step 1.6 # Step 1.6
# Done. # Done.
...@@ -150,40 +150,40 @@ def lts_cold_start(): ...@@ -150,40 +150,40 @@ def lts_cold_start():
# #
# Step 2.1 # Step 2.1
# We have only 8 RCUs in LTS. # We have only 8 RCUs in LTS.
pcc.RCU_mask_RW = [True, ] * 8 recv.RCU_mask_RW = [True, ] * 8
# Steps 2.2 & 2.3 # Steps 2.2 & 2.3
pcc.RCU_off() recv.RCU_off()
# 2021-04-30, Thomas # 2021-04-30, Thomas
# This should be refactored into a function. # This should be refactored into a function.
timeout = 10.0 timeout = 10.0
while pcc.RCU_translator_busy_R is True: while recv.RCU_translator_busy_R is True:
logging.debug("Waiting on \"RCU_translator_busy_R\" to become \"True\"...") logging.debug("Waiting on \"RCU_translator_busy_R\" to become \"True\"...")
timeout = timeout - 1.0 timeout = timeout - 1.0
if timeout < 1.0: if timeout < 1.0:
# Switching the RCUs off should never take longer than # Switching the RCUs off should never take longer than
# 10 seconds. Here we ran into a timeout. # 10 seconds. Here we ran into a timeout.
# Clean up and raise an exception. # Clean up and raise an exception.
pcc.off() recv.off()
raise Exception("After calling \"RCU_off\" a timeout occured while waiting for \"RCU_translator_busy_R\" to become \"True\". Please investigate the reason why the PCC translator never set \"RCU_translator_busy_R\" to \"True\". Aborting start-up procedure.") raise Exception("After calling \"RCU_off\" a timeout occured while waiting for \"RCU_translator_busy_R\" to become \"True\". Please investigate the reason why the RECV translator never set \"RCU_translator_busy_R\" to \"True\". Aborting start-up procedure.")
sleep(1.0) sleep(1.0)
# Steps 2.4 & 2.5 # Steps 2.4 & 2.5
# We leave the RCU mask as it is because it got already set for the # We leave the RCU mask as it is because it got already set for the
# RCU_off() call. # RCU_off() call.
pcc.RCU_on() recv.RCU_on()
# Per Paulus this should never take longer than 5 seconds. # Per Paulus this should never take longer than 5 seconds.
# 2021-04-30, Thomas # 2021-04-30, Thomas
# This should be refactored into a function. # This should be refactored into a function.
timeout = 5.0 timeout = 5.0
while pcc.RCU_translator_busy_R is True: while recv.RCU_translator_busy_R is True:
logging.debug("After calling \"RCU_on()\" Waiting on \"RCU_translator_busy_R\" to become \"True\"...") logging.debug("After calling \"RCU_on()\" Waiting on \"RCU_translator_busy_R\" to become \"True\"...")
timeout = timeout - 1.0 timeout = timeout - 1.0
if timeout < 1.0: if timeout < 1.0:
# Switching the RCUs on should never take longer than # Switching the RCUs on should never take longer than
# a couple of seconds. Here we ran into a timeout. # a couple of seconds. Here we ran into a timeout.
# Clean up and raise an exception. # Clean up and raise an exception.
pcc.off() recv.off()
raise Exception("After calling \"RCU_on\" a timeout occured while waiting for \"RCU_translator_busy_R\" to become \"True\". Please investigate the reason why the PCC translator never set \"RCU_translator_busy_R\" to \"True\". Aborting start-up procedure.") raise Exception("After calling \"RCU_on\" a timeout occured while waiting for \"RCU_translator_busy_R\" to become \"True\". Please investigate the reason why the RECV translator never set \"RCU_translator_busy_R\" to \"True\". Aborting start-up procedure.")
sleep(1.0) sleep(1.0)
# Step 2.6 # Step 2.6
# Done. # Done.
...@@ -196,9 +196,9 @@ def lts_cold_start(): ...@@ -196,9 +196,9 @@ def lts_cold_start():
# #
# #
# Steps 3.1 & 3.2 # Steps 3.1 & 3.2
rcu_mask = pcc.RCU_mask_RW rcu_mask = recv.RCU_mask_RW
adc_locked = numpy.array(pcc.RCU_ADC_lock_R) adc_locked = numpy.array(recv.RCU_ADC_lock_R)
for rcu, i2c_status in enumerate(pcc.RCU_I2C_STATUS_R): for rcu, i2c_status in enumerate(recv.RCU_I2C_STATUS_R):
if i2c_status == 0: if i2c_status == 0:
rcu_mask[rcu] = True rcu_mask[rcu] = True
logging.info("RCU #{} is available.".format(rcu)) logging.info("RCU #{} is available.".format(rcu))
...@@ -209,7 +209,7 @@ def lts_cold_start(): ...@@ -209,7 +209,7 @@ def lts_cold_start():
# The RCU's I2C bus is not working. # The RCU's I2C bus is not working.
rcu_mask[rcu] = False rcu_mask[rcu] = False
logging.error("RCU #{}'s I2C is not working. Please investigate! Disabling RCU #{} to avoid damage.".format(rcu, rcu)) logging.error("RCU #{}'s I2C is not working. Please investigate! Disabling RCU #{} to avoid damage.".format(rcu, rcu))
pcc.RCU_mask_RW = rcu_mask recv.RCU_mask_RW = rcu_mask
# Step 3.3 # Step 3.3
# Done # Done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment