From 2511c892f9f699da42e80d00a6eb9b8b315b41b9 Mon Sep 17 00:00:00 2001 From: stedif <stefano.difrischia@inaf.it> Date: Tue, 8 Nov 2022 16:48:16 +0100 Subject: [PATCH] L2SS-1030: replace tangodb_properties entries with station_configuration --- .../tangostationcontrol/devices/configuration_device.py | 8 ++++---- .../default/devices/test_device_configuration.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tangostationcontrol/tangostationcontrol/devices/configuration_device.py b/tangostationcontrol/tangostationcontrol/devices/configuration_device.py index 265f72c4b..ad6e63c32 100644 --- a/tangostationcontrol/tangostationcontrol/devices/configuration_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/configuration_device.py @@ -37,19 +37,19 @@ class Configuration(lofar_device): # ---------- # Attributes # ---------- - tangodb_properties_RW = attribute(dtype=str, access=AttrWriteType.READ_WRITE, doc='The whole station configuration, as a JSON string.') + station_configuration_RW = attribute(dtype=str, access=AttrWriteType.READ_WRITE, doc='The Tango properties of all the devices in this station, as a JSON string.') - def read_tangodb_properties_RW(self): + def read_station_configuration_RW(self): return self._dump_configdb() - def write_tangodb_properties_RW(self, tangodb_properties): + def write_station_configuration_RW(self, station_configuration): """ Takes a JSON string which represents the station configuration and loads the whole configuration from scratch. N.B. it does not update, it loads a full new configuration. """ # TODO(Stefano): L2SS-1031 implement load configuration - self.proxy.tangodb_properties_RW = tangodb_properties + self.proxy.station_configuration_RW = station_configuration def _dump_configdb(self): """ Returns the TangoDB station configuration as a JSON string """ diff --git a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_configuration.py b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_configuration.py index 52f469b8a..280439df8 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_configuration.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_configuration.py @@ -18,12 +18,12 @@ class TestDeviceConfiguration(AbstractTestBases.TestDeviceBase): def setUp(self): super().setUp("STAT/Configuration/1") - def test_read_tangodb_properties(self): + def test_read_station_configuration(self): self.proxy.warm_boot() self.assertEqual(DevState.ON, self.proxy.state()) """ Test whether the station control configuration is correctly retrieved as a JSON string """ - tangodb_properties = self.proxy.tangodb_properties_RW - dbdata = json.loads(tangodb_properties) + station_configuration = self.proxy.station_configuration_RW + dbdata = json.loads(station_configuration) self.assertTrue(type(dbdata), dict) self.assertGreater(len(dbdata['servers']), 0) # Verify if Configuration Device exists -- GitLab