From e690b52624e9d5ce2e60e04b66408064615f375c Mon Sep 17 00:00:00 2001 From: thijs snijder <snijder@astron.nl> Date: Wed, 6 Jul 2022 10:38:34 +0200 Subject: [PATCH] changed pdu to psoc --- .../tangostationcontrol/devices/boot.py | 2 +- .../tangostationcontrol/devices/pdu.py | 20 +++++++++---------- .../devices/temperature_manager.py | 2 +- .../default/devices/test_device_pdu.py | 4 ++-- .../test_device_temperature_manager.py | 2 +- .../test/devices/test_pdu_device.py | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tangostationcontrol/tangostationcontrol/devices/boot.py b/tangostationcontrol/tangostationcontrol/devices/boot.py index 3e1dbcb6f..d5834e231 100644 --- a/tangostationcontrol/tangostationcontrol/devices/boot.py +++ b/tangostationcontrol/tangostationcontrol/devices/boot.py @@ -233,7 +233,7 @@ class Boot(lofar_device): dtype='DevVarStringArray', mandatory=False, default_value=["STAT/Docker/1", # Docker controls the device containers, so it goes before anything else - "STAT/PDU/1", # PDU boot early to detect power delivery failure as fast as possible + "STAT/PSOC/1", # PSOC boot early to detect power delivery failure as fast as possible "STAT/APSPU/1", # APS Power Units control other hardware we want to initialise "STAT/APSCT/1", "STAT/RECV/1", # RCUs are input for SDP, so initialise them first diff --git a/tangostationcontrol/tangostationcontrol/devices/pdu.py b/tangostationcontrol/tangostationcontrol/devices/pdu.py index 99b4269de..e599563fd 100644 --- a/tangostationcontrol/tangostationcontrol/devices/pdu.py +++ b/tangostationcontrol/tangostationcontrol/devices/pdu.py @@ -3,7 +3,7 @@ # Distributed under the terms of the APACHE license. # See LICENSE.txt for more info. -""" PDU Device Server for LOFAR2.0 +""" PSOC Device Server for LOFAR2.0 """ @@ -29,11 +29,11 @@ debug.setLogger(debug.Debug('searcher', "compiler", "borrower", "reader")) logger = logging.getLogger() -__all__ = ["PDU", "main"] +__all__ = ["PSOC", "main"] @device_logging_to_python() -class PDU(lofar_device): +class PSOC(lofar_device): # ----------------- # Device Properties # ----------------- @@ -70,9 +70,9 @@ class PDU(lofar_device): # ---------- # Attributes # ---------- - sockets_state_R = attribute_wrapper(comms_annotation={"mib": "PowerNet-MIB", "name": "sPDUOutletCtl", "index": 1}, dims=(8,), datatype=str) - master_state_R = attribute_wrapper(comms_annotation={"mib": "PowerNet-MIB", "name": "sPDUMasterState"}, datatype=str) - current_load_R = attribute_wrapper(comms_annotation={"mib": "PowerNet-MIB", "name": "rPDULoadStatusLoad", "index": 1}, datatype=numpy.int64) + sockets_state_R = attribute_wrapper(comms_annotation={"mib": "PowerNet-MIB", "name": "sPSOCOutletCtl", "index": 1}, dims=(8,), datatype=str) + master_state_R = attribute_wrapper(comms_annotation={"mib": "PowerNet-MIB", "name": "sPSOCMasterState"}, datatype=str) + current_load_R = attribute_wrapper(comms_annotation={"mib": "PowerNet-MIB", "name": "rPSOCLoadStatusLoad", "index": 1}, datatype=numpy.int64) uptime_R = attribute_wrapper(comms_annotation={"mib": "SNMPv2-MIB", "name": "sysUpTime"}, datatype=numpy.int64) # -------- @@ -116,7 +116,7 @@ class PDU(lofar_device): def _toggle_socket(self, socket_name, on: bool): """ - This function is tailored to the "APS switched rack PDU", changing the psoc will require some changes to this function + This function is tailored to the "APS switched rack PSOC", changing the psoc will require some changes to this function """ try: @@ -131,7 +131,7 @@ class PDU(lofar_device): socket_set = "outletOff" # create the snmp_attribute for the correct socket - attr = snmp_attribute(self.snmp_manager.SNMP_comm, "PowerNet-MIB", name="sPDUOutletCtl", idx=socket_nr, dtype=str, dim_x=1, dim_y=0) + attr = snmp_attribute(self.snmp_manager.SNMP_comm, "PowerNet-MIB", name="sPSOCOutletCtl", idx=socket_nr, dtype=str, dim_x=1, dim_y=0) # write the correct value attr.write_function([socket_set]) @@ -189,5 +189,5 @@ class PDU(lofar_device): # Run server # ---------- def main(**kwargs): - """Main function of the PDU module.""" - return entry(PDU, **kwargs) + """Main function of the PSOC module.""" + return entry(PSOC, **kwargs) diff --git a/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py b/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py index b4671a47e..912753f82 100644 --- a/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py +++ b/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py @@ -153,7 +153,7 @@ class TemperatureManager(lofar_device): DeviceProxy("STAT/RECV/1").off() DeviceProxy("STAT/APSCT/1").off() DeviceProxy("STAT/APSPU/1").off() - DeviceProxy("STAT/PDU/1").off() + DeviceProxy("STAT/PSOC/1").off() logger.warning(f"Temperature alarm triggered auto shutdown of all hardware devices") # ---------- diff --git a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_pdu.py b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_pdu.py index 661c21c88..e1c3f2b20 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_pdu.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_pdu.py @@ -10,10 +10,10 @@ from tangostationcontrol.integration_test.default.devices.base import AbstractTestBases -class TestDevicePDU(AbstractTestBases.TestDeviceBase): +class TestDevicePSOC(AbstractTestBases.TestDeviceBase): def setUp(self): - super().setUp("STAT/PDU/1") + super().setUp("STAT/PSOC/1") def test_device_read_all_attributes(self): """Mask reading attributes not possible without SNMP""" diff --git a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_temperature_manager.py b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_temperature_manager.py index 198a4cba2..7944ac743 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_temperature_manager.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_temperature_manager.py @@ -60,7 +60,7 @@ class TestDeviceTemperatureManager(AbstractTestBases.TestDeviceBase): self.proxy.on() devices = [DeviceProxy("STAT/SDP/1"), DeviceProxy("STAT/UNB2/1"), DeviceProxy("STAT/RECV/1"), - DeviceProxy("STAT/APSCT/1"), DeviceProxy("STAT/APSPU/1"), DeviceProxy("STAT/PDU/1")] + DeviceProxy("STAT/APSCT/1"), DeviceProxy("STAT/APSPU/1"), DeviceProxy("STAT/PSOC/1")] # make sure none of the devices are in the OFF state. Any other state is fine for dev in devices: diff --git a/tangostationcontrol/tangostationcontrol/test/devices/test_pdu_device.py b/tangostationcontrol/tangostationcontrol/test/devices/test_pdu_device.py index 7ae03cbea..f6951904d 100644 --- a/tangostationcontrol/tangostationcontrol/test/devices/test_pdu_device.py +++ b/tangostationcontrol/tangostationcontrol/test/devices/test_pdu_device.py @@ -10,7 +10,7 @@ from tangostationcontrol.test.devices import device_base -class TestPDUDevice(device_base.DeviceTestCase): +class TestPSOCDevice(device_base.DeviceTestCase): # some dummy values for mandatory properties @@ -28,4 +28,4 @@ class TestPDUDevice(device_base.DeviceTestCase): def setUp(self): # DeviceTestCase setUp patches lofar_device DeviceProxy - super(TestPDUDevice, self).setUp() + super(TestPSOCDevice, self).setUp() -- GitLab