Class OfflineTask<T extends PamDataUnit>

java.lang.Object
offlineProcessing.OfflineTask<T>
Direct Known Subclasses:
AlarmOfflineTask, AnnotationOfflineTask, BatchTMLocalisation, BLOfflineTask, CBOfflineTask, ClickBearingTask, ClickDelayTask, ClickReClassifyTask, ClickTrainClass, ClickTrainOfflineTask, ClickWaveTask, CTClassifierOfflineTask, DataCopyTask, DbHtSummaryTask, DLOfflineTask, EchoDetectionTask, ExportTask, Group3DOfflineTask, MTClassifierOfflineTask, OneBandSummaryTask, ReclassifyTask, UpdateCrossingTask

public abstract class OfflineTask<T extends PamDataUnit> extends Object
An offline task, such as click species id. Generally controlled and operated from within an OLProcessDialog
Author:
Doug Gillespie
See Also:
  • Constructor Details

    • OfflineTask

      public OfflineTask(PamDataBlock<T> parentDataBlock)
      Parameters:
      parentDataBlock -
  • Method Details

    • getTaskControlledUnit

      public PamControlledUnit getTaskControlledUnit()
      Get the PAMControlled unit associated with a task.
      Returns:
      PAMControlled unit associated with a task.
    • getDataBlock

      public PamDataBlock<T> getDataBlock()
      Get the parent data block for the task
      Returns:
      the datablock used by the task.
    • setParentDataBlock

      public void setParentDataBlock(PamDataBlock dataBlock)
      Parameters:
      dataBlock - the dataBlock to set
    • getLongName

      public String getLongName()
      Get a uniquely identifyng name for the task which consists of the pamControlledUnit type and name as well as the tasks shorter name from getName();
      Returns:
      a long name which should be unique within a configuration.
    • getName

      public abstract String getName()
      Returns:
      a name for the task, to be displayed in the dialog.
    • getUnitType

      public String getUnitType()
      Get a unit type for the task. This is the unit type of the parent PAMGuard module.
      Returns:
      module name
    • getUnitName

      public String getUnitName()
      Get a unit name for the task. This is the unit name of the parent PAMGuard module.
      Returns:
      module name
    • hasSettings

      public boolean hasSettings()
      task has settings which can be called
      Returns:
      true or false
    • callSettings

      public boolean callSettings()
      Call any task specific settings
      Returns:
      true if settings may have changed.
    • canRun

      public boolean canRun()
      can the task be run ? This will generally be true, but may be false if the task is dependent on some other module which may not be present.
      Returns:
      true if it's possible to run the task.
    • processDataUnit

      public abstract boolean processDataUnit(T dataUnit)
      Process a single data unit.
      Returns:
      true if the data unit has changed in some way so that it will need re-writing to it's binary file or database.
    • newDataLoad

      public abstract void newDataLoad(long startTime, long endTime, OfflineDataMapPoint mapPoint)
      Called when new data are loaded for offline processing (or once at the start of processing loaded data).
      Parameters:
      startTime - start time of loaded data
      endTime - end time of loaded data
    • loadedDataComplete

      public abstract void loadedDataComplete()
      Called when processing of loaded data, or each map point worth of data, is complete.
    • addRequiredDataBlock

      public void addRequiredDataBlock(RequiredDataBlockInfo dataBlockInfo)
      Add a required data block. These are data blocks apart from the main one which are required before this task can complete. Data for these block will be loaded automatically.
      Parameters:
      dataBlockInfo - required data block with pre and post load times.
    • addRequiredDataBlock

      public void addRequiredDataBlock(PamDataBlock pamDataBlock)
      Add a required data block. These are data blocks apart from the main one which are required before this task can complete. Data for these block will be loaded automatically.
      Parameters:
      dataBlock - required data block.
    • addRequiredDataBlock

      public void addRequiredDataBlock(PamDataBlock pamDataBlock, long preLoadMillis, long postLoadMillis)
      Add a required data block. These are data blocks apart from the main one which are required before this task can complete. Data for these block will be loaded automatically.
      Parameters:
      preLoadMillis - time required before main data used in offline task
      postLoadMillis - time required after main data used in offline task
      dataBlock - required data block.
    • getNumRequiredDataBlocks

      public int getNumRequiredDataBlocks()
      Returns:
      the number of data blocks required to run this task.
    • getRequiredDataBlock

      public RequiredDataBlockInfo getRequiredDataBlock(int iBlock)
      A data block required to run this task.
      Parameters:
      iBlock - block index
      Returns:
      data block .
    • addAffectedDataBlock

      public void addAffectedDataBlock(PamDataBlock dataBlock)
      Add an affected data block. These are data blocks apart from the main one which will have their contents changed by the task and will require saving / updating as the task progresses.
      Parameters:
      dataBlock - affected data block.
    • getNumAffectedDataBlocks

      public int getNumAffectedDataBlocks()
      Returns:
      the number of data blocks required to run this task.
    • getAffectedDataBlock

      public PamDataBlock getAffectedDataBlock(int iBlock)
      A data block required to run this task.
      Parameters:
      iBlock - block index
      Returns:
      data block .
    • getAffectedBlocksList

      public String getAffectedBlocksList()
      Get a formatted string list of affected data blocks
      Returns:
    • isDoRun

      public boolean isDoRun()
      Return whether or not the task SHOULD be run - i.e. if it is selected in the dialog, etc...
      Returns:
      true to run.
    • setDoRun

      public void setDoRun(boolean doRun)
      Set whether or not this task within a taskGroup should be run.
      Parameters:
      doRun - the doRun to set
    • getOfflineTaskGroup

      public OfflineTaskGroup getOfflineTaskGroup()
      Returns:
      the offlineTaskGroup
    • setOfflineTaskGroup

      public void setOfflineTaskGroup(OfflineTaskGroup offlineTaskGroup)
      Parameters:
      offlineTaskGroup - the offlineTaskGroup to set
    • deleteOldOutput

      @Deprecated public void deleteOldOutput(long currentViewDataStart, long currentViewDataEnd, OfflineDataMapPoint mapPoint)
      Deprecated.
      Delete database outptut data in the list of output datablocks. All data in the time range of data read into the primary source data block will be deleted.
      Parameters:
      currentViewDataStart -
      currentViewDataEnd -
      mapPoint -
    • prepareTask

      public void prepareTask()
      Called at the start of the thread which executes this task.
    • completeTask

      public void completeTask()
      Called at the end of the thread which executes this task.
    • deleteOldData

      public void deleteOldData(TaskGroupParams taskGroupParams)
      Gets called at the start of data processing, called oncer per run, i.e. not called again each time more data are loaded.
      Parameters:
      taskGroupParams -