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

changed pdu to psoc

parent 0ee2e892
Branches
Tags
1 merge request!376Resolve L2SS-801 "Rename pdu to psoc"
...@@ -233,7 +233,7 @@ class Boot(lofar_device): ...@@ -233,7 +233,7 @@ class Boot(lofar_device):
dtype='DevVarStringArray', dtype='DevVarStringArray',
mandatory=False, mandatory=False,
default_value=["STAT/Docker/1", # Docker controls the device containers, so it goes before anything else 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/APSPU/1", # APS Power Units control other hardware we want to initialise
"STAT/APSCT/1", "STAT/APSCT/1",
"STAT/RECV/1", # RCUs are input for SDP, so initialise them first "STAT/RECV/1", # RCUs are input for SDP, so initialise them first
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# 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.
""" PDU Device Server for LOFAR2.0 """ PSOC Device Server for LOFAR2.0
""" """
...@@ -29,11 +29,11 @@ debug.setLogger(debug.Debug('searcher', "compiler", "borrower", "reader")) ...@@ -29,11 +29,11 @@ debug.setLogger(debug.Debug('searcher', "compiler", "borrower", "reader"))
logger = logging.getLogger() logger = logging.getLogger()
__all__ = ["PDU", "main"] __all__ = ["PSOC", "main"]
@device_logging_to_python() @device_logging_to_python()
class PDU(lofar_device): class PSOC(lofar_device):
# ----------------- # -----------------
# Device Properties # Device Properties
# ----------------- # -----------------
...@@ -70,9 +70,9 @@ class PDU(lofar_device): ...@@ -70,9 +70,9 @@ class PDU(lofar_device):
# ---------- # ----------
# Attributes # Attributes
# ---------- # ----------
sockets_state_R = attribute_wrapper(comms_annotation={"mib": "PowerNet-MIB", "name": "sPDUOutletCtl", "index": 1}, dims=(8,), datatype=str) 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": "sPDUMasterState"}, 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": "rPDULoadStatusLoad", "index": 1}, datatype=numpy.int64) 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) uptime_R = attribute_wrapper(comms_annotation={"mib": "SNMPv2-MIB", "name": "sysUpTime"}, datatype=numpy.int64)
# -------- # --------
...@@ -116,7 +116,7 @@ class PDU(lofar_device): ...@@ -116,7 +116,7 @@ class PDU(lofar_device):
def _toggle_socket(self, socket_name, on: bool): 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: try:
...@@ -131,7 +131,7 @@ class PDU(lofar_device): ...@@ -131,7 +131,7 @@ class PDU(lofar_device):
socket_set = "outletOff" socket_set = "outletOff"
# create the snmp_attribute for the correct socket # 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 # write the correct value
attr.write_function([socket_set]) attr.write_function([socket_set])
...@@ -189,5 +189,5 @@ class PDU(lofar_device): ...@@ -189,5 +189,5 @@ class PDU(lofar_device):
# Run server # Run server
# ---------- # ----------
def main(**kwargs): def main(**kwargs):
"""Main function of the PDU module.""" """Main function of the PSOC module."""
return entry(PDU, **kwargs) return entry(PSOC, **kwargs)
...@@ -153,7 +153,7 @@ class TemperatureManager(lofar_device): ...@@ -153,7 +153,7 @@ class TemperatureManager(lofar_device):
DeviceProxy("STAT/RECV/1").off() DeviceProxy("STAT/RECV/1").off()
DeviceProxy("STAT/APSCT/1").off() DeviceProxy("STAT/APSCT/1").off()
DeviceProxy("STAT/APSPU/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") logger.warning(f"Temperature alarm triggered auto shutdown of all hardware devices")
# ---------- # ----------
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
from tangostationcontrol.integration_test.default.devices.base import AbstractTestBases from tangostationcontrol.integration_test.default.devices.base import AbstractTestBases
class TestDevicePDU(AbstractTestBases.TestDeviceBase): class TestDevicePSOC(AbstractTestBases.TestDeviceBase):
def setUp(self): def setUp(self):
super().setUp("STAT/PDU/1") super().setUp("STAT/PSOC/1")
def test_device_read_all_attributes(self): def test_device_read_all_attributes(self):
"""Mask reading attributes not possible without SNMP""" """Mask reading attributes not possible without SNMP"""
......
...@@ -60,7 +60,7 @@ class TestDeviceTemperatureManager(AbstractTestBases.TestDeviceBase): ...@@ -60,7 +60,7 @@ class TestDeviceTemperatureManager(AbstractTestBases.TestDeviceBase):
self.proxy.on() self.proxy.on()
devices = [DeviceProxy("STAT/SDP/1"), DeviceProxy("STAT/UNB2/1"), DeviceProxy("STAT/RECV/1"), 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 # make sure none of the devices are in the OFF state. Any other state is fine
for dev in devices: for dev in devices:
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
from tangostationcontrol.test.devices import device_base from tangostationcontrol.test.devices import device_base
class TestPDUDevice(device_base.DeviceTestCase): class TestPSOCDevice(device_base.DeviceTestCase):
# some dummy values for mandatory properties # some dummy values for mandatory properties
...@@ -28,4 +28,4 @@ class TestPDUDevice(device_base.DeviceTestCase): ...@@ -28,4 +28,4 @@ class TestPDUDevice(device_base.DeviceTestCase):
def setUp(self): def setUp(self):
# DeviceTestCase setUp patches lofar_device DeviceProxy # DeviceTestCase setUp patches lofar_device DeviceProxy
super(TestPDUDevice, self).setUp() super(TestPSOCDevice, self).setUp()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment