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, NOTIFY_NEW_DATA, NOTIFY_UPDATE_DATA, 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
-
Constructor Summary
ConstructorDescriptionPamRawDataBlock
(String name, PamProcess parentProcess, int channelMap, float sampleRate) PamRawDataBlock
(String name, PamProcess parentProcess, int channelMap, float sampleRate, boolean autoDisplay) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a PamObserver, which will then receive notifications when data is added.void
addObserver
(PamObserver o, boolean reThread) void
addPamData
(RawDataUnit pamDataUnit) Adds a new PamDataUnit to the PamDataBlock.Auto generate an effort provider.void
getAvailableSamples
(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.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) void
reset()
Reset data integrity checking counters.Methods inherited from class PamguardMVC.AcousticDataBlock
getDataBlockXML, getParentSourceData, notifyModelChanged
Methods inherited from class PamguardMVC.PamDataBlock
addDataAnnotationType, addLocalisationContents, addOfflineDataMap, addOldPamData, addPamData, autoSetDataBlockMixMode, cancelDataOrder, cancelDataOrder, checkOfflineDataUIDs, clearAll, clearChannelIterators, clearDeletedList, clearOnViewerLoad, copyDataList, createProcessAnnotations, createProcessAnnotations, dispose, dumpBlockContents, dumpBufferStatus, findAnnotation, findAnnotation, findByDatabaseIndex, findDataUnit, findDataUnit, findFirstUnitAfter, findLastUnitBefore, findUnitByUIDandUTC, findUnitsinInterval, 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, 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, getTethysDataProvider, getTOADCalculator, getUidHandler, getUIDRepairLogging, getUniqueParentList, getUnitClass, getUnitIndex, getUnitsCount, getUnitsCountFromTime, hasDataRange, isCanClipGenerate, isClearAtStart, isLinkGpsData, isOffline, isRecycling, loadViewerData, loadViewerData, masterClockUpdate, needViewerDataLoad, noteNewSettings, orderOfflineData, orderOfflineData, orderOfflineData, pamStart, pamStop, remove, remove, remove, removeOfflineDataMap, saveViewerData, setAnnotationHandler, setBackgroundManager, setBinaryDataSource, setCanClipGenerate, setChannelMap, setClearAtStart, setDatagramProvider, setDataName, setDataSelectCreator, setJSONDataSource, setLinkGpsData, setLocalisationContents, SetLogging, setMixedDirection, setNanoTimeCalculator, setNaturalLifetime, setNaturalLifetimeMillis, setPamSymbolManager, setParentProcess, setRecordingTrigger, setRecycling, setRecyclingStoreLength, setSampleRate, setSequenceMap, setShouldBinary, setShouldLog, setSynchLock, setUidHandler, shouldNotify, sortData, sortOutputMaps, stopTimer, toString, updatePamData
Methods inherited from class PamguardMVC.PamObservable
addInstantObserver, canDraw, canDraw, clearchanged, countObservers, createKeyItem, deleteObserver, deleteObservers, drawDataUnit, findThreadedObserver, getCPUPercent, getCPUPercent, getHoverText, getLongestObserver, getMaxThreadJitter, getOverlayDraw, getPamObserver, 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
-
reset
public void reset()Reset data integrity checking counters.- Overrides:
reset
in classPamDataBlock<RawDataUnit>
-
addPamData
Description copied from class:PamDataBlock
Adds 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:
addPamData
in 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:
getChannelListManager
in classAcousticDataBlock<RawDataUnit>
-
addObserver
Description copied from class:PamObservable
Adds a PamObserver, which will then receive notifications when data is added. This is for single thread ops only- Overrides:
addObserver
in classPamDataBlock<RawDataUnit>
- Parameters:
o
- Reference to the observer
-
addObserver
- Overrides:
addObserver
in classPamDataBlock<RawDataUnit>
-
getSummaryString
-
clearSummaryData
public void clearSummaryData() -
autoEffortProvider
Description copied from class:PamDataBlock
Auto 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:
autoEffortProvider
in classPamDataBlock<RawDataUnit>
- Returns:
-