Class OfflineTaskGroup

java.lang.Object
offlineProcessing.OfflineTaskGroup
All Implemented Interfaces:
PamSettings, SettingsNameProvider

public class OfflineTaskGroup extends Object implements PamSettings
Author:
Doug Gillespie Handles a series of offline tasks which all use a common data block so that data can be loaded, a whole series of tasks completed and the data then saved in a single operation.

This will be the primary interface to OfflineTasks - even if there is only one task it will be in a group of one !

  • Constructor Details Link icon

    • OfflineTaskGroup Link icon

      public OfflineTaskGroup(PamControlledUnit pamControlledUnit, String settingsName)
      PamControlledunit required in constructor since some bookkeeping will be going on in the background which will need the unit type and name.
      Parameters:
      pamControlledUnit - host controlled unit.
      settingsName - Name to be used in PamSettings for storing some basic information (which tasks are selected)
  • Method Details Link icon

    • setSummaryLists Link icon

      public void setSummaryLists()
      Setup summary lists of required and affected datablocks based on which tasks are actually going to run .
    • runTasks Link icon

      public boolean runTasks()
      Run all the tasks.
      Parameters:
      offlineClassifierParams -
      Returns:
    • killTasks Link icon

      public void killTasks()
    • addTasks Link icon

      public int addTasks(List<OfflineTask> tasks)
      Add a list of offline tasks. Checks that tasks are not already included in the task list and doesn't add them if they already exist.
      Parameters:
      tasks - list of tasks.
      Returns:
      number added.
    • haveTask Link icon

      public boolean haveTask(OfflineTask task)
      See if a task already exists.
      Parameters:
      task - offline tasks.
      Returns:
      true if it exists
    • haveTaskClass Link icon

      public boolean haveTaskClass(OfflineTask task)
      See if we already have a task of the same class.
      Parameters:
      task - task to check
      Returns:
      true if a task of the same class already exists.
    • addTask Link icon

      public boolean addTask(OfflineTask task)
      Parameters:
      task - task to add to the group
    • getNTasks Link icon

      public int getNTasks()
      Returns:
      the number of tasks in the group
    • getTask Link icon

      public OfflineTask getTask(int iTask)
      Parameters:
      iTask - the task number
      Returns:
      the task.
    • getProcessTime Link icon

      public int getProcessTime()
      Returns:
      the processTime
    • getPrimaryDataBlock Link icon

      public PamDataBlock getPrimaryDataBlock()
      Returns:
      the primaryDataBlock
    • setPrimaryDataBlock Link icon

      public void setPrimaryDataBlock(PamDataBlock primaryDataBlock)
      Parameters:
      primaryDataBlock - the primaryDataBlock to set
    • getTaskMonitor Link icon

      public TaskMonitor getTaskMonitor()
      Returns:
      the taskMonitor
    • setTaskMonitor Link icon

      public void setTaskMonitor(TaskMonitor taskMonitor)
      Parameters:
      taskMonitor - the taskMonitor to set
    • tasksDone Link icon

      public void tasksDone()
      some bookkeeping - write information about task completion to the database.
    • getSettingsReference Link icon

      public Serializable getSettingsReference()
      Specified by:
      getSettingsReference in interface PamSettings
      Returns:
      The serialisable object that will be stored
    • getSettingsVersion Link icon

      public long getSettingsVersion()
      Specified by:
      getSettingsVersion in interface PamSettings
      Returns:
      An integer version number for the settings
    • getUnitName Link icon

      public String getUnitName()
      Specified by:
      getUnitName in interface SettingsNameProvider
      Returns:
      A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
    • getUnitType Link icon

      public String getUnitType()
      Specified by:
      getUnitType in interface PamSettings
      Returns:
      A Name specific to the type, e.g. Click detector
    • restoreSettings Link icon

      public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
      Specified by:
      restoreSettings in interface PamSettings
      Returns:
      true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
    • getTaskGroupParams Link icon

      public TaskGroupParams getTaskGroupParams()
      Returns:
      the taskGroupParams
    • getDataTimeLimits Link icon

      public DataTimeLimits getDataTimeLimits()
      Returns:
      the dataTimeLimits
    • setDataTimeLimits Link icon

      public void setDataTimeLimits(DataTimeLimits dataTimeLimits)
      Parameters:
      dataTimeLimits - the dataTimeLimits to set
    • isTaskCancelled Link icon

      public boolean isTaskCancelled()
      Check whether the task has been cancelled. Sometime used if processing a data unit takes a long time and should be cancelled
      Returns:
      true if task has been cancelled.
    • setSuperDetectionFilter Link icon

      public void setSuperDetectionFilter(OfflineSuperDetFilter superDetectionFilter)
      Set a super detection filter (null if no super detection system available)
      Parameters:
      superDetectionFilter - Super detection filter.
    • getSuperDetectionFilter Link icon

      public OfflineSuperDetFilter getSuperDetectionFilter()
      Returns:
      the superDetectionFilter
    • clearTasks Link icon

      public void clearTasks()
      Clear all task from the task group. This also clears affected and required datablocks.