Package offlineProcessing
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
An offline task, such as click species id.
Generally controlled and operated from within
an OLProcessDialog
- Author:
- Doug Gillespie
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAffectedDataBlock
(PamDataBlock dataBlock) Add an affected data block.void
addRequiredDataBlock
(RequiredDataBlockInfo dataBlockInfo) Add a required data block.void
addRequiredDataBlock
(PamDataBlock pamDataBlock) Add a required data block.void
addRequiredDataBlock
(PamDataBlock pamDataBlock, long preLoadMillis, long postLoadMillis) Add a required data block.boolean
Call any task specific settingsboolean
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.void
Called at the end of the thread which executes this task.void
deleteOldData
(TaskGroupParams taskGroupParams) Gets called at the start of data processing, called oncer per run, i.e.void
deleteOldOutput
(long currentViewDataStart, long currentViewDataEnd, OfflineDataMapPoint mapPoint) Deprecated.Get a formatted string list of affected data blocksgetAffectedDataBlock
(int iBlock) A data block required to run this task.Get the parent data block for the taskGet a uniquely identifyng name for the task which consists of the pamControlledUnit type and name as well as the tasks shorter name from getName();abstract String
getName()
int
int
getRequiredDataBlock
(int iBlock) A data block required to run this task.Get the PAMControlled unit associated with a task.Get a unit name for the task.Get a unit type for the task.boolean
task has settings which can be calledboolean
isDoRun()
Return whether or not the task SHOULD be run - i.e.abstract void
Called when processing of loaded data, or each map point worth of data, is complete.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).void
Called at the start of the thread which executes this task.abstract boolean
processDataUnit
(T dataUnit) Process a single data unit.void
setDoRun
(boolean doRun) Set whether or not this task within a taskGroup should be run.void
setOfflineTaskGroup
(OfflineTaskGroup offlineTaskGroup) void
setParentDataBlock
(PamDataBlock dataBlock)
-
Constructor Details
-
OfflineTask
- Parameters:
parentDataBlock
-
-
-
Method Details
-
getTaskControlledUnit
Get the PAMControlled unit associated with a task.- Returns:
- PAMControlled unit associated with a task.
-
getDataBlock
Get the parent data block for the task- Returns:
- the datablock used by the task.
-
setParentDataBlock
- Parameters:
dataBlock
- the dataBlock to set
-
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
- Returns:
- a name for the task, to be displayed in the dialog.
-
getUnitType
Get a unit type for the task. This is the unit type of the parent PAMGuard module.- Returns:
- module name
-
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
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
Called when new data are loaded for offline processing (or once at the start of processing loaded data).- Parameters:
startTime
- start time of loaded dataendTime
- 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
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
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 taskpostLoadMillis
- time required after main data used in offline taskdataBlock
- required data block.
-
getNumRequiredDataBlocks
public int getNumRequiredDataBlocks()- Returns:
- the number of data blocks required to run this task.
-
getRequiredDataBlock
A data block required to run this task.- Parameters:
iBlock
- block index- Returns:
- data block .
-
addAffectedDataBlock
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
A data block required to run this task.- Parameters:
iBlock
- block index- Returns:
- data block .
-
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
- Returns:
- the offlineTaskGroup
-
setOfflineTaskGroup
- 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
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
-
-