Package Acquisition
Class FolderInputSystem
java.lang.Object
Acquisition.DaqSystem
Acquisition.FileInputSystem
Acquisition.FolderInputSystem
- All Implemented Interfaces:
FileDateObserver
,ActionListener
,EventListener
,DataInputStore
,PamSettings
,SettingsNameProvider
- Direct Known Subclasses:
DCL5System
,RonaInputSystem
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
-
Nested Class Summary
Nested classes/interfaces inherited from class Acquisition.FileInputSystem
FileInputSystem.CollectorThread
-
Field Summary
Fields inherited from class Acquisition.DaqSystem
PARAMETER_FIXED, PARAMETER_UNKNOWN, STREAM_CLOSED, STREAM_ENDED, STREAM_OPEN, STREAM_PAUSED, STREAM_RUNNING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks file length matched actual file data length and repairs if necessary.void
Called after DAQ has stopped - for whatever reason.void
Called by AcquisitionDialog.SetParams so that the dialog node can update it's fields.boolean
Called by AcquisitionDialog.GetParams so that parameters can be extracted from the dialog component.void
Called by AcquisitionDialog.SetParams so that the dialog componenet can update it's fieldsGet a status update for batch processing.getDAQSpecificPane
(AcquisitionPaneFX acquisitionPaneFX) JavaFX bitsGets a name for the acquisition device (may just be a number but need to generalise).long
getEta()
long
getStoreInfo
(boolean detail) Get information about the input store (e.g.void
interpretNewFile
(String newFile) Called when a new file or folder is selected.int
Make a list of wav files within a folder.int
makeSelFileList
(String[] rootList) Make a list of wav files within a folder.void
newFileList
(FileListData<WavFileType> fileListData) Callback when the file list has completed it's background task.boolean
Open the audio stream for processing.boolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) boolean
boolean
setAnalysisStartTime
(long startTime) Set an analysis start time.void
setAudioFileFilter
(PamFileFilter audioFileFilter) void
Show the date of the first file in the dialog.void
Set bespoke options for certain file types.void
setFolderInputParameters
(FolderInputParameters folderInputParameters) void
setSelected
(boolean select) Tell a DAQ system it's been selected or deselected.boolean
startSystem
(AcquisitionControl daqControl) Start the DaqSystem.Methods inherited from class Acquisition.FileInputSystem
actionPerformed, bytesToSamples, canPlayBack, fileDateChange, getAquisitionControl, getChannels, getDaqSpecificDialogComponent, getDataUnitSamples, getFileStartTime, getFirstFile, getMaxChannels, getMaxSampleRate, getPeak2PeakVoltage, getSample, getSampleBits, getSampleRate, getSelectedFileTypes, getSkipStartFileTime, getSystemName, isRealTime, prepareSystem, sayEta, sayEta, setNewFile, setSelectedFileTypes, setStreamStatus, stopSystem, systemHasStopped
Methods inherited from class Acquisition.DaqSystem
areSampleSettingsOk, getChannelGain, getDaqSpecificChannelListNode, getDaqSpecificChannelListPanel, getInputChannelMap, getPlaybackSystem, getStallCheckSeconds, getStreamStatus, notifyModelChanged, showSampleSettingsDialog, supportsChannelLists
-
Field Details
-
daqType
- See Also:
-
sysType
- See Also:
-
GlobalWavFolderArg
- See Also:
-
-
Constructor Details
-
FolderInputSystem
-
-
Method Details
-
runFileAnalysis
public boolean runFileAnalysis()- Overrides:
runFileAnalysis
in classFileInputSystem
-
prepareInputFile
public boolean prepareInputFile()Description copied from class:FileInputSystem
Open the audio stream for processing.- Overrides:
prepareInputFile
in classFileInputSystem
- 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 classFileInputSystem
-
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
Make a list of wav files within a folder.- Parameters:
rootList
-- Returns:
-
getFolderFileFilter
-
getCurrentFolder
-
interpretNewFile
Description copied from class:FileInputSystem
Called when a new file or folder is selected.- Overrides:
interpretNewFile
in classFileInputSystem
-
newFileList
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
- Overrides:
getSystemType
in classFileInputSystem
- Returns:
- The 'type' of data source for display in the Data Source dialog
Calling functions should be able to handle 'null'
-
getUnitName
- Specified by:
getUnitName
in interfaceSettingsNameProvider
- Overrides:
getUnitName
in classFileInputSystem
- Returns:
- A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
-
getUnitType
- Specified by:
getUnitType
in interfacePamSettings
- Overrides:
getUnitType
in classFileInputSystem
- Returns:
- A Name specific to the type, e.g. Click detector
-
getCurrentFile
- Overrides:
getCurrentFile
in classFileInputSystem
-
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 classFileInputSystem
-
getStatusBarComponent
- Overrides:
getStatusBarComponent
in classFileInputSystem
-
getEta
public long getEta()- Overrides:
getEta
in classFileInputSystem
-
getSettingsReference
- Specified by:
getSettingsReference
in interfacePamSettings
- Overrides:
getSettingsReference
in classFileInputSystem
- Returns:
- The serialisable object that will be stored
-
getSettingsVersion
public long getSettingsVersion()- Specified by:
getSettingsVersion
in interfacePamSettings
- Overrides:
getSettingsVersion
in classFileInputSystem
- 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 classFileInputSystem
- 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 classFileInputSystem
-
restoreSettings
- Specified by:
restoreSettings
in interfacePamSettings
- Overrides:
restoreSettings
in classFileInputSystem
- 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
-
setFolderInputParameters
-
startSystem
Description copied from class:DaqSystem
Start the DaqSystem. This is called immediately after PrepareSystemMost 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 classFileInputSystem
- Parameters:
daqControl
- AcquisitionControl unit.- Returns:
- true if OK, false otherwise
-
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 classFileInputSystem
- Returns:
-
getAudioFileFilter
-
setAudioFileFilter
-
getDAQSpecificPane
JavaFX bits- Overrides:
getDAQSpecificPane
in classDaqSystem
- 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
Description copied from interface:DataInputStore
Get information about the input store (e.g. start times of all files).- Specified by:
getStoreInfo
in interfaceDataInputStore
- Overrides:
getStoreInfo
in classFileInputSystem
- 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 interfaceDataInputStore
- Overrides:
setAnalysisStartTime
in classFileInputSystem
- Returns:
- ok if no problems.
-
getBatchStatus
Get a status update for batch processing.- Specified by:
getBatchStatus
in interfaceDataInputStore
- Overrides:
getBatchStatus
in classFileInputSystem
- Returns:
-