Package Acquisition

Class FolderInputSystem

All Implemented Interfaces:
FileDateObserver, ActionListener, EventListener, DataInputStore, PamSettings, SettingsNameProvider
Direct Known Subclasses:
DCL5System, RonaInputSystem

public class FolderInputSystem extends FileInputSystem implements PamSettings, DataInputStore
Read multiple files in sequence. Options exist to either pause and restart analysis after each file, or to merge files into one long continuous sound stream.
Author:
Doug Gillespie
  • Field Details

  • Constructor Details

  • Method Details

    • runFileAnalysis

      public boolean runFileAnalysis()
      Overrides:
      runFileAnalysis in class FileInputSystem
    • prepareInputFile

      public boolean prepareInputFile()
      Description copied from class: FileInputSystem
      Open the audio stream for processing.
      Overrides:
      prepareInputFile in class FileInputSystem
      Returns:
      true if audio stream opened correctly.
    • checkFileHeaders

      public void checkFileHeaders()
      Checks file length matched actual file data length and repairs if necessary.
    • setSelected

      public void setSelected(boolean select)
      Description copied from class: DaqSystem
      Tell a DAQ system it's been selected or deselected.
      Overrides:
      setSelected in class FileInputSystem
    • makeSelFileList

      public int makeSelFileList()
      Make a list of wav files within a folder. In some circumstances this can be a list of actual files in a folder. Also needs to handle the possibility of it using a globally set folder name.
      Returns:
      flag to indicate...nothing?
    • makeSelFileList

      public int makeSelFileList(String[] rootList)
      Make a list of wav files within a folder.
      Parameters:
      rootList -
      Returns:
    • getFolderFileFilter

      public PamFileFilter getFolderFileFilter()
    • getCurrentFolder

      public String getCurrentFolder()
    • interpretNewFile

      public void interpretNewFile(String newFile)
      Description copied from class: FileInputSystem
      Called when a new file or folder is selected.
      Overrides:
      interpretNewFile in class FileInputSystem
    • newFileList

      public void newFileList(FileListData<WavFileType> fileListData)
      Callback when the file list has completed it's background task.
      Parameters:
      fileListData -
    • setFileOptionPanel

      public void setFileOptionPanel()
      Set bespoke options for certain file types.
    • setFileDateText

      public void setFileDateText()
      Show the date of the first file in the dialog.
    • getSystemType

      public String getSystemType()
      Overrides:
      getSystemType in class FileInputSystem
      Returns:
      The 'type' of data source for display in the Data Source dialog

      Calling functions should be able to handle 'null'

    • getUnitName

      public String getUnitName()
      Specified by:
      getUnitName in interface SettingsNameProvider
      Overrides:
      getUnitName in class FileInputSystem
      Returns:
      A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
    • getUnitType

      public String getUnitType()
      Specified by:
      getUnitType in interface PamSettings
      Overrides:
      getUnitType in class FileInputSystem
      Returns:
      A Name specific to the type, e.g. Click detector
    • getCurrentFile

      public File getCurrentFile()
      Overrides:
      getCurrentFile in class FileInputSystem
    • daqHasEnded

      public void daqHasEnded()
      Description copied from class: DaqSystem
      Called after DAQ has stopped - for whatever reason. Nost DAQ systems will not need to do anything here, but they could potentially clean up memory The motivation for putting this here now is for the folder analysis system so that it can start analysing the next file.
      Overrides:
      daqHasEnded in class FileInputSystem
    • getStatusBarComponent

      public Component getStatusBarComponent()
      Overrides:
      getStatusBarComponent in class FileInputSystem
    • getEta

      public long getEta()
      Overrides:
      getEta in class FileInputSystem
    • getSettingsReference

      public Serializable getSettingsReference()
      Specified by:
      getSettingsReference in interface PamSettings
      Overrides:
      getSettingsReference in class FileInputSystem
      Returns:
      The serialisable object that will be stored
    • getSettingsVersion

      public long getSettingsVersion()
      Specified by:
      getSettingsVersion in interface PamSettings
      Overrides:
      getSettingsVersion in class FileInputSystem
      Returns:
      An integer version number for the settings
    • dialogGetParams

      public boolean dialogGetParams()
      Description copied from class: DaqSystem
      Called by AcquisitionDialog.GetParams so that parameters can be extracted from the dialog component. The DaqSystem should also implement PamSettings and handle storage of parameters between runs.
      Overrides:
      dialogGetParams in class FileInputSystem
      Returns:
      true if the parameters and selections are OK. If false is returned the Acquisition dialog will not respond to its Ok button.
    • dialogSetParams

      public void dialogSetParams()
      Description copied from class: DaqSystem
      Called by AcquisitionDialog.SetParams so that the dialog componenet can update it's fields
      Overrides:
      dialogSetParams in class FileInputSystem
    • restoreSettings

      public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
      Specified by:
      restoreSettings in interface PamSettings
      Overrides:
      restoreSettings in class FileInputSystem
      Returns:
      true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
    • getFolderInputParameters

      public FolderInputParameters getFolderInputParameters()
    • setFolderInputParameters

      public void setFolderInputParameters(FolderInputParameters folderInputParameters)
    • startSystem

      public boolean startSystem(AcquisitionControl daqControl)
      Description copied from class: DaqSystem
      Start the DaqSystem. This is called immediately after PrepareSystem

      Most things should be ready from the call to PrepareSystem. In StartSystem you will generally need to start a thread which will read in the data and place PamDataUnits in a buffer from where they are read by the main thred and passed on to other Pam modules for processing (see SoundCardSystem for an example)

      Overrides:
      startSystem in class FileInputSystem
      Parameters:
      daqControl - AcquisitionControl unit.
      Returns:
      true if OK, false otherwise
    • getDeviceName

      public String getDeviceName()
      Description copied from class: DaqSystem
      Gets a name for the acquisition device (may just be a number but need to generalise).
      Overrides:
      getDeviceName in class FileInputSystem
      Returns:
    • getAudioFileFilter

      public PamFileFilter getAudioFileFilter()
    • setAudioFileFilter

      public void setAudioFileFilter(PamFileFilter audioFileFilter)
    • getDAQSpecificPane

      public DAQSettingsPane getDAQSpecificPane(AcquisitionPaneFX acquisitionPaneFX)
      JavaFX bits
      Overrides:
      getDAQSpecificPane in class DaqSystem
      Returns:
      dialog component specific to this DAQ device
    • dialogFXSetParams

      public void dialogFXSetParams()
      Called by AcquisitionDialog.SetParams so that the dialog node can update it's fields.
    • getStoreInfo

      public InputStoreInfo getStoreInfo(boolean detail)
      Description copied from interface: DataInputStore
      Get information about the input store (e.g. start times of all files).
      Specified by:
      getStoreInfo in interface DataInputStore
      Overrides:
      getStoreInfo in class FileInputSystem
      Returns:
      information about data input.
    • setAnalysisStartTime

      public boolean setAnalysisStartTime(long startTime)
      Description copied from interface: DataInputStore
      Set an analysis start time. This might get called just before processing starts, in which case
      Specified by:
      setAnalysisStartTime in interface DataInputStore
      Overrides:
      setAnalysisStartTime in class FileInputSystem
      Returns:
      ok if no problems.
    • getBatchStatus

      public String getBatchStatus()
      Get a status update for batch processing.
      Specified by:
      getBatchStatus in interface DataInputStore
      Overrides:
      getBatchStatus in class FileInputSystem
      Returns: