public abstract class DaqSystem
extends java.lang.Object
1. Provides information about the device such as min and max sample rates, number of channelse, etc. 2. Provides a dialog panel with specific options. This automatically gets incorporated into a more general data acquisition panel 3. Provides threads and any other functions necessary to create packets of raw audio data in PamDataUnit's. 4. Each concrete class should, if needed, save it's own setting using the PamSettings package.
Current examples are in SoundCardSystem and FileInputSystem
Modifier and Type | Field and Description |
---|---|
static int |
PARAMETER_FIXED |
static int |
PARAMETER_UNKNOWN |
static int |
STREAM_CLOSED |
static int |
STREAM_ENDED |
static int |
STREAM_OPEN |
static int |
STREAM_PAUSED |
static int |
STREAM_RUNNING |
Constructor and Description |
---|
DaqSystem() |
Modifier and Type | Method and Description |
---|---|
boolean |
areSampleSettingsOk(int numInputsRequested,
float sampleRateRequested) |
abstract boolean |
canPlayBack(float sampleRate) |
abstract void |
daqHasEnded()
Called after DAQ has stopped - for whatever reason.
|
abstract boolean |
dialogGetParams()
Called by AcquisitionDialog.GetParams so that parameters can be extracted from the dialog
component.
|
abstract void |
dialogSetParams()
Called by AcquisitionDialog.SetParams so that the dialog componenet can update it's
fields
|
boolean |
fillXMLParameters(org.w3c.dom.Document doc,
org.w3c.dom.Element paramsEl)
DAQ system specific XML parameters for Pambuoy.
|
double |
getChannelGain(int channel)
Included so that can add additional channel specific gain values for SMRU daq card
|
ChannelListPanel |
getDaqSpecificChannelListPanel(AcquisitionDialog acquisitionDialog)
GEt a channel list panel (invented for NI cards which have many more options)
|
abstract javax.swing.JComponent |
getDaqSpecificDialogComponent(AcquisitionDialog acquisitionDialog)
The AcquisitionDialog has been designed to that each data source type can plug
in it's own panel of device specific controls.
|
abstract int |
getDataUnitSamples() |
abstract java.lang.String |
getDeviceName()
Gets a name for the acquisition device (may just be a number
but need to generalise).
|
int |
getInputChannelMap(AcquisitionParameters acquisitionParameters) |
abstract int |
getMaxChannels() |
abstract int |
getMaxSampleRate() |
abstract double |
getPeak2PeakVoltage(int swChannel) |
PlaybackSystem |
getPlaybackSystem(PlaybackControl playbackControl,
DaqSystem daqSystem)
Gets a playback system for playing sound back out through headphones / speakers, etc.
|
int |
getSampleBits()
Get the number of bits in each sample.
|
java.awt.Component |
getStatusBarComponent() |
int |
getStreamStatus()
Status of the intput stream
|
abstract java.lang.String |
getSystemName() |
abstract java.lang.String |
getSystemType() |
abstract boolean |
isRealTime() |
abstract boolean |
prepareSystem(AcquisitionControl daqControl)
Prepare the DaqSystem.
|
void |
setSelected(boolean select)
Tell a DAQ system it's been selected or deselected.
|
void |
setStreamStatus(int streamStatus) |
void |
showSampleSettingsDialog(AcquisitionDialog acquisitionDialog) |
abstract boolean |
startSystem(AcquisitionControl daqControl)
Start the DaqSystem.
|
abstract void |
stopSystem(AcquisitionControl daqControl)
Stop the DaqSystem.
|
boolean |
supportsChannelLists() |
public static final int PARAMETER_UNKNOWN
public static final int PARAMETER_FIXED
public static final int STREAM_CLOSED
public static final int STREAM_OPEN
public static final int STREAM_RUNNING
public static final int STREAM_PAUSED
public static final int STREAM_ENDED
public abstract java.lang.String getSystemType()
Calling functions should be able to handle 'null'
public abstract java.lang.String getSystemName()
public abstract javax.swing.JComponent getDaqSpecificDialogComponent(AcquisitionDialog acquisitionDialog)
The 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.
acquisitionDialog
- the AcquisitionDialog this component will be added topublic ChannelListPanel getDaqSpecificChannelListPanel(AcquisitionDialog acquisitionDialog)
acquisitionDialog
- reference to main acquisition dialogpublic abstract void dialogSetParams()
public abstract boolean dialogGetParams()
public void setSelected(boolean select)
select
- public abstract int getMaxSampleRate()
public abstract int getMaxChannels()
public abstract double getPeak2PeakVoltage(int swChannel)
public abstract boolean prepareSystem(AcquisitionControl daqControl)
Usually this is the time for opening files, preparing data buffers, etc.
daqControl
- AcquisitionControl unit.public abstract boolean startSystem(AcquisitionControl daqControl)
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)
daqControl
- AcquisitionControl unit.public abstract void stopSystem(AcquisitionControl daqControl)
daqControl
- public abstract boolean isRealTime()
public abstract boolean canPlayBack(float sampleRate)
public abstract int getDataUnitSamples()
public PlaybackSystem getPlaybackSystem(PlaybackControl playbackControl, DaqSystem daqSystem)
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
playbackControl
- daqSystem
- PlaybackSystem
,
FilePlayback
public abstract void daqHasEnded()
public int getStreamStatus()
public void setStreamStatus(int streamStatus)
public boolean areSampleSettingsOk(int numInputsRequested, float sampleRateRequested)
public void showSampleSettingsDialog(AcquisitionDialog acquisitionDialog)
public java.awt.Component getStatusBarComponent()
public boolean supportsChannelLists()
public int getInputChannelMap(AcquisitionParameters acquisitionParameters)
public abstract java.lang.String getDeviceName()
public boolean fillXMLParameters(org.w3c.dom.Document doc, org.w3c.dom.Element paramsEl)
doc
- XML documentparamsEl
- XML element.public double getChannelGain(int channel)
channel
- channel numberpublic int getSampleBits()