From 949d8962ab288352b90b082910099836c3181212 Mon Sep 17 00:00:00 2001
From: stedif <stefano.difrischia@inaf.it>
Date: Thu, 20 Oct 2022 17:08:08 +0200
Subject: [PATCH] L2SS-1030: create skeleton for configuration device

---
 .../devices/configuration_device.py           | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 tangostationcontrol/tangostationcontrol/devices/configuration_device.py

diff --git a/tangostationcontrol/tangostationcontrol/devices/configuration_device.py b/tangostationcontrol/tangostationcontrol/devices/configuration_device.py
new file mode 100644
index 000000000..9394c0705
--- /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)
-- 
GitLab