Package clickDetector.offlineFuncs
Class OfflineEventDataBlock
java.lang.Object
PamguardMVC.PamObservable
PamguardMVC.PamDataBlock<OfflineEventDataUnit>
PamguardMVC.superdet.SuperDetDataBlock<OfflineEventDataUnit,PamDataUnit>
 
clickDetector.offlineFuncs.OfflineEventDataBlock
PamDataBlock for offline events. 
 
As with RainbowClick, this will (probably) hold all offline events from the database so that the operator can navigate through them with ease. However, only clicks associated with the currently loaded period will be loaded into memory and associated with the OfflineEventDataUnits.
- Author:
 - Doug
 
- 
Nested Class Summary
Nested classes/interfaces inherited from class PamguardMVC.superdet.SuperDetDataBlock
SuperDetDataBlock.ViewerLoadPolicy - 
Field Summary
Fields inherited from class PamguardMVC.PamDataBlock
ITERATOR_END, MATCH_AFTER, MATCH_BEFORE, MATCH_EXACT, MIX_DONOTHING, MIX_INTODATABASE, MIX_OUTOFDATABASE, naturalLifetime, NOTIFY_NEW_DATA, NOTIFY_UPDATE_DATA, pamDataUnits, parentProcess, POSITION_AFTER, POSITION_BEFORE, REFERENCE_ABSOLUTE, REFERENCE_CURRENT, REQUEST_DATA_LOADED, REQUEST_DATA_PARTIAL_LOAD, REQUEST_EXCEPTION, REQUEST_INTERRUPTED, REQUEST_NO_DATA, REQUEST_SAME_REQUEST, unitsAdded, unitsRemoved, unitsUpdatedFields inherited from class PamguardMVC.PamObservable
masterClockSample, objectChanged, overlayDraw, pamProfiler - 
Constructor Summary
ConstructorsConstructorDescriptionOfflineEventDataBlock(String dataName, ClickDetector parentProcess, int channelMap)  - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddPamData(OfflineEventDataUnit pamDataUnit) Adds a new PamDataUnit to the PamDataBlock.booleancanSuperDetection(PamDataBlock subDataBlock) Return whether this type of super detection can hold the passed sub detection data.voidclearAll()This is generally only called from loadViwerData and since LoadviewerData only ever operates once, it should never get called !intGet any information from the data block about cross referencing in database tables.Get the level of automation employed by the generation of these data.Get information about species types that may occur within this data block.double[]Get the nominal range of durations of sounds that might be detected by this detector (if applicable).intQuick event id for new data units.Find localisation algorithm for this data.booleangetShouldLog(PamDataUnit pamDataUnit) Should log the data unit to the database ?getTethysDataProvider(TethysControl tethysControl) Gets a data provider for Tethys.protected intremoveOldUnitsS(long mastrClockSample) protected intremoveOldUnitsT(long currentTimeMS) Removes olderPamDataUnits from memory, starting at the first unit and continuing until if finds one with data coming earlier than the given time in milliseconds.voidupdatePamData(OfflineEventDataUnit pamDataUnit, long updateTimeMillis) update a dataunit.Methods inherited from class PamguardMVC.superdet.SuperDetDataBlock
clearOnViewerLoad, dummyClassResolve, findSubDetDataBlock, getLogging, getSubDetectionClass, getSubtableData, getViewerLoadPolicy, makeSubDetectionInfo, reattachAllSubDetections, reattachSubdetections, setSubtableData, setViewerLoadPolicyMethods inherited from class PamguardMVC.PamDataBlock
addDataAnnotationType, addLocalisationContents, addObserver, addObserver, addOfflineDataMap, addOldPamData, addPamData, autoEffortProvider, autoSetDataBlockMixMode, cancelDataOrder, cancelDataOrder, checkOfflineDataUIDs, clearAll, clearChannelIterators, clearDeletedList, copyDataList, createProcessAnnotations, createProcessAnnotations, dispose, dumpBlockContents, dumpBufferStatus, findAnnotation, findAnnotation, findByDatabaseIndex, findDataUnit, findDataUnit, findFirstUnitAfter, findLastUnitBefore, findUnitByUIDandUTC, findUnitsinInterval, getAbsoluteDataUnit, getAnnotationHandler, getARealChannel, getBackgroundManager, getBespokeDataMapGraphic, getBinaryDataSource, getCanLog, getChannelIterator, getChannelIteratorCount, getChannelsForSequenceMap, getClosestUnitMillis, getClosestUnitMillis, getClosestUnitMillisUsingSeq, getCumulativeGain, getCurrentViewDataEnd, getCurrentViewDataStart, getDataBlockXML, getDataCopy, getDataCopy, getDataCopy, getDataCopy, getDataCopyFromEnd, getDataCopyFromStart, getDataGain, getDatagrammedMap, getDatagramProvider, getDataName, getDataSelector, getDataSelector, getDataSelector, getDataUnit, getDataUnitMenuItems, getDataUnitPopupMenu, getEffortProvider, getFirstRawSourceDataBlock, getFirstUnit, getFirstUnit, getFirstUnitAfter, getFirstViewerUID, getFrequencyRange, getHydrophoneMap, getJSONDataSource, getLastUnit, getLastUnit, getLastUnitMillis, getLastViewerUID, getListIterator, getListIterator, getListIteratorFromEnd, getListIteratorFromStart, getLocalisationContents, getLoggingName, getLongDataName, getMixedDirection, getMyDataUnits, getNanoTimeCalculator, getNaturalLifetime, getNaturalLifetimeMillis, getNextDataStart, getNextUnit, getNextUnit, getNumOfflineDataMaps, getNumRequiredBeforeLoadTime, getOfflineData, getOfflineDataMap, getOfflineDataMap, getPamConfiguration, getPamSymbolManager, getParentProcess, getPreceedingUnit, getPreceedingUnit, getPreceedingUnit, getPreceedingUnit, getPreceedingUnitFromSeq, getPreceedingUnitFromSeq, getPrevDataEnd, getPrimaryDataMap, getProcessAnnotations, getQuickId, getQuickId2, getRawSourceDataBlock, getRawSourceDataBlock2, getRecordingTrigger, getRecycledUnit, getRecyclingStoreLength, getRemovedItems, getReverseChannelIterator, getSampleRate, getSaveRequirements, getSequenceCount, getSequenceIterator, getSequenceMap, getSequenceMapObject, getShouldBinary, getShouldLog, getSourceDataBlock, getSourceProcess, getSuperDetectionClass, getSynchLock, getTaskDataCopy, getTOADCalculator, getUidHandler, getUIDRepairLogging, getUniqueParentList, getUnitClass, getUnitIndex, getUnitsCount, getUnitsCountFromTime, hasDataRange, isCanClipGenerate, isClearAtStart, isLinkGpsData, isOffline, isRecycling, loadViewerData, loadViewerData, masterClockUpdate, needViewerDataLoad, noteNewSettings, notifyModelChanged, notifyOfflineObservers, orderOfflineData, orderOfflineData, orderOfflineData, pamStart, pamStop, remove, remove, remove, removedDataUnit, removeOfflineDataMap, reset, saveViewerData, setAnnotationHandler, setBackgroundManager, setBinaryDataSource, setCanClipGenerate, setChannelMap, setClearAtStart, setCurrentViewDataEnd, setCurrentViewDataStart, setDatagramProvider, setDataName, setDataSelectCreator, setEffortProvider, setJSONDataSource, setLinkGpsData, setLocalisationContents, SetLogging, setMixedDirection, setNanoTimeCalculator, setNaturalLifetime, setNaturalLifetimeMillis, setPamSymbolManager, setParentProcess, setRecordingTrigger, setRecycling, setRecyclingStoreLength, setSampleRate, setSequenceMap, setShouldBinary, setShouldLog, setSynchLock, setUidHandler, shouldNotify, sortData, sortOutputMaps, stopTimer, toStringMethods inherited from class PamguardMVC.PamObservable
addInstantObserver, canDraw, canDraw, clearchanged, countObservers, createKeyItem, deleteObserver, deleteObservers, drawDataUnit, findThreadedObserver, getCPUPercent, getCPUPercent, getHoverText, getInstantObservers, getLongestObserver, getMaxThreadJitter, getOverlayDraw, getPamObserver, getPamObservers, getRequiredHistory, isInstantObserver, notifyInstantObservers, notifyNornalObservers, notifyObservers, notifyObservers, setChanged, setOverlayDraw, updateObservers, waitForThreadedObservers 
- 
Constructor Details
- 
OfflineEventDataBlock
 
 - 
 - 
Method Details
- 
getLastEventId
public int getLastEventId()Quick event id for new data units. Generally, this will get overwritten when there is a database with the database index, but will stick if there is no database.- Returns:
 
 - 
getChannelMap
public int getChannelMap()- Overrides:
 getChannelMapin classPamDataBlock<OfflineEventDataUnit>- Returns:
 - Software channel map for the data block.
 
 - 
addPamData
Description copied from class:PamDataBlockAdds a new PamDataUnit to the PamDataBlock. When the data unit is added, PamObservers that have subscribed to the block will be notified.
If the data unit already has a UID, it will be left as is.- Overrides:
 addPamDatain classPamDataBlock<OfflineEventDataUnit>- Parameters:
 pamDataUnit- Reference to a PamDataUnit
 - 
getShouldLog
Description copied from class:PamDataBlockShould log the data unit to the database ?- Overrides:
 getShouldLogin classPamDataBlock<OfflineEventDataUnit>- Parameters:
 pamDataUnit- dataunit to consider- Returns:
 - true if data should be logged.
 
 - 
clearAll
public void clearAll()This is generally only called from loadViwerData and since LoadviewerData only ever operates once, it should never get called !- Overrides:
 clearAllin classPamDataBlock<OfflineEventDataUnit>
 - 
removeOldUnitsS
protected int removeOldUnitsS(long mastrClockSample) - Overrides:
 removeOldUnitsSin classPamDataBlock<OfflineEventDataUnit>
 - 
removeOldUnitsT
protected int removeOldUnitsT(long currentTimeMS) Description copied from class:PamDataBlockRemoves olderPamDataUnits from memory, starting at the first unit and continuing until if finds one with data coming earlier than the given time in milliseconds.If the data are acoustic, it tries to find the data source and looks to see how much data has been placed in the source data unit and does the calculation in samples.
- Overrides:
 removeOldUnitsTin classPamDataBlock<OfflineEventDataUnit>- Parameters:
 currentTimeMS- Time in milliseconds of the first data which must be kept- Returns:
 - the number of units removed
 
 - 
updatePamData
Description copied from class:PamDataBlockupdate a dataunit. Does little except flag that the data unit is updated (so it will get saved), and sends notifications to other modules.- Overrides:
 updatePamDatain classPamDataBlock<OfflineEventDataUnit>- Parameters:
 pamDataUnit-updateTimeMillis-
 - 
getDataSelectCreator
- Overrides:
 getDataSelectCreatorin classPamDataBlock<OfflineEventDataUnit>- Returns:
 - an object that can create data selectors to sub select data from within this type of data block.
 
 - 
getCrossReferenceInformation
Description copied from class:PamDataBlockGet any information from the data block about cross referencing in database tables.This gets used when importing databases, whereby Id's will change, so may need to be rewritten in related tables. Does not (currently) handle issues with UID's.
- Overrides:
 getCrossReferenceInformationin classPamDataBlock<OfflineEventDataUnit>- Returns:
 - null or cross reference information.
 
 - 
getDurationRange
public double[] getDurationRange()Description copied from class:PamDataBlockGet the nominal range of durations of sounds that might be detected by this detector (if applicable). This is pretty crude, but will give an indication of which detectors might work with which types of sound.
can return null, 0 and Double.Infinity are also acceptable values.- Overrides:
 getDurationRangein classPamDataBlock<OfflineEventDataUnit>- Returns:
 - duration range in seconds of sounds this detector can sensibly detect
 
 - 
canSuperDetection
Description copied from class:SuperDetDataBlockReturn whether this type of super detection can hold the passed sub detection data. Default is based on class compatibility, but some super det datablocks should override this if they only manage one stream of data.- Overrides:
 canSuperDetectionin classSuperDetDataBlock<OfflineEventDataUnit,PamDataUnit> - Parameters:
 subDataBlock- Sub detection data block- Returns:
 - true if this data can hold those sub data.
 
 - 
getDatablockSpeciesManager
Description copied from class:PamDataBlockGet information about species types that may occur within this data block. Primarily for conversion into Tethys compatible data, but may prove to have other uses.- Overrides:
 getDatablockSpeciesManagerin classPamDataBlock<OfflineEventDataUnit>- Returns:
 - Types of species information available within this datablock.
 
 - 
getTethysDataProvider
Description copied from class:PamDataBlockGets a data provider for Tethys. These will probably need to be bespoke, but for now will autogenerate based on the SQLLogging information.- Overrides:
 getTethysDataProviderin classPamDataBlock<OfflineEventDataUnit>- Returns:
 - the tethysDataProvider
 
 - 
getDataAutomationInfo
Description copied from class:PamDataBlockGet the level of automation employed by the generation of these data. Should ideally be completed for everything providing data to Tethys.- Overrides:
 getDataAutomationInfoin classPamDataBlock<OfflineEventDataUnit>- Returns:
 - level of automation for this data block.
 
 - 
getLocalisationAlgorithm
Description copied from class:PamDataBlockFind localisation algorithm for this data. This may be within the owning module, or a downstream algorithm.- Overrides:
 getLocalisationAlgorithmin classPamDataBlock<OfflineEventDataUnit>- Returns:
 - first found localisation algorithm or null;
 
 
 -