Central Node¶
Central Node is a coordinator of the complete M&C system. Central Node implements the standard set of state and mode attributes defined by the SKA Control Model.
-
class
tmcprototype.centralnodelow.src.centralnodelow.central_node_low.
CentralNode
(*args, **kwargs)¶ Central Node is a coordinator of the complete M&C system.
-
AssignResources
(argin)¶ AssignResources command invokes the AssignResources command on lower level devices.
-
CentralAlarmHandler
¶ Used by autodoc_mock_imports.
-
class
InitCommand
(*args, **kwargs)¶ A class for the TMC CentralNode’s init_device() method.
-
do
()¶ Initializes the attributes and properties of the Central Node Low.
Returns: A tuple containing a return code and a string message indicating status. The message is for information purpose only. Return type: (ReturnCode, str) Raises: DevFailed if error occurs while initializing the CentralNode device or if error occurs while creating device proxy for any of the devices like SubarrayNodeLow or MccsMasterLeafNode.
-
-
MCCSMasterLeafNodeFQDN
¶ Used by autodoc_mock_imports.
-
ReleaseResources
(argin)¶ Release all the resources assigned to the given Subarray.
-
StandByTelescope
()¶ This command invokes Off() command on SubarrayNode, MCCSMasterLeafNode and sets CentralNode into OFF state.
-
StartUpTelescope
()¶ This command invokes On() command on SubarrayNode, MCCSMasterLeafNode and sets the Central Node into ON state.
-
TMAlarmHandler
¶ Used by autodoc_mock_imports.
-
TMLowSubarrayNodes
¶ Used by autodoc_mock_imports.
-
activityMessage
¶ Used by autodoc_mock_imports.
-
always_executed_hook
()¶ Internal construct of TANGO.
-
delete_device
()¶ Internal construct of TANGO.
-
init_command_objects
()¶ Initialises the command handlers for commands supported by this device.
-
is_AssignResources_allowed
()¶ Checks whether this command is allowed to be run in current device state.
Returns: True if this command is allowed to be run in current device state Return type: boolean
-
is_ReleaseResources_allowed
()¶ Checks whether this command is allowed to be run in current device state.
Returns: True if this command is allowed to be run in current device state. Return type: boolean Raises: DevFailed if this command is not allowed to be run in current device state
-
is_StandByTelescope_allowed
()¶ Checks whether this command is allowed to be run in current device state.
Returns: True if this command is allowed to be run in current device state. Return type: boolean
-
is_StartUpTelescope_allowed
()¶ Checks whether this command is allowed to be run in current device state.
Returns: True if this command is allowed to be run in current device state. Return type: boolean
-
read_activityMessage
()¶ Internal construct of TANGO. Returns activity message.
-
read_subarray1HealthState
()¶ Internal construct of TANGO. Returns Subarray1 health state.
-
read_telescopeHealthState
()¶ Internal construct of TANGO. Returns the Telescope health state.
-
subarray1HealthState
¶ Used by autodoc_mock_imports.
-
telescopeHealthState
¶ Used by autodoc_mock_imports.
-
write_activityMessage
(value)¶ Internal construct of TANGO. Sets the activity message.
-
-
tmcprototype.centralnodelow.src.centralnodelow.central_node_low.
main
(args=None, **kwargs)¶ Runs the CentralNode. :param args: Arguments internal to TANGO
Parameters: kwargs – Arguments internal to TANGO Returns: CentralNode TANGO object.
-
class
tmcprototype.centralnodelow.src.centralnodelow.central_node_low.
AssignResources
(*args, **kwargs)¶ A class for CentralNode’s AssignResources() command.
-
assign_resources_leaf_node
(tango_client, input_arg)¶ Invokes assign Resources command on leaf node with input argument.
Parameters: - tango_client – client of corresponding leaf node
- input_arg – Json string input to invoke command.
Raises: DevFailed if error occurs while invoking command on any of the devices like SubarrayNode, MCCSMasterLeafNode
-
assign_resources_mccs
(json_argument, device_data)¶ Create proxy of mccs master leaf node and call method assign_resources_leaf_node.
Parameters: json_argument – The string in JSON format. device_data : Object of class device_data. return: None
-
assign_resources_subarray
(json_argument, device_data)¶ Delete subarray id from json argument and create proxy of subarray corresponding to subarray id and call assign_resources_leaf_node method.
Parameters: json_argument – The string in JSON format. device_data : Object of class device_data Returns: None
-
check_allowed
()¶ Checks whether this command is allowed to be run in current device state
Returns: True if this command is allowed to be run in current device state Return type: boolean Raises: DevFailed if this command is not allowed to be run in current device state
-
do
(argin)¶ Assigns resources to given subarray. It accepts the subarray id, station ids, station beam id and channels in JSON string format.
Parameters: argin – The string in JSON format. The JSON contains following values:
- subarray_id:
- DevShort. Mandatory. Sub-Array to allocate resources to
- station_ids:
- DevArray. Mandatory list of stations contributing beams to the data set
- channels:
- DevArray. Mandatory list of frequency channels used
- station_beam_ids:
- DevArray. Mandatory logical ID of beam
- Example:
- {
- “subarray_id”: 1, “station_ids”: [1,2], “channels”: [1,2,3,4,5,6,7,8], “station_beam_ids”: [1]
}
Note: Enter input without spaces as:{“subarray_id”:1,”station_ids”:[1,2],”channels”:[1,2,3,4,5,6,7,8],”station_beam_ids”:[1]}
Returns: None Raises: KeyError if input argument json string contains invalid key ValueError if input argument json string contains invalid value
-
-
class
tmcprototype.centralnodelow.src.centralnodelow.central_node_low.
ReleaseResources
(*args, **kwargs)¶ A class for CentralNodeLow’s ReleaseResources() command.
-
check_allowed
()¶ Checks whether this command is allowed to be run in current device state
Returns: True if this command is allowed to be run in current device state Return type: boolean Raises: DevFailed if this command is not allowed to be run in current device state
-
do
(argin)¶ Release all the resources assigned to the given Subarray. It accepts the subarray id, release_all flag in JSON string format. When the release_all flag is True, ReleaseAllResources command is invoked on the respective SubarrayNode.
Parameters: argin – The string in JSON format. The JSON contains following values:
- subarray_id:
- DevShort. Mandatory.
- release_all:
- Boolean(True or False). Mandatory. True when all the resources to be released from Subarray.
- Example:
- {
- “subarray_id”: 1, “release_all”: true,
}
- Note: From Jive, enter input as:
- {“subarray_id”:1,”release_all”:true} without any space.
Raises: ValueError if input argument json string contains invalid value KeyError if input argument json string contains invalid key DevFailed if the command execution or command invocation on SubarrayNode is not successful
-
-
class
tmcprototype.centralnodelow.src.centralnodelow.central_node_low.
StandByTelescope
(*args, **kwargs)¶ A class for Low CentralNode’s StandByTelescope() command.
-
check_allowed
()¶ Checks whether this command is allowed to be run in current device state
Returns: True if this command is allowed to be run in current device state Return type: boolean Raises: DevFailed if this command is not allowed to be run in current device state
-
do
()¶ Sets the CentralNodeLow into OFF state. Invokes the respective command on lower level nodes and devices.
param argin: None.
Returns: A tuple containing a return code and a string message indicating status. The message is for information purpose only.
Return type: (ResultCode, str)
-
standby_leaf_node
(tango_client)¶ Invoke command Off leaf nodes.
Parameters: tango_client – proxy of corresponding leaf node Returns: None Raises: Devfailed exception if error occures while executing command on leaf nodes.
-
standby_mccs_mln
(mccs_master_fqdn)¶ Create TangoClient for MccsMasterLeafNode node and call standby method.
Returns: None
-
standby_subarray
(subarray_fqdn_list)¶ Create TangoClient for Subarray node and call standby method.
Returns: None
-
-
class
tmcprototype.centralnodelow.src.centralnodelow.central_node_low.
StartUpTelescope
(*args, **kwargs)¶ A class for Low CentralNode’s StartupCommand() command.
-
check_allowed
()¶ Checks whether this command is allowed to be run in current device state
Returns: True if this command is allowed to be run in current device state Return type: boolean Raises: DevFailed if this command is not allowed to be run in current device state
-
do
()¶ Setting the startup state to TRUE enables the telescope to accept subarray commands as per the subarray model. Set the CentralNode into ON state.
Parameters: argin – None. Returns: A tuple containing a return code and a string message indicating status. The message is for information purpose only.
Return type: (ResultCode, str)
-
startup_leaf_node
(tango_client)¶ Invoke On command on leaf nodes.
Parameters: tango_client – Proxy of corresponding node. Returns: None Raises: Devfailed exception if error occures while executing On command on leaf node.
-
startup_mccs_mln
(mccs_master_fqdn)¶ Create TangoClient for MccsMasterLeafNode node and call startup method.
Returns: None
-
startup_subarray
(subarray_fqdn_list)¶ Create TangoClient for Subarray node and call startup method.
Returns: None
-
AssignResources class for CentralNodeLow.
-
class
tmcprototype.centralnodelow.src.centralnodelow.assign_resources_command.
AssignResources
(*args, **kwargs)¶ A class for CentralNode’s AssignResources() command.
-
assign_resources_leaf_node
(tango_client, input_arg)¶ Invokes assign Resources command on leaf node with input argument.
Parameters: - tango_client – client of corresponding leaf node
- input_arg – Json string input to invoke command.
Raises: DevFailed if error occurs while invoking command on any of the devices like SubarrayNode, MCCSMasterLeafNode
-
assign_resources_mccs
(json_argument, device_data)¶ Create proxy of mccs master leaf node and call method assign_resources_leaf_node.
Parameters: json_argument – The string in JSON format. device_data : Object of class device_data. return: None
-
assign_resources_subarray
(json_argument, device_data)¶ Delete subarray id from json argument and create proxy of subarray corresponding to subarray id and call assign_resources_leaf_node method.
Parameters: json_argument – The string in JSON format. device_data : Object of class device_data Returns: None
-
check_allowed
()¶ Checks whether this command is allowed to be run in current device state
Returns: True if this command is allowed to be run in current device state Return type: boolean Raises: DevFailed if this command is not allowed to be run in current device state
-
do
(argin)¶ Assigns resources to given subarray. It accepts the subarray id, station ids, station beam id and channels in JSON string format.
Parameters: argin – The string in JSON format. The JSON contains following values:
- subarray_id:
- DevShort. Mandatory. Sub-Array to allocate resources to
- station_ids:
- DevArray. Mandatory list of stations contributing beams to the data set
- channels:
- DevArray. Mandatory list of frequency channels used
- station_beam_ids:
- DevArray. Mandatory logical ID of beam
- Example:
- {
- “subarray_id”: 1, “station_ids”: [1,2], “channels”: [1,2,3,4,5,6,7,8], “station_beam_ids”: [1]
}
Note: Enter input without spaces as:{“subarray_id”:1,”station_ids”:[1,2],”channels”:[1,2,3,4,5,6,7,8],”station_beam_ids”:[1]}
Returns: None Raises: KeyError if input argument json string contains invalid key ValueError if input argument json string contains invalid value
-
StartUpTelescope class for CentralNodelow.
-
class
tmcprototype.centralnodelow.src.centralnodelow.health_state_aggreegator.
HealthStateAggreegator
(logger=None)¶ Aggrergator class for health state event supscription and health state callback.
-
health_state_cb
(evt)¶ Receives the subscribed Subarray health state and MCCS Master Leaf Node health state, aggregates them to calculate the telescope health state.
Parameters: evt – A event on Subarray healthState and MCCSMasterLeafNode healthstate.
Type: Event object It has the following members:
- date (event timestamp)
- reception_date (event reception timestamp)
- type (event type)
- dev_name (device name)
- name (attribute name)
- value (event value)
Returns: None
Raises: KeyError if error occurs while setting telescope healthState
-
mccs_health_subscribe_event
()¶ Method to subscribe to health state change event on MccsMasterLeafNode.
Raises: Devfailed exception if erroe occures while subscribing event.
-
subarray_health_subscribe_event
()¶ Method to subscribe to health state change event on SubarrayNode.
Raises: Devfailed exception if erroe occures while subscribing event.
-
subscribe_event
()¶ Method for event subscription. Calls separate subscribe event methods for CSP Master, SDP Master and Subarray health state attribute subscription.
-
unsubscribe_event
()¶ Method to unsubscribe to health state change event on MccsMasterLeafNode and SubarrayNode
-
ReleaseResources class for CentralNodeLow.
-
class
tmcprototype.centralnodelow.src.centralnodelow.release_resources_command.
ReleaseResources
(*args, **kwargs)¶ A class for CentralNodeLow’s ReleaseResources() command.
-
check_allowed
()¶ Checks whether this command is allowed to be run in current device state
Returns: True if this command is allowed to be run in current device state Return type: boolean Raises: DevFailed if this command is not allowed to be run in current device state
-
do
(argin)¶ Release all the resources assigned to the given Subarray. It accepts the subarray id, release_all flag in JSON string format. When the release_all flag is True, ReleaseAllResources command is invoked on the respective SubarrayNode.
Parameters: argin – The string in JSON format. The JSON contains following values:
- subarray_id:
- DevShort. Mandatory.
- release_all:
- Boolean(True or False). Mandatory. True when all the resources to be released from Subarray.
- Example:
- {
- “subarray_id”: 1, “release_all”: true,
}
- Note: From Jive, enter input as:
- {“subarray_id”:1,”release_all”:true} without any space.
Raises: ValueError if input argument json string contains invalid value KeyError if input argument json string contains invalid key DevFailed if the command execution or command invocation on SubarrayNode is not successful
-
StandByTelescope class for CentralNodelow.
-
class
tmcprototype.centralnodelow.src.centralnodelow.standby_telescope_command.
StandByTelescope
(*args, **kwargs)¶ A class for Low CentralNode’s StandByTelescope() command.
-
check_allowed
()¶ Checks whether this command is allowed to be run in current device state
Returns: True if this command is allowed to be run in current device state Return type: boolean Raises: DevFailed if this command is not allowed to be run in current device state
-
do
()¶ Sets the CentralNodeLow into OFF state. Invokes the respective command on lower level nodes and devices.
param argin: None.
Returns: A tuple containing a return code and a string message indicating status. The message is for information purpose only.
Return type: (ResultCode, str)
-
standby_leaf_node
(tango_client)¶ Invoke command Off leaf nodes.
Parameters: tango_client – proxy of corresponding leaf node Returns: None Raises: Devfailed exception if error occures while executing command on leaf nodes.
-
standby_mccs_mln
(mccs_master_fqdn)¶ Create TangoClient for MccsMasterLeafNode node and call standby method.
Returns: None
-
standby_subarray
(subarray_fqdn_list)¶ Create TangoClient for Subarray node and call standby method.
Returns: None
-
StartUpTelescope class for CentralNodelow.
-
class
tmcprototype.centralnodelow.src.centralnodelow.startup_telescope_command.
StartUpTelescope
(*args, **kwargs)¶ A class for Low CentralNode’s StartupCommand() command.
-
check_allowed
()¶ Checks whether this command is allowed to be run in current device state
Returns: True if this command is allowed to be run in current device state Return type: boolean Raises: DevFailed if this command is not allowed to be run in current device state
-
do
()¶ Setting the startup state to TRUE enables the telescope to accept subarray commands as per the subarray model. Set the CentralNode into ON state.
Parameters: argin – None. Returns: A tuple containing a return code and a string message indicating status. The message is for information purpose only.
Return type: (ResultCode, str)
-
startup_leaf_node
(tango_client)¶ Invoke On command on leaf nodes.
Parameters: tango_client – Proxy of corresponding node. Returns: None Raises: Devfailed exception if error occures while executing On command on leaf node.
-
startup_mccs_mln
(mccs_master_fqdn)¶ Create TangoClient for MccsMasterLeafNode node and call startup method.
Returns: None
-
startup_subarray
(subarray_fqdn_list)¶ Create TangoClient for Subarray node and call startup method.
Returns: None
-