Skip to content
Snippets Groups Projects
Commit 15fadfe4 authored by Aditya Dange's avatar Aditya Dange
Browse files

Removed unwanted methods (GetMetrics and ToJson) from SKAMaster class

parent f51ec801
No related branches found
No related tags found
No related merge requests found
...@@ -66,24 +66,6 @@ ...@@ -66,24 +66,6 @@
</argout> </argout>
<status abstract="true" inherited="true" concrete="true"/> <status abstract="true" inherited="true" concrete="true"/>
</commands> </commands>
<commands name="GetMetrics" description="Gets list of attributes marked as metrics, with their values, &#xA;for device" execMethod="get_metrics" displayLevel="OPERATOR" polledPeriod="0">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:StringType"/>
</argout>
<status abstract="false" inherited="true" concrete="true"/>
</commands>
<commands name="ToJson" description="Returns a JSON translation of this device.&#xA;Defaults for empty string argin gives commands and metris:&#xA;with_value:false, &#xA;with_commands:true, &#xA;with_metrics:true, &#xA;with_attributes:false" execMethod="to_json" displayLevel="OPERATOR" polledPeriod="0">
<argin description="Requests the JSON string representing this device, can be filtered &#xA;by with_commands, with_metrics, with_attributes and &#xA;with_value. Defaults for empty string argin are:&#xA;{`with_value`:`false`, `with_commands`:`true`,&#xA; `with_metrics`:`true, `with_attributes`:`false}">
<type xsi:type="pogoDsl:StringType"/>
</argin>
<argout description="The JSON string representing this device, &#xA;filtered as per the input argument flags">
<type xsi:type="pogoDsl:StringType"/>
</argout>
<status abstract="false" inherited="true" concrete="true"/>
</commands>
<commands name="GetVersionInfo" description="Array of version strings of all entities modelled by this device. &#xA;(One level down only)&#xA;Each string in the array lists the version info for one entity&#xA;managed by this device. &#xA;The first entry is version info for this TANGO Device itself.&#xA;The entities may be TANGO devices, or hardware LRUs or &#xA;anything else this devices manages/models.&#xA;The intention with this command is that it can provide more &#xA;detailed information than can be captured in the versionId &#xA;and buildState attributes, if necessary.&#xA;In the minimal case the GetVersionInfo will contain only the &#xA;versionId and buildState attributes of the next lower level&#xA;entities." execMethod="get_version_info" displayLevel="OPERATOR" polledPeriod="0"> <commands name="GetVersionInfo" description="Array of version strings of all entities modelled by this device. &#xA;(One level down only)&#xA;Each string in the array lists the version info for one entity&#xA;managed by this device. &#xA;The first entry is version info for this TANGO Device itself.&#xA;The entities may be TANGO devices, or hardware LRUs or &#xA;anything else this devices manages/models.&#xA;The intention with this command is that it can provide more &#xA;detailed information than can be captured in the versionId &#xA;and buildState attributes, if necessary.&#xA;In the minimal case the GetVersionInfo will contain only the &#xA;versionId and buildState attributes of the next lower level&#xA;entities." execMethod="get_version_info" displayLevel="OPERATOR" polledPeriod="0">
<argin description=""> <argin description="">
<type xsi:type="pogoDsl:VoidType"/> <type xsi:type="pogoDsl:VoidType"/>
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
# #
# #
# #
# Distributed under the terms of the none license.
# See LICENSE.txt for more info.
""" SKAMaster """ SKAMaster
...@@ -118,7 +120,7 @@ class SKAMaster(SKABaseDevice): ...@@ -118,7 +120,7 @@ class SKAMaster(SKABaseDevice):
self._element_tel_state_device = "" self._element_tel_state_device = ""
self._element_database_device = "" self._element_database_device = ""
self._max_capabilities = {"cap1":10, "cap2":20} self._max_capabilities = {}
if self.MaxCapabilities: if self.MaxCapabilities:
for max_capability in self.MaxCapabilities: for max_capability in self.MaxCapabilities:
capability_type, max_capability_instances = max_capability.split(":") capability_type, max_capability_instances = max_capability.split(":")
...@@ -167,7 +169,6 @@ class SKAMaster(SKABaseDevice): ...@@ -167,7 +169,6 @@ class SKAMaster(SKABaseDevice):
def read_availableCapabilities(self): def read_availableCapabilities(self):
# PROTECTED REGION ID(SKAMaster.availableCapabilities_read) ENABLED START # # PROTECTED REGION ID(SKAMaster.availableCapabilities_read) ENABLED START #
print (self._available_capabilities)
return convert_dict_to_list(self._available_capabilities) return convert_dict_to_list(self._available_capabilities)
# PROTECTED REGION END # // SKAMaster.availableCapabilities_read # PROTECTED REGION END # // SKAMaster.availableCapabilities_read
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
# #
# #
# #
# Distributed under the terms of the none license.
# See LICENSE.txt for more info.
######################################################################################### #########################################################################################
"""Contain the tests for the SKAMaster.""" """Contain the tests for the SKAMaster."""
...@@ -41,7 +43,7 @@ class TestSKAMaster(object): ...@@ -41,7 +43,7 @@ class TestSKAMaster(object):
'GroupDefinitions': '', 'GroupDefinitions': '',
'NrSubarrays': '16', 'NrSubarrays': '16',
'CapabilityTypes': '', 'CapabilityTypes': '',
'MaxCapabilities': {"CORRELATOR":512, "PSS-BEAMS":4} 'MaxCapabilities': '',
} }
@classmethod @classmethod
...@@ -74,22 +76,6 @@ class TestSKAMaster(object): ...@@ -74,22 +76,6 @@ class TestSKAMaster(object):
assert tango_context.device.Status() == "The device is in UNKNOWN state." assert tango_context.device.Status() == "The device is in UNKNOWN state."
# PROTECTED REGION END # // SKAMaster.test_Status # PROTECTED REGION END # // SKAMaster.test_Status
# PROTECTED REGION ID(SKAMaster.test_GetMetrics_decorators) ENABLED START #
# PROTECTED REGION END # // SKAMaster.test_GetMetrics_decorators
# def test_GetMetrics(self, tango_context):
# """Test for GetMetrics"""
# # PROTECTED REGION ID(SKAMaster.test_GetMetrics) ENABLED START #
# #assert tango_context.device.GetMetrics() == ""
# # PROTECTED REGION END # // SKAMaster.test_GetMetrics
# PROTECTED REGION ID(SKAMaster.test_ToJson_decorators) ENABLED START #
# PROTECTED REGION END # // SKAMaster.test_ToJson_decorators
# def test_ToJson(self, tango_context):
# """Test for ToJson"""
# # PROTECTED REGION ID(SKAMaster.test_ToJson) ENABLED START #
# assert tango_context.device.ToJson("") == ""
# # PROTECTED REGION END # // SKAMaster.test_ToJson
# PROTECTED REGION ID(SKAMaster.test_GetVersionInfo_decorators) ENABLED START # # PROTECTED REGION ID(SKAMaster.test_GetVersionInfo_decorators) ENABLED START #
# PROTECTED REGION END # // SKAMaster.test_GetVersionInfo_decorators # PROTECTED REGION END # // SKAMaster.test_GetVersionInfo_decorators
def test_GetVersionInfo(self, tango_context): def test_GetVersionInfo(self, tango_context):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment