diff --git a/tangostationcontrol/tangostationcontrol/devices/configuration_device.py b/tangostationcontrol/tangostationcontrol/devices/configuration_device.py new file mode 100644 index 0000000000000000000000000000000000000000..9394c070572f472457daac59b8beb10c50bf273f --- /dev/null +++ b/tangostationcontrol/tangostationcontrol/devices/configuration_device.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# +# This file is part of the RECV project +# +# +# +# Distributed under the terms of the APACHE license. +# See LICENSE.txt for more info. + +""" Configuration Device Server for LOFAR2.0 + +Handles and exposes the station configuration + +""" +# PyTango imports +from tango import AttrWriteType +from tango.server import attribute + +# Additional import +from tangostationcontrol.common.entrypoint import entry +from tangostationcontrol.devices.lofar_device import lofar_device +from tangostationcontrol.common.lofar_logging import device_logging_to_python + +import logging +logger = logging.getLogger() + +__all__ = ["Configuration", "main"] + +@device_logging_to_python() +class Configuration(lofar_device): + # ----------------- + # Device Properties + # ----------------- + + # ---------- + # Attributes + # ---------- + tangodb_properties_RW = attribute(dtype=str, access=AttrWriteType.READ_WRITE, doc='The whole station configuration, as a JSON string.') + + def read_tangodb_properties_RW(self): + return self._dump_configdb() + + def _dump_configdb(self): + """ Returns the TangoDB station configuration as a JSON string """ + return 'Configuration' + +# ---------- +# Run server +# ---------- +def main(**kwargs): + """Main function of the Boot module.""" + return entry(Configuration, **kwargs)