Class OfflineEventDataBlock


public class OfflineEventDataBlock extends SuperDetDataBlock<OfflineEventDataUnit,PamDataUnit>
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
  • Constructor Details

    • OfflineEventDataBlock

      public OfflineEventDataBlock(String dataName, ClickDetector parentProcess, int channelMap)
  • 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:
      getChannelMap in class PamDataBlock<OfflineEventDataUnit>
      Returns:
      Software channel map for the data block.
    • addPamData

      public void addPamData(OfflineEventDataUnit 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<OfflineEventDataUnit>
      Parameters:
      pamDataUnit - Reference to a PamDataUnit
    • getShouldLog

      public boolean getShouldLog(PamDataUnit pamDataUnit)
      Description copied from class: PamDataBlock
      Should log the data unit to the database ?
      Overrides:
      getShouldLog in class PamDataBlock<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:
      clearAll in class PamDataBlock<OfflineEventDataUnit>
    • updatePamData

      public void updatePamData(OfflineEventDataUnit pamDataUnit, long updateTimeMillis)
      Description copied from class: PamDataBlock
      update a dataunit. Does little except flag that the data unit is updated (so it will get saved), and sends notifications to other modules.
      Overrides:
      updatePamData in class PamDataBlock<OfflineEventDataUnit>
    • getDataSelectCreator

      public DataSelectorCreator getDataSelectCreator()
      Overrides:
      getDataSelectCreator in class PamDataBlock<OfflineEventDataUnit>
      Returns:
      an object that can create data selectors to sub select data from within this type of data block.
    • getCrossReferenceInformation

      public CrossReference getCrossReferenceInformation()
      Description copied from class: PamDataBlock
      Get 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:
      getCrossReferenceInformation in class PamDataBlock<OfflineEventDataUnit>
      Returns:
      null or cross reference information.
    • getDurationRange

      public double[] getDurationRange()
      Description copied from class: PamDataBlock
      Get 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:
      getDurationRange in class PamDataBlock<OfflineEventDataUnit>
      Returns:
      duration range in seconds of sounds this detector can sensibly detect
    • canSuperDetection

      public boolean canSuperDetection(PamDataBlock subDataBlock)
      Description copied from class: SuperDetDataBlock
      Return 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:
      canSuperDetection in class SuperDetDataBlock<OfflineEventDataUnit,PamDataUnit>
      Parameters:
      subDataBlock - Sub detection data block
      Returns:
      true if this data can hold those sub data.
    • getDatablockSpeciesManager

      public DataBlockSpeciesManager<OfflineEventDataUnit> getDatablockSpeciesManager()
      Description copied from class: PamDataBlock
      Get 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:
      getDatablockSpeciesManager in class PamDataBlock<OfflineEventDataUnit>
      Returns:
      Types of species information available within this datablock.
    • getTethysDataProvider

      public TethysDataProvider getTethysDataProvider(TethysControl tethysControl)
      Description copied from class: PamDataBlock
      Gets a data provider for Tethys. These will probably need to be bespoke, but for now will autogenerate based on the SQLLogging information.
      Overrides:
      getTethysDataProvider in class PamDataBlock<OfflineEventDataUnit>
      Returns:
      the tethysDataProvider
    • getDataAutomationInfo

      public DataAutomationInfo getDataAutomationInfo()
      Description copied from class: PamDataBlock
      Get the level of automation employed by the generation of these data. Should ideally be completed for everything providing data to Tethys.
      Overrides:
      getDataAutomationInfo in class PamDataBlock<OfflineEventDataUnit>
      Returns:
      level of automation for this data block.
    • getLocalisationAlgorithm

      public LocalisationAlgorithm getLocalisationAlgorithm()
      Description copied from class: PamDataBlock
      Find localisation algorithm for this data. This may be within the owning module, or a downstream algorithm.
      Overrides:
      getLocalisationAlgorithm in class PamDataBlock<OfflineEventDataUnit>
      Returns:
      first found localisation algorithm or null;