Class SuperDetection<T extends PamDataUnit>
- Type Parameters:
T
-
- All Implemented Interfaces:
Comparable<PamDataUnit>
- Direct Known Subclasses:
CBDetectionMatcher.CBMatchGroup
,DetectionGroupDataUnit
,EventDataUnit
,Group3DDataUnit
,GroupDetDataUnit
,GroupDetection
,IshAnchorGroup
,MarkGroupDataUnit
,QADataUnit
A Major change now taking place is that the list of SubdetectionInfo's in viewer mode now contains all infos for the data unit, regardless of whether their actual data unit is there or not. Separating out the infos from the dataunit gives much better control over how superdetection data are handled.
- Author:
- Doug Gillespie
-
Constructor Summary
ConstructorDescriptionSuperDetection
(long timeMilliseconds) SuperDetection
(long timeMilliseconds, int channelBitmap, long startSample, long durationSamples) SuperDetection
(DataUnitBaseData basicData) -
Method Summary
Modifier and TypeMethodDescriptionint
addSubDetection
(T subDetection) Add a sub detection to the sub detection list.void
addSubDetectionInfo
(SubdetectionInfo<T> subDetInfo) int
addSubDetections
(List<T> newSubDets) Add multiple sub detections from a list.void
Clears all sub detection data.void
Clears actual detections from the sub detection data.void
clears the list of subdetections that have been removedfindSubDetection
(long UID) Find a subdetection with a specific UIDfindSubDetection
(long timeMillis, int channelBitmap) find a sub detection based on it's time and it's channel mapfindSubDetection
(long timeMillis, int channelBitmap, Class dataClass) Find a sub detection with a specific time, channel map and data unit class.int
findSubdetectionInfo
(T subToFind) Returns the index of the SubdetectionInfo object containing the passed subdetectionint
findSubDetectionInfo
(SubdetectionInfo otherInfo) find a sub detection info that has the same times, id's etc.int
Get the number of sub detections that are actually in memory.Get a list of sub detections which are actually present.getSubDetection
(int ind) getSubdetectionInfo
(int idx) Get sub detection info at a specified index.Get the full list of subdetection info's (which may not all have a sub detection in memory)ArrayList<PamDataUnit<?,
?>> Get a basic list of sub detections without their associated info This may not be ALL of the sub detections, since they may not all be loaded.int
Get the number of sub detections in the super detection.returns a list of the database indices of all subdetections that have been removedboolean
void
Remove all sub detection information.void
removeSubDetection
(T subDetection) Remove a sub detection from the data unit.void
replaceSubDetection
(T oldOne, T newOne) Replace a sub detection in an event.void
Sorts sub detections into order.Methods inherited from class PamguardMVC.PamDataUnit
addDataAnnotation, addSuperDetection, amplifyMeasuredAmplitudeByDB, amplifyMeasuredAmplitudeByLinear, calcSnapshotGeometry, clearOandAngles, clearUpdateCount, compareTo, findDataAnnotation, findDataAnnotation, freeData, getAbsBlockIndex, getAmplitudeDB, getAnnotationsSummaryString, getBasicData, getCalculatedAmlitudeDB, getChannelBitmap, getColourIndex, getDataAnnotation, getDatabaseIndex, getDatabaseUpdateOf, getDataUnitFileInformation, getDataUnitPopupMenu, getDurationInMilliseconds, getEndTimeInMilliseconds, getFrequency, getFrequencyOverlap, getHydrophoneBitmap, getHydrophoneHeading, getLastChangeTime, getLastSample, getLastUpdateTime, getLocalisation, getMeasuredAmplitude, getMeasuredAmplitudeType, getNoiseBackground, getNumDataAnnotations, getOriginLatLong, getParentDataBlock, getSampleDuration, getSampleDurationAsInt, getSeconds, getSequenceBitmap, getSequenceBitmapObject, getSignalExcess, getSignalSPL, getSnapshotGeometry, getStartSample, getSummaryString, getSuperDetection, getSuperDetection, getSuperDetection, getSuperDetection, getSuperDetection, getSuperDetectionsCount, getSuperDetectionSyncronisation, getSuperId, getTimeDelaysSeconds, getTimeMilliseconds, getTimeNanoseconds, getTimeOverlap, getUID, getUpdateCount, isEmbryonic, isForceAmpRecalc, linAmplitudeToDB, removeDataAnnotation, removeDataAnnotation, removeSuperDetection, setAbsBlockIndex, setCalculatedAmlitudeDB, setChannelBitmap, setDatabaseIndex, setDatabaseUpdateOf, setDataUnitFileInformation, setDurationInMilliseconds, setEmbryonic, setForceAmpRecalc, setFrequency, setInfo, setLastUpdateTime, setLocalisation, setMeasuredAmpAndType, setMeasuredAmplitude, setMeasuredAmplitudeType, setNoiseBackground, setParentDataBlock, setSampleDuration, setSequenceBitmap, setSignalExcess, setSignalSPL, setSnapshotGeometry, setStartSample, setTimeDelaysSeconds, setTimeMilliseconds, setUID, setUniqueSuperDetection, sortOutputMaps, updateDataUnit
-
Constructor Details
-
SuperDetection
-
SuperDetection
public SuperDetection(long timeMilliseconds, int channelBitmap, long startSample, long durationSamples) -
SuperDetection
public SuperDetection(long timeMilliseconds)
-
-
Method Details
-
getSubDetectionSyncronisation
-
isAllowSubdetectionSharing
public boolean isAllowSubdetectionSharing() -
addSubDetections
Add multiple sub detections from a list.- Parameters:
newSubDets
- List of new sub detections- Returns:
- total number of sub detections now in the super detection
-
addSubDetection
Add a sub detection to the sub detection list.- Parameters:
subDetection
- - the sub detection to add.- Returns:
- - the total number of sub detections now in the list. .
-
sortSubDetections
public void sortSubDetections()Sorts sub detections into order. Uses the inbuilt comparator which compares the millisecond times of data units. -
findSubdetectionInfo
Returns the index of the SubdetectionInfo object containing the passed subdetection- Parameters:
subToFind
- the subdetection to find- Returns:
- index position, or -1 if the subdetection wasn't found
-
findSubDetectionInfo
find a sub detection info that has the same times, id's etc.- Parameters:
otherInfo
-- Returns:
- index of found item, or -1
-
getSubDetectionsCount
public int getSubDetectionsCount()Get the number of sub detections in the super detection. note that they may not all be loaded in memory.- Returns:
- Number of sub detections.
-
getLoadedSubDetectionsCount
public int getLoadedSubDetectionsCount()Get the number of sub detections that are actually in memory.- Returns:
- number of subdets linked in memory
-
getSubDetections
Get a basic list of sub detections without their associated info This may not be ALL of the sub detections, since they may not all be loaded.- Returns:
- an array list of sub detection data units
-
getSubDetection
-
findSubDetection
find a sub detection based on it's time and it's channel map- Parameters:
timeMillis
- time in millisecondschannelBitmap
- channel map- Returns:
- found sub detection, or null if none exists.
-
findSubDetection
Find a sub detection with a specific time, channel map and data unit class.- Parameters:
timeMillis
-channelBitmap
-dataClass
-- Returns:
- found sub detection or null.
-
findSubDetection
Find a subdetection with a specific UID- Parameters:
UID
- the UID to find- Returns:
- the found subdetection, or null
-
replaceSubDetection
Replace a sub detection in an event.if the original sub detection does not exist, then the new one is added anyway.
NOTE: not sure if this is working properly. I think that in the else block, it should simply do a removeSubDetection(oldOne) and addSubDetection(newOne), which properly sets things up to be added/removed from the database. The way it's written now, things are not deleted from the database. Should test this out before using this method
DG - so far as I understand this method, it gets called when we've been scrolling back and forth through the data, so an event may already have sub detections which weren't cleared on data load but the sub dets were removed from the datablock but then reloaded with different id's, so the new objects need to replace the old ones, but other information doesn't need updating.
but I ask why the events were'nt all cleared of all their sub detections when data were loaded?- Parameters:
oldOne
- old sub detectionnewOne
- new sub detection.
-
removeAllSubDetections
public void removeAllSubDetections()Remove all sub detection information. -
removeSubDetection
Remove a sub detection from the data unit.- Parameters:
subDetection
- - the sub detection to remove.
-
getPresentSubDetections
Get a list of sub detections which are actually present.- Returns:
- list of sub detections which have a non-null sub data unit.
-
getSubDetectionInfo
Get the full list of subdetection info's (which may not all have a sub detection in memory) -
getSubdetectionInfo
Get sub detection info at a specified index.- Parameters:
idx
-
-
getSubdetectionsRemoved
returns a list of the database indices of all subdetections that have been removed- Returns:
-
clearSubdetectionsRemoved
public void clearSubdetectionsRemoved()clears the list of subdetections that have been removed -
addSubDetectionInfo
-
clearSubDetectionData
public void clearSubDetectionData()Clears all sub detection data. i.e. the holders of sub detection informaiotn, should probably never be called. -
clearSubDetectionObjects
public void clearSubDetectionObjects()Clears actual detections from the sub detection data. This should be called whenever more viewer data are loaded, since we only want references to data units that are in the actual data unit list.
-