Package Acquisition
Class icListenSystem
java.lang.Object
Acquisition.DaqSystem
Acquisition.icListenSystem
- All Implemented Interfaces:
PamSettings
,SettingsNameProvider
A data acquisition system that uses an Ocean Sonics icListen to acquire the data
to be streamed to and used by PAMGUARD.
- Author:
- John Bowdridge
-
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 TypeMethodDescriptionboolean
canPlayBack
(float sampleRate) void
Called after DAQ has stopped - for whatever reason.boolean
Function gets called when the OK of the settings panel is pressed.void
Sets the fields of the data acquisition when the settings are brought upgetDaqSpecificDialogComponent
(AcquisitionDialog acquisitionDialog) Get the data acquisition dialog box component of this systemint
Gets a name for the acquisition device (may just be a number but need to generalise).int
int
double
getPeak2PeakVoltage
(int swChannel) getPlaybackSystem
(PlaybackControl playbackControl, DaqSystem daqSystem) Gets a playback system for playing sound back out through headphones / speakers, etc.long
Returns the name of the current systemReturns the type of the systemboolean
boolean
prepareSystem
(AcquisitionControl daqControl) Prepares the system to Start its data acquisition An icListen should be connected at this point This function sets up the proper data references and updates the acquisition control's fields with the proper valuesboolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) boolean
startSystem
(AcquisitionControl daqControl) Start the data acquisition system by telling the icListen to start streaming data then start separate threads to handle capturing data and processing it as well as sets up a queue to pass messages between these threadsvoid
stopSystem
(AcquisitionControl daqControl) Stop the data acquisition Request the capture thread to stop and wait for it to finish up then close/free all the nesc.Methods inherited from class Acquisition.DaqSystem
areSampleSettingsOk, getChannelGain, getDaqSpecificChannelListNode, getDaqSpecificChannelListPanel, getDAQSpecificPane, getInputChannelMap, getSampleBits, getStallCheckSeconds, getStatusBarComponent, getStreamStatus, notifyModelChanged, setSelected, setStreamStatus, showSampleSettingsDialog, supportsChannelLists
-
Constructor Details
-
icListenSystem
public icListenSystem()Constructor registers settings
-
-
Method Details
-
getSystemType
Returns the type of the system- Specified by:
getSystemType
in classDaqSystem
- Returns:
- The 'type' of data source for display in the Data Source dialog
Calling functions should be able to handle 'null'
-
getSystemName
Returns the name of the current system- Specified by:
getSystemName
in classDaqSystem
- Returns:
- A string describing the data source, e.g. the sound card name, file name, udp port, etc.
-
getDaqSpecificDialogComponent
Get the data acquisition dialog box component of this system- Specified by:
getDaqSpecificDialogComponent
in classDaqSystem
- Parameters:
acquisitionDialog
- the AcquisitionDialog this component will be added to- Returns:
- dialog component specific to this DAQ device
-
dialogSetParams
public void dialogSetParams()Sets the fields of the data acquisition when the settings are brought up- Specified by:
dialogSetParams
in classDaqSystem
-
dialogGetParams
public boolean dialogGetParams()Function gets called when the OK of the settings panel is pressed. It saves all the settings entered by the user Make sure the IP Address is set to the latest address entered by the user, Get the Time out specified and get the sample rate using the bandwidth- Specified by:
dialogGetParams
in classDaqSystem
- Returns:
- true if the parameters and selections are OK. If false is returned the Acquisition dialog will not respond to its Ok button.
-
getMaxSampleRate
public int getMaxSampleRate()- Specified by:
getMaxSampleRate
in classDaqSystem
- Returns:
- the maximum sample rate supporrted by the selected device, or PARAMETER_UNKNOWN
-
getMaxChannels
public int getMaxChannels()- Specified by:
getMaxChannels
in classDaqSystem
- Returns:
- the maximum number of channels supporrted by the selected device, or PARAMETER_UNKNOWN
-
getPeak2PeakVoltage
public double getPeak2PeakVoltage(int swChannel) - Specified by:
getPeak2PeakVoltage
in classDaqSystem
- Returns:
- peak to peak voltage for the device or PARAMETER_UNKNOWN
-
prepareSystem
Prepares the system to Start its data acquisition An icListen should be connected at this point This function sets up the proper data references and updates the acquisition control's fields with the proper values- Specified by:
prepareSystem
in classDaqSystem
- Parameters:
daqControl
- AcquisitionControl unit.- Returns:
- true if OK, false otherwise.
-
startSystem
Start the data acquisition system by telling the icListen to start streaming data then start separate threads to handle capturing data and processing it as well as sets up a queue to pass messages between these threads- Specified by:
startSystem
in classDaqSystem
- Parameters:
daqControl
- AcquisitionControl unit.- Returns:
- true if OK, false otherwise
-
stopSystem
Stop the data acquisition Request the capture thread to stop and wait for it to finish up then close/free all the nesc. objects- Specified by:
stopSystem
in classDaqSystem
-
isRealTime
public boolean isRealTime()- Specified by:
isRealTime
in classDaqSystem
- Returns:
- true for real time systems (e.g. sound cards, NI cards, wav files which are being played back over speakers. false for reading files which are to be processed as fast as possible with no playback.
-
canPlayBack
public boolean canPlayBack(float sampleRate) - Specified by:
canPlayBack
in classDaqSystem
- Returns:
- true if the system can also play back sound - likely to be true for sound cards and ASIO, and some NI cards, false for wav files. Simulator ?
-
getDataUnitSamples
public int getDataUnitSamples()- Specified by:
getDataUnitSamples
in classDaqSystem
- Returns:
- the number of samples expected in each data unit.
-
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.- Specified by:
daqHasEnded
in classDaqSystem
-
getDeviceName
Description copied from class:DaqSystem
Gets a name for the acquisition device (may just be a number but need to generalise).- Specified by:
getDeviceName
in classDaqSystem
- Returns:
-
getUnitName
- Specified by:
getUnitName
in interfaceSettingsNameProvider
- 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
- Returns:
- A Name specific to the type, e.g. Click detector
-
getSettingsReference
- Specified by:
getSettingsReference
in interfacePamSettings
- Returns:
- The serialisable object that will be stored
-
getSettingsVersion
public long getSettingsVersion()- Specified by:
getSettingsVersion
in interfacePamSettings
- Returns:
- An integer version number for the settings
-
restoreSettings
- Specified by:
restoreSettings
in interfacePamSettings
- 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
-
getPlaybackSystem
Description copied from class:DaqSystem
Gets a playback system for playing sound back out through headphones / speakers, etc.Generally, anything acquiring data in real time should play the sound back through itself so that clocks are correctly synchronised. i.e. A sound card input will go to the same sound card output, etc. At a later date, we may try to support output through different devices at different speeds - but this will be problematic !
If data are being read from a file, then playback is through a sound card which sits in a stand alone implementation of PlaybackSystem
- Overrides:
getPlaybackSystem
in classDaqSystem
- Returns:
- null if no playback available or a PlaybackSystem object.
- See Also:
-