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 Link icon

  • Constructor Details Link icon

  • Method Details Link icon

    • runFileAnalysis Link icon

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

      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 Link icon

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

      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 Link icon

      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 Link icon

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

      public PamFileFilter getFolderFileFilter()
    • getCurrentFolder Link icon

      public String getCurrentFolder()
    • interpretNewFile Link icon

      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 Link icon

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

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

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

      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 Link icon

      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 Link icon

      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 Link icon

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

      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 Link icon

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

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

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

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

      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 Link icon

      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 Link icon

      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 Link icon

      public FolderInputParameters getFolderInputParameters()
    • setFolderInputParameters Link icon

      public void setFolderInputParameters(FolderInputParameters folderInputParameters)
    • startSystem Link icon

      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 Link icon

      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 Link icon

      public PamFileFilter getAudioFileFilter()
    • setAudioFileFilter Link icon

      public void setAudioFileFilter(PamFileFilter audioFileFilter)
    • getDAQSpecificPane Link icon

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

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

      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 Link icon

      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 Link icon

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