Class SmruDaqSystem
- All Implemented Interfaces:
 PamSettings,SettingsNameProvider
- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected SmruDaqParametersstatic final intFields inherited from class Acquisition.DaqSystem
PARAMETER_FIXED, PARAMETER_UNKNOWN, STREAM_CLOSED, STREAM_ENDED, STREAM_OPEN, STREAM_PAUSED, STREAM_RUNNING - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionbooleancanPlayBack(float sampleRate) voidCalled after DAQ has stopped - for whatever reason.booleanCalled by AcquisitionDialog.GetParams so that parameters can be extracted from the dialog component.voidCalled by AcquisitionDialog.SetParams so that the dialog componenet can update it's fieldsdoublegetChannelGain(int channel) Included so that can add additional channel specific gain values for SMRU daq cardgetDaqSpecificDialogComponent(AcquisitionDialog acquisitionDialog) The AcquisitionDialog has been designed to that each data source type can plug in it's own panel of device specific controls.intGets a name for the acquisition device (may just be a number but need to generalise).intgetLED(int cardId, int led) intintdoublegetPeak2PeakVoltage(int swChannel) getPlaybackSystem(PlaybackControl playbackControl, DaqSystem daqSystem) Gets a playback system for playing sound back out through headphones / speakers, etc.static shortgetSample(byte[] buffer, int position) longbooleanbooleanprepareSystem(AcquisitionControl daqControl) Prepare the DaqSystem.booleanrestoreSettings(PamControlledUnitSettings pamControlledUnitSettings) voidsetSelected(boolean select) Tell a DAQ system it's been selected or deselected.booleanstartSystem(AcquisitionControl daqControl) Start the DaqSystem.voidstopSystem(AcquisitionControl daqControl) Stop the DaqSystem.protected voidterminalPrint(String str, int verboseLevel) Wrapper round modules terminalPrint.inttoggleLED(int cardId, int led) Methods inherited from class Acquisition.DaqSystem
areSampleSettingsOk, getDaqSpecificChannelListNode, getDaqSpecificChannelListPanel, getDAQSpecificPane, getInputChannelMap, getSampleBits, getStallCheckSeconds, getStartButtonToolTip, getStatusBarComponent, getStreamStatus, notifyModelChanged, setStreamStatus, showSampleSettingsDialog, startButtonXtraActions, supportsChannelLists 
- 
Field Details
- 
smruDaqParameters
 - 
newCardName
- See Also:
 
 - 
oldCardName
- See Also:
 
 - 
VERBOSELEVEL
public static final int VERBOSELEVEL- See Also:
 
 
 - 
 - 
Constructor Details
- 
SmruDaqSystem
- Parameters:
 daqControl-
 
 - 
 - 
Method Details
- 
setSelected
public void setSelected(boolean select) Description copied from class:DaqSystemTell a DAQ system it's been selected or deselected.- Overrides:
 setSelectedin classDaqSystem- Parameters:
 select-
 - 
terminalPrint
Wrapper round modules terminalPrint.- Parameters:
 str-verboseLevel-
 - 
getJNILibInfo
 - 
canPlayBack
public boolean canPlayBack(float sampleRate) - Specified by:
 canPlayBackin 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 ?
 
 - 
dialogGetParams
public boolean dialogGetParams()Description copied from class:DaqSystemCalled 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.- Specified by:
 dialogGetParamsin classDaqSystem- 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:DaqSystemCalled by AcquisitionDialog.SetParams so that the dialog componenet can update it's fields- Specified by:
 dialogSetParamsin classDaqSystem
 - 
getDaqSpecificDialogComponent
Description copied from class:DaqSystemThe AcquisitionDialog has been designed to that each data source type can plug in it's own panel of device specific controls. These could be things like a file name, gain settings, channel lists, whatever is available for the specific deviceThe AcquisitionDialog will handle placing this component on the dialog when a particular DaqSystem is selected. The component will be placed between a drop down list of available DaqSystem's and a section of the dialog showing the sample rate and number of channels.
- Specified by:
 getDaqSpecificDialogComponentin classDaqSystem- Parameters:
 acquisitionDialog- the AcquisitionDialog this component will be added to- Returns:
 - dialog component specific to this DAQ device
 
 - 
getDataUnitSamples
public int getDataUnitSamples()- Specified by:
 getDataUnitSamplesin classDaqSystem- Returns:
 - the number of samples expected in each data unit.
 
 - 
getDeviceName
Description copied from class:DaqSystemGets a name for the acquisition device (may just be a number but need to generalise).- Specified by:
 getDeviceNamein classDaqSystem- Returns:
 
 - 
getMaxChannels
public int getMaxChannels()- Specified by:
 getMaxChannelsin classDaqSystem- Returns:
 - the maximum number of channels supporrted by the selected device, or PARAMETER_UNKNOWN
 
 - 
getMaxSampleRate
public int getMaxSampleRate()- Specified by:
 getMaxSampleRatein classDaqSystem- Returns:
 - the maximum sample rate supporrted by the selected device, or PARAMETER_UNKNOWN
 
 - 
getPeak2PeakVoltage
public double getPeak2PeakVoltage(int swChannel) - Specified by:
 getPeak2PeakVoltagein classDaqSystem- Returns:
 - peak to peak voltage for the device or PARAMETER_UNKNOWN
 
 - 
getSystemName
- Specified by:
 getSystemNamein classDaqSystem- Returns:
 - A string describing the data source, e.g. the sound card name, file name, udp port, etc.
 
 - 
getSystemType
- Specified by:
 getSystemTypein classDaqSystem- Returns:
 - The 'type' of data source for display in the Data Source dialog
 
Calling functions should be able to handle 'null'
 
 - 
isRealTime
public boolean isRealTime()- Specified by:
 isRealTimein 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.
 
 - 
prepareSystem
Description copied from class:DaqSystemPrepare the DaqSystem.Usually this is the time for opening files, preparing data buffers, etc.
- Specified by:
 prepareSystemin classDaqSystem- Parameters:
 daqControl- AcquisitionControl unit.- Returns:
 - true if OK, false otherwise.
 
 - 
toggleLED
public int toggleLED(int cardId, int led)  - 
getLED
public int getLED(int cardId, int led)  - 
startSystem
Description copied from class:DaqSystemStart 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)
- Specified by:
 startSystemin classDaqSystem- Parameters:
 daqControl- AcquisitionControl unit.- Returns:
 - true if OK, false otherwise
 
 - 
getSample
public static short getSample(byte[] buffer, int position)  - 
getChannelGain
public double getChannelGain(int channel) Description copied from class:DaqSystemIncluded so that can add additional channel specific gain values for SMRU daq card- Overrides:
 getChannelGainin classDaqSystem- Parameters:
 channel- channel number- Returns:
 - channel specific gain
 
 - 
stopSystem
Description copied from class:DaqSystemStop the DaqSystem.- Specified by:
 stopSystemin classDaqSystem- Parameters:
 daqControl-
 - 
daqHasEnded
public void daqHasEnded()Description copied from class:DaqSystemCalled 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:
 daqHasEndedin classDaqSystem
 - 
getSettingsReference
- Specified by:
 getSettingsReferencein interfacePamSettings- Returns:
 - The serialisable object that will be stored
 
 - 
getSettingsVersion
public long getSettingsVersion()- Specified by:
 getSettingsVersionin interfacePamSettings- Returns:
 - An integer version number for the settings
 
 - 
getUnitName
- Specified by:
 getUnitNamein interfaceSettingsNameProvider- Returns:
 - A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
 
 - 
getUnitType
- Specified by:
 getUnitTypein interfacePamSettings- Returns:
 - A Name specific to the type, e.g. Click detector
 
 - 
restoreSettings
- Specified by:
 restoreSettingsin interfacePamSettings- Parameters:
 pamControlledUnitSettings-- 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:DaqSystemGets 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:
 getPlaybackSystemin classDaqSystem- Parameters:
 playbackControl-daqSystem-- Returns:
 - null if no playback available or a PlaybackSystem object.
 - See Also:
 
 - 
getSmruDaqJNI
- Returns:
 - the smruDaqJNI
 
 - 
getSmruDaqParameters
 
 -