Package PamguardMVC
Class PamRawDataBlock
- Direct Known Subclasses:
 AmplifiedDataBlock,ClickTriggerFunctionDataBlock,PatchPanelDataBlock
Extension of RecyclingDataBlock that is used for Raw audio data. 
 
Has the extra function for getting raw data samples out of the blocks. Also has some special constructors that set the parent and source data blocks to null. However, Raw data my be poduced by intermediate processes as well, in which case parent and source blocks will not be null
- Author:
 - Doug Gillespie
 
- 
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
ConstructorsConstructorDescriptionPamRawDataBlock(String name, PamProcess parentProcess, int channelMap, float sampleRate) PamRawDataBlock(String name, PamProcess parentProcess, int channelMap, float sampleRate, boolean autoDisplay)  - 
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a PamObserver, which will then receive notifications when data is added.voidaddObserver(PamObserver o, boolean reThread) voidaddPamData(RawDataUnit pamDataUnit) Adds a new PamDataUnit to the PamDataBlock.Auto generate an effort provider.voidgetAvailableSamples(long startMillis, long durationMillis, int channelMap) Get available data from the raw data block.getAvailableSamples(long startMillis, long durationMillis, int channelMap, boolean offlineLoad) Get available data from the raw data block.DC filter to use on all incoming data.double[][]getSamples(long startSample, int duration, int channelMap) Creates an array and fills it with raw data samples.double[][]getSamples(long startSample, int duration, int channelMap, double[][] wavData) Gets samples of raw data into a pre existing array.double[][]getSamplesForMillis(long startMillis, long durationMillis, int channelMap) Get data based on millisecond times.getSummaryString(boolean clear) protected intremoveOldUnitsT(long currentTimeMS) Keep a record of the last sample added.voidreset()Reset data integrity checking counters.voidsetDcFilter(DCFilter dcFilter) DC filter to use on all incoming data.Methods inherited from class PamguardMVC.AcousticDataBlock
findParentSource, getDataBlockXML, getParentSourceData, notifyModelChanged, prepareAmplitudeCalculations, prepareChannelListsMethods inherited from class PamguardMVC.PamDataBlock
addDataAnnotationType, addLocalisationContents, addOfflineDataMap, addOldPamData, addPamData, autoSetDataBlockMixMode, cancelDataOrder, cancelDataOrder, checkOfflineDataUIDs, clearAll, clearAll, clearChannelIterators, clearDeletedList, clearOnViewerLoad, copyDataList, createProcessAnnotations, createProcessAnnotations, dispose, dumpBlockContents, dumpBufferStatus, findAnnotation, findAnnotation, findByDatabaseIndex, findDataUnit, findDataUnit, findFirstUnitAfter, findLastUnitBefore, findUnitByUIDandUTC, findUnitsinInterval, getAbsoluteDataUnit, getAnnotationHandler, getARealChannel, getBackgroundManager, getBespokeDataMapGraphic, getBinaryDataSource, getCanLog, getChannelIterator, getChannelIteratorCount, getChannelMap, getChannelsForSequenceMap, getClosestUnitMillis, getClosestUnitMillis, getClosestUnitMillisUsingSeq, getCrossReferenceInformation, getCumulativeGain, getCurrentViewDataEnd, getCurrentViewDataStart, getDataAutomationInfo, getDatablockSpeciesManager, getDataCopy, getDataCopy, getDataCopy, getDataCopy, getDataCopyFromEnd, getDataCopyFromStart, getDataGain, getDatagrammedMap, getDatagramProvider, getDataName, getDataSelectCreator, getDataSelector, getDataSelector, getDataSelector, getDataUnit, getDataUnitMenuItems, getDataUnitPopupMenu, getDurationRange, getEffortProvider, getFirstRawSourceDataBlock, getFirstUnit, getFirstUnit, getFirstUnitAfter, getFirstViewerUID, getFrequencyRange, getHydrophoneMap, getJSONDataSource, getLastUnit, getLastUnit, getLastUnitMillis, getLastViewerUID, getListIterator, getListIterator, getListIteratorFromEnd, getListIteratorFromStart, getLocalisationAlgorithm, getLocalisationContents, getLogging, 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, getShouldLog, getSourceDataBlock, getSourceProcess, getSuperDetectionClass, getSynchLock, getTaskDataCopy, getTethysDataProvider, getTOADCalculator, getUidHandler, getUIDRepairLogging, getUniqueParentList, getUnitClass, getUnitIndex, getUnitsCount, getUnitsCountFromTime, hasDataRange, isCanClipGenerate, isClearAtStart, isLinkGpsData, isOffline, isRecycling, loadViewerData, loadViewerData, masterClockUpdate, needViewerDataLoad, noteNewSettings, notifyOfflineObservers, orderOfflineData, orderOfflineData, orderOfflineData, pamStart, pamStop, remove, remove, remove, removedDataUnit, removeOfflineDataMap, removeOldUnitsS, 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, toString, updatePamDataMethods 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
- 
PamRawDataBlock
 - 
PamRawDataBlock
public PamRawDataBlock(String name, PamProcess parentProcess, int channelMap, float sampleRate, boolean autoDisplay)  
 - 
 - 
Method Details
- 
removeOldUnitsT
protected int removeOldUnitsT(long currentTimeMS) Keep a record of the last sample added.- Overrides:
 removeOldUnitsTin classPamDataBlock<RawDataUnit>- Parameters:
 currentTimeMS- Time in milliseconds of the first data which must be kept- Returns:
 - the number of units removed
 
 - 
reset
public void reset()Reset data integrity checking counters.- Overrides:
 resetin classPamDataBlock<RawDataUnit>
 - 
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<RawDataUnit>- Parameters:
 pamDataUnit- Reference to a PamDataUnit
 - 
getAvailableSamples
public RawDataUnit[] getAvailableSamples(long startMillis, long durationMillis, int channelMap, boolean offlineLoad) throws RawDataUnavailableException Get available data from the raw data block. Similar to the functionality of getSamplesforMillis, but this will not throw an exception if not all of the samples are available. Exception only thrown if the channels are unavailable or no data whatsoever are available.
Data are returned in RawDataUnits so that start time and duration can be accurately given since they may not be the same as the requested values.- Parameters:
 startMillis- Start time in millisecondsdurationMillis- duration in millisecondschannelMap- channel map to load.offlineLoad- flag to say to load data if required in viewer mode (not possible in normal mode)- Returns:
 - One RawDataUnit per channel.
 - Throws:
 RawDataUnavailableException
 - 
getAvailableSamples
public RawDataUnit[] getAvailableSamples(long startMillis, long durationMillis, int channelMap) throws RawDataUnavailableException Get available data from the raw data block. Similar to the functionality of getSamplesforMillis, but this will not throw an exception if not all of the samples are available. Exception only thrown if the channels are unavailable or no data whatsoever are available.
Data are returned in RawDataUnits so that start time and duration can be accurately given since they may not be the same as the requested values.- Parameters:
 startMillis- Start time in millisecondsdurationMillis- duration in millisecondschannelMap- channel map to load.- Returns:
 - One RawDataUnit per channel.
 - Throws:
 RawDataUnavailableException
 - 
getSamplesForMillis
public double[][] getSamplesForMillis(long startMillis, long durationMillis, int channelMap) throws RawDataUnavailableException Get data based on millisecond times.- Parameters:
 startMillis-durationMillis-channelMap-- Returns:
 - Throws:
 RawDataUnavailableException
 - 
getSamples
public double[][] getSamples(long startSample, int duration, int channelMap) throws RawDataUnavailableException Creates an array and fills it with raw data samples.- Parameters:
 startSample-duration-channelMap-- Returns:
 - double array of raw data
 - Throws:
 RawDataUnavailableException
 - 
getSamples
public double[][] getSamples(long startSample, int duration, int channelMap, double[][] wavData) Gets samples of raw data into a pre existing array. If the array is the wrong size or does not exist, then a new one is created.- Parameters:
 startSample-duration-channelMap-wavData-- Returns:
 - double array of raw data
 
 - 
getChannelListManager
- Overrides:
 getChannelListManagerin classAcousticDataBlock<RawDataUnit>
 - 
addObserver
Description copied from class:PamObservableAdds a PamObserver, which will then receive notifications when data is added. This is for single thread ops only- Overrides:
 addObserverin classPamDataBlock<RawDataUnit>- Parameters:
 o- Reference to the observer
 - 
addObserver
- Overrides:
 addObserverin classPamDataBlock<RawDataUnit>
 - 
getSummaryString
 - 
clearSummaryData
public void clearSummaryData() - 
autoEffortProvider
Description copied from class:PamDataBlockAuto generate an effort provider. This may get called many times for blocks without effort, but that doesn't really matter since its only going to happen when opening dialogs, etc.- Overrides:
 autoEffortProviderin classPamDataBlock<RawDataUnit>- Returns:
 
 - 
setDcFilter
DC filter to use on all incoming data. Don't probably want this in normal mode since it's already done in the acquisition thread, but have option to do it in viewer mode if it's set from the process owning this data block.- Parameters:
 dcFilter-
 - 
getDcFilter
DC filter to use on all incoming data. Don't probably want this in normal mode since it's already done in the acquisition thread, but have option to do it in viewer mode if it's set from the process owning this data block.- Returns:
 
 
 -