diff --git a/devices/APSCTL.py b/devices/APSCTL.py index f1ea50f303e608230aaeba346dbd99bde8480773..24da18c8b4781c6f5ac34830b9a550fa69d44aa7 100644 --- a/devices/APSCTL.py +++ b/devices/APSCTL.py @@ -13,7 +13,7 @@ # PyTango imports from tango.server import run -from tango.server import device_property +from tango.server import device_property, attribute from tango import AttrWriteType # Additional import @@ -22,6 +22,7 @@ from util.attribute_wrapper import attribute_wrapper from util.hardware_device import hardware_device from util.lofar_logging import device_logging_to_python, log_exceptions +from util.lofar_git import get_version import numpy @@ -64,6 +65,9 @@ class APSCTL(hardware_device): # ---------- # Attributes # ---------- + + version = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version()) + N_unb = 2 N_fpga = 4 N_ddr = 2 diff --git a/devices/PCC.py b/devices/PCC.py index ff0ed0914f43272ab195b8a55f8f550e7fdd3ceb..847d54d495f9a9bcff5adc1934332db7315e34eb 100644 --- a/devices/PCC.py +++ b/devices/PCC.py @@ -14,7 +14,7 @@ # PyTango imports from tango import DebugIt from tango.server import run, command -from tango.server import device_property +from tango.server import device_property, attribute from tango import AttrWriteType import numpy # Additional import @@ -25,6 +25,7 @@ from clients.opcua_connection import OPCUAConnection from util.attribute_wrapper import attribute_wrapper from util.hardware_device import hardware_device from util.lofar_logging import device_logging_to_python, log_exceptions +from util.lofar_git import get_version __all__ = ["PCC", "main"] @@ -69,6 +70,9 @@ class PCC(hardware_device): # ---------- # Attributes # ---------- + + version = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version()) + RCU_mask_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_mask_RW"], datatype=numpy.bool_, dims=(32,), access=AttrWriteType.READ_WRITE) Ant_mask_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:Ant_mask_RW"], datatype=numpy.bool_, dims=(3, 32), access=AttrWriteType.READ_WRITE) RCU_attenuator_R = attribute_wrapper(comms_annotation=["2:PCC", "2:RCU_attenuator_R"], datatype=numpy.int64, dims=(3, 32)) diff --git a/devices/SDP.py b/devices/SDP.py index f3fbdcabacea0cd76760be08f2190f1134c76da2..2d9ce7b1a432e52b6fd3fb06c3bd33d61ea814c4 100644 --- a/devices/SDP.py +++ b/devices/SDP.py @@ -13,7 +13,7 @@ # PyTango imports from tango.server import run -from tango.server import device_property +from tango.server import device_property, attribute from tango import AttrWriteType # Additional import @@ -22,6 +22,7 @@ from util.attribute_wrapper import attribute_wrapper from util.hardware_device import hardware_device from util.lofar_logging import device_logging_to_python, log_exceptions +from util.lofar_git import get_version import numpy @@ -64,6 +65,9 @@ class SDP(hardware_device): # ---------- # Attributes # ---------- + + version = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version()) + # SDP will switch from fpga_mask_RW to tr_fpga_mask_RW, offer both for now as its a critical flag tr_fpga_mask_RW = attribute_wrapper(comms_annotation=["2:tr_fpga_mask_RW"], datatype=numpy.bool_, dims=(16,), access=AttrWriteType.READ_WRITE) fpga_mask_RW = attribute_wrapper(comms_annotation=["2:fpga_mask_RW"], datatype=numpy.bool_, dims=(16,), access=AttrWriteType.READ_WRITE)