Package PamguardMVC

Class PamRawDataBlock

Direct Known Subclasses:
AmplifiedDataBlock, ClickTriggerFunctionDataBlock, PatchPanelDataBlock

public class PamRawDataBlock extends AcousticDataBlock<RawDataUnit>
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
  • Constructor Details

    • PamRawDataBlock

      public PamRawDataBlock(String name, PamProcess parentProcess, int channelMap, float sampleRate)
    • 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 class PamDataBlock<RawDataUnit>
    • addPamData

      public void addPamData(RawDataUnit pamDataUnit)
      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 class PamDataBlock<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 milliseconds
      durationMillis - duration in milliseconds
      channelMap - 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 milliseconds
      durationMillis - duration in milliseconds
      channelMap - 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

      public ChannelListManager getChannelListManager()
      Overrides:
      getChannelListManager in class AcousticDataBlock<RawDataUnit>
    • addObserver

      public void addObserver(PamObserver o)
      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 class PamDataBlock<RawDataUnit>
      Parameters:
      o - Reference to the observer
    • addObserver

      public void addObserver(PamObserver o, boolean reThread)
      Overrides:
      addObserver in class PamDataBlock<RawDataUnit>
    • getSummaryString

      public String getSummaryString(boolean clear)
    • clearSummaryData

      public void clearSummaryData()
    • autoEffortProvider

      public EffortProvider 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 class PamDataBlock<RawDataUnit>
      Returns: