|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectAcquisition.DaqSystem
public abstract class DaqSystem
Abstraction to multiple data acquisition devices. This interface performs the following tasks:
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
| Field Summary | |
|---|---|
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
|
private int |
streamStatus
|
| Constructor Summary | |
|---|---|
DaqSystem()
|
|
| Method Summary | |
|---|---|
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 |
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()
Gets a playback system for playing sound back out through headphones / speakers, etc. |
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PARAMETER_UNKNOWN
public static final int PARAMETER_FIXED
private int streamStatus
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
| Constructor Detail |
|---|
public DaqSystem()
| Method Detail |
|---|
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 to
public ChannelListPanel getDaqSpecificChannelListPanel(AcquisitionDialog acquisitionDialog)
acquisitionDialog - reference to main acquisition dialog
public 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()
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 standalone implementation of PlaybackSystem
PlaybackSystem,
FilePlaybackpublic 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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||