Qudi
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
taskrunner.TaskRunner Class Reference

This module keeps a collection of tasks that have varying preconditions, postconditions and conflicts and executes these tasks as their given conditions allow. More...

Inheritance diagram for taskrunner.TaskRunner:
Inheritance graph
[legend]
Collaboration diagram for taskrunner.TaskRunner:
Collaboration graph
[legend]

Public Member Functions

def on_activate (self)
 Initialise task runner.
 
def on_deactivate (self)
 Shut down task runner.
 
def loadTasks (self)
 Load all tasks specified in the configuration. More...
 
def registerTask (self, task)
 Add a task from an external source (i.e. More...
 
def checkTasksInModel (self)
 Check all loaded tasks for consistency and completeness of dependencies.
 
def modelChanged (self, parent, first, last)
 React to model changes (right now debug only)
 
def startTaskByIndex (self, index)
 Try starting a task identified by its list index. More...
 
def startTaskByName (self, taskname)
 Try starting a task identified by its configured name. More...
 
def startTask (self, task)
 Try starting a task identified by its task dictionary. More...
 
def pauseTaskByIndex (self, index)
 Try pausing a task identified by its list index. More...
 
def pauseTaskByName (self, taskname)
 Try pausing a task identified by its configured name. More...
 
def pauseTask (self, task)
 Actually Pause the Task. More...
 
def stopTaskByIndex (self, index)
 Try stopping a task identified by its list index. More...
 
def stopTaskByName (self, taskname)
 Try stopping a task identified by its configured name. More...
 
def stopTask (self, task)
 
def getTaskByName (self, taskname)
 Get task dictionary for a given task name. More...
 
def getTaskByReference (self, ref)
 Get task dictionary by the identity of its task object. More...
 
def getModule (self, taskname, modname)
 Get a reference to a module that is in a task's requied module list. More...
 
def resumePauseTasks (self, ref)
 Try resuming all tasks paused by the given task. More...
 
def postRunPPTasks (self, ref)
 Try executing post action for preposttasks associated with a given task. More...
 
def preRunPPTasks (self, ref)
 Try running pre action of preposttask associated with given task. More...
 
def pausePauseTasks (self, ref)
 Try pausing tasks required for starting a given task. More...
 

Public Attributes

 model
 

Static Public Attributes

 sigLoadTasks = QtCore.Signal()
 
 sigCheckTasks = QtCore.Signal()
 

Detailed Description

This module keeps a collection of tasks that have varying preconditions, postconditions and conflicts and executes these tasks as their given conditions allow.

Member Function Documentation

◆ getModule()

def taskrunner.TaskRunner.getModule (   self,
  taskname,
  modname 
)

Get a reference to a module that is in a task's requied module list.

Parameters
strtaskname: name of task
strmodname: name of module
Returns
object: module

◆ getTaskByName()

def taskrunner.TaskRunner.getTaskByName (   self,
  taskname 
)

Get task dictionary for a given task name.

Parameters
strname: name of the task
Returns
dict: task dictionary

◆ getTaskByReference()

def taskrunner.TaskRunner.getTaskByReference (   self,
  ref 
)

Get task dictionary by the identity of its task object.

Parameters
strref: task object
Returns
dict: task dictionary

◆ loadTasks()

def taskrunner.TaskRunner.loadTasks (   self)

Load all tasks specified in the configuration.

Check dependencies and load necessary modules.

◆ pausePauseTasks()

def taskrunner.TaskRunner.pausePauseTasks (   self,
  ref 
)

Try pausing tasks required for starting a given task.

Parameters
taskref: task object
Returns
bool: whether pausing tasks was successful

◆ pauseTask()

def taskrunner.TaskRunner.pauseTask (   self,
  task 
)

Actually Pause the Task.

Parameters
objtask: Reference to the task object

◆ pauseTaskByIndex()

def taskrunner.TaskRunner.pauseTaskByIndex (   self,
  index 
)

Try pausing a task identified by its list index.

Parameters
intindex: index of task in task list

◆ pauseTaskByName()

def taskrunner.TaskRunner.pauseTaskByName (   self,
  taskname 
)

Try pausing a task identified by its configured name.

Parameters
strname: name assigned to task

◆ postRunPPTasks()

def taskrunner.TaskRunner.postRunPPTasks (   self,
  ref 
)

Try executing post action for preposttasks associated with a given task.

Parameters
taskref: task object
Returns
bool: whether post actions were successful

◆ preRunPPTasks()

def taskrunner.TaskRunner.preRunPPTasks (   self,
  ref 
)

Try running pre action of preposttask associated with given task.

Parameters
taskref: task object
Returns
bool: whether pre tasks were successful

◆ registerTask()

def taskrunner.TaskRunner.registerTask (   self,
  task 
)

Add a task from an external source (i.e.

not loaded by task runner) to task runner.

   @param dict task: dictionary describing a task to register

   @return bool: whether registering tasks succeeded

task dict bool loading checks passed obj refernece to task object str unoque name of task str module name of task module [str] preposttasks: pre/post execution tasks for this task [str] pausetasks: this stuff needs to be paused before task can run dict task needs these modules dict extra configuration

◆ resumePauseTasks()

def taskrunner.TaskRunner.resumePauseTasks (   self,
  ref 
)

Try resuming all tasks paused by the given task.

Parameters
taskref: task object for which tasks should be resumed
Returns
bool: Whether resuming was sucessful

◆ startTask()

def taskrunner.TaskRunner.startTask (   self,
  task 
)

Try starting a task identified by its task dictionary.

Parameters
dicttask: dictionary that contains all information about task

◆ startTaskByIndex()

def taskrunner.TaskRunner.startTaskByIndex (   self,
  index 
)

Try starting a task identified by its list index.

Parameters
intindex: index of task in task list

◆ startTaskByName()

def taskrunner.TaskRunner.startTaskByName (   self,
  taskname 
)

Try starting a task identified by its configured name.

Parameters
strname: name assigned to task

◆ stopTaskByIndex()

def taskrunner.TaskRunner.stopTaskByIndex (   self,
  index 
)

Try stopping a task identified by its list index.

Parameters
intindex: index of task in task list

◆ stopTaskByName()

def taskrunner.TaskRunner.stopTaskByName (   self,
  taskname 
)

Try stopping a task identified by its configured name.

Parameters
strname: name assigned to task

The documentation for this class was generated from the following file: