Package tethys.detection
Class DetectionsHandler
java.lang.Object
tethys.CollectionHandler
tethys.detection.DetectionsHandler
Functions for handling output of Detections documents.
Works closely with a TethysDataProvider and DataBlockSpeciesManager
to generate Detections elements for an xml doc to export to Tethys.
- Author:
- dg50
-
Field Summary
FieldsFields inherited from class tethys.CollectionHandler
tethysControl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
send a cancel command to export thread if it's runningint
countDetections
(PamDataBlock dataBlock, StreamExportParams streamExportParams, DetectionExportObserver exportObserver) Export detections in all deployments for this PAMGuard dataset.void
exportDataBlock
(PamDataBlock dataBlock) Export data from given block, using appropriate species checks and other dialogs.int
exportDetections
(PamDataBlock dataBlock, StreamExportParams streamExportParams, DetectionExportObserver exportObserver) Export detections and localisations in all deployments for this PAMGuard dataset.getStreamDetections
(PamDataBlock dataBlock) Get a list of Detections documents associated with a particular data stream for this data set (not the entire project).getStreamDetections
(PamDataBlock dataBlock, ArrayList<PDeployment> deployments) Get a list of Detections documents associated with a particular data block for the list of deployments documents.boolean
static long
roundDownBinStart
(long binStart, long binInterval) Round a bin start so that it's aligned correctly with day starts.void
setActiveExport
(boolean activeExport) void
startExportThread
(PamDataBlock pamDataBlock, StreamExportParams streamExportParams, DetectionExportObserver exportObserver) Detections will be exported in a separate worker thread since export may take some time and the user should be given ample opportunity to cancel it.Methods inherited from class tethys.CollectionHandler
collectionName, getCollection, getDetectorEffort, getMethodString, getSoftwareString, getSupportSoftware, getSupportSoftwareVersion, getTethysControl, getVersionString
-
Field Details
-
Constructor Details
-
Method Details
-
getStreamDetections
public StreamDetectionsSummary<NilusDataWrapper<PDetections>> getStreamDetections(PamDataBlock dataBlock) Get a list of Detections documents associated with a particular data stream for this data set (not the entire project).- Parameters:
dataBlock
-
-
getStreamDetections
public StreamDetectionsSummary<NilusDataWrapper<PDetections>> getStreamDetections(PamDataBlock dataBlock, ArrayList<PDeployment> deployments) Get a list of Detections documents associated with a particular data block for the list of deployments documents. Group them by abstract or something- Parameters:
dataBlock
-deployments
-- Returns:
-
startExportThread
public void startExportThread(PamDataBlock pamDataBlock, StreamExportParams streamExportParams, DetectionExportObserver exportObserver) Detections will be exported in a separate worker thread since export may take some time and the user should be given ample opportunity to cancel it.- Parameters:
pamDataBlock
-streamExportParams
-exportWorkerCard
-
-
cancelExport
public void cancelExport()send a cancel command to export thread if it's running -
roundDownBinStart
public static long roundDownBinStart(long binStart, long binInterval) Round a bin start so that it's aligned correctly with day starts.- Parameters:
binStart
- in millisecondsbinInterval
- in milliseconds- Returns:
- rounded time.
-
countDetections
public int countDetections(PamDataBlock dataBlock, StreamExportParams streamExportParams, DetectionExportObserver exportObserver) Export detections in all deployments for this PAMGuard dataset.- Parameters:
dataBlock
-streamExportParams
-exportObserver
-- Returns:
-
exportDetections
public int exportDetections(PamDataBlock dataBlock, StreamExportParams streamExportParams, DetectionExportObserver exportObserver) Export detections and localisations in all deployments for this PAMGuard dataset.- Parameters:
dataBlock
-streamExportParams
-exportObserver
-- Returns:
-
exportDataBlock
Export data from given block, using appropriate species checks and other dialogs.- Parameters:
dataBlock
-
-
getHelpPoint
- Specified by:
getHelpPoint
in classCollectionHandler
-
isActiveExport
public boolean isActiveExport()- Returns:
- the activeExport
-
setActiveExport
public void setActiveExport(boolean activeExport) - Parameters:
activeExport
- the activeExport to set
-