Skip to content
Snippets Groups Projects
Unverified Commit f1c99e7c authored by SKAJohanVenter's avatar SKAJohanVenter
Browse files

SAR-276 Hiding queue_manager properties behind the component_manager

parent b2bc42f7
Branches
No related tags found
No related merge requests found
......@@ -1120,7 +1120,7 @@ class SKABaseDevice(Device):
:return: tasks in the device queue
"""
return self.component_manager.queue_manager.tasks_in_queue
return self.component_manager.tasks_in_queue
def read_longRunningCommandIDsInQueue(self):
# PROTECTED REGION ID(SKABaseDevice.longRunningCommandIDsInQueue_read) ENABLED START #
......@@ -1138,7 +1138,7 @@ class SKABaseDevice(Device):
:return: ID, status pairs of the currently executing commands
"""
return self.component_manager.queue_manager.task_status
return self.component_manager.task_status
def read_longRunningCommandProgress(self):
# PROTECTED REGION ID(SKABaseDevice.longRunningCommandProgress_read) ENABLED START #
......@@ -1147,7 +1147,7 @@ class SKABaseDevice(Device):
:return: ID, progress of the currently executing command.
"""
return self.component_manager.queue_manager.task_progress
return self.component_manager.task_progress
def read_longRunningCommandResult(self):
# PROTECTED REGION ID(SKABaseDevice.longRunningCommandResult_read) ENABLED START #
......@@ -1156,9 +1156,9 @@ class SKABaseDevice(Device):
:return: ID, ResultCode, result.
"""
if not self.component_manager.queue_manager.task_result:
if not self.component_manager.task_result:
return []
return list(self.component_manager.queue_manager.task_result)
return list(self.component_manager.task_result)
# --------
# Commands
......
......@@ -126,6 +126,53 @@ class BaseComponentManager:
"""
raise NotImplementedError("BaseComponentManager is abstract.")
@property
def tasks_in_queue(self):
"""
Read the long running commands in the queue.
:return: tasks in the device queue
"""
return self.queue_manager.tasks_in_queue
@property
def task_ids_in_queue(self):
"""
Read the IDs of the long running commands in the queue.
:return: unique ids for the enqueued commands
"""
return self.queue_manager.task_ids_in_queue
@property
def task_status(self):
"""
Read the status of the currently executing long running commands.
:return: ID, status pairs of the currently executing commands
"""
return self.queue_manager.task_status
@property
def task_progress(self):
"""
Read the progress of the currently executing long running command.
:return: ID, progress of the currently executing command.
"""
return self.queue_manager.task_progress
@property
def task_result(self):
"""
Read the result of the completed long running command.
:return: ID, ResultCode, result.
"""
if not self.queue_manager.task_result:
return []
return list(self.queue_manager.task_result)
def off(self):
"""Turn the component off."""
raise NotImplementedError("BaseComponentManager is abstract.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment