public class NIDAQProcess extends DaqSystem implements PamSettings
PARAMETER_FIXED, PARAMETER_UNKNOWN, STREAM_CLOSED, STREAM_ENDED, STREAM_OPEN, STREAM_PAUSED, STREAM_RUNNING
Constructor and Description |
---|
NIDAQProcess(AcquisitionControl daqControl) |
Modifier and Type | Method and Description |
---|---|
boolean |
canPlayBack(float sampleRate) |
void |
daqHasEnded()
Called after DAQ has stopped - for whatever reason.
|
boolean |
dialogGetParams()
Called by AcquisitionDialog.GetParams so that parameters can be extracted from the dialog
component.
|
void |
dialogSetParams()
Called by AcquisitionDialog.SetParams so that the dialog componenet can update it's
fields
|
void |
enableMasterDevice() |
boolean |
fillXMLParameters(org.w3c.dom.Document doc,
org.w3c.dom.Element paramsEl)
DAQ system specific XML parameters for Pambuoy.
|
void |
fullBuffer(int iChan,
double[] data)
Get's called back from the C side.
|
int |
getChannels() |
ChannelListPanel |
getDaqSpecificChannelListPanel(AcquisitionDialog acquisitionDialog)
GEt a channel list panel (invented for NI cards which have many more options)
|
javax.swing.JPanel |
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.
|
int |
getDataUnitSamples() |
NIDeviceInfo |
getDeviceInfo(int iDevice) |
java.lang.String |
getDeviceName()
Gets a name for the acquisition device (may just be a number
but need to generalise).
|
int |
getMaxChannels() |
int |
getMaxSampleRate() |
NIChannelListPanel |
getNiChannelListPanel() |
Nidaq |
getNiDaq() |
java.util.ArrayList<NIDeviceInfo> |
getNiDevices() |
NIDaqParams |
getNiParameters() |
double |
getPeak2PeakVoltage(int swChannel) |
PlaybackSystem |
getPlaybackSystem(PlaybackControl playbackControl,
DaqSystem daqSystem)
Gets a playback system for playing sound back out through headphones / speakers, etc.
|
int |
getSampleRate() |
java.io.Serializable |
getSettingsReference() |
long |
getSettingsVersion() |
java.lang.String |
getSystemName() |
java.lang.String |
getSystemType() |
java.lang.String |
getUnitName() |
java.lang.String |
getUnitType() |
boolean |
isRealTime() |
boolean |
prepareSystem(AcquisitionControl daqControl)
Prepare the DaqSystem.
|
boolean |
restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) |
void |
setMasterDevice(int iDevice) |
boolean |
startSystem(AcquisitionControl daqControl)
Start the DaqSystem.
|
void |
stopSystem(AcquisitionControl daqControl)
Stop the DaqSystem.
|
boolean |
supportsChannelLists() |
void |
useSettings() |
areSampleSettingsOk, getChannelGain, getInputChannelMap, getSampleBits, getStatusBarComponent, getStreamStatus, setSelected, setStreamStatus, showSampleSettingsDialog
public NIDAQProcess(AcquisitionControl daqControl)
public boolean prepareSystem(AcquisitionControl daqControl)
DaqSystem
Usually this is the time for opening files, preparing data buffers, etc.
prepareSystem
in class DaqSystem
daqControl
- AcquisitionControl unit.public int getDataUnitSamples()
getDataUnitSamples
in class DaqSystem
public boolean startSystem(AcquisitionControl daqControl)
DaqSystem
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)
startSystem
in class DaqSystem
daqControl
- AcquisitionControl unit.public void stopSystem(AcquisitionControl daqControl)
DaqSystem
stopSystem
in class DaqSystem
public ChannelListPanel getDaqSpecificChannelListPanel(AcquisitionDialog acquisitionDialog)
DaqSystem
getDaqSpecificChannelListPanel
in class DaqSystem
acquisitionDialog
- reference to main acquisition dialogpublic javax.swing.JPanel getDaqSpecificDialogComponent(AcquisitionDialog acquisitionDialog)
DaqSystem
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.
getDaqSpecificDialogComponent
in class DaqSystem
acquisitionDialog
- the AcquisitionDialog this component will be added topublic NIDaqParams getNiParameters()
public void dialogSetParams()
DaqSystem
dialogSetParams
in class DaqSystem
public NIDeviceInfo getDeviceInfo(int iDevice)
public boolean dialogGetParams()
DaqSystem
dialogGetParams
in class DaqSystem
public java.lang.String getSystemType()
getSystemType
in class DaqSystem
Calling functions should be able to handle 'null'
public java.lang.String getSystemName()
getSystemName
in class DaqSystem
public boolean canPlayBack(float sampleRate)
canPlayBack
in class DaqSystem
public PlaybackSystem getPlaybackSystem(PlaybackControl playbackControl, DaqSystem 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
getPlaybackSystem
in class DaqSystem
PlaybackSystem
,
FilePlayback
public int getMaxChannels()
getMaxChannels
in class DaqSystem
public int getMaxSampleRate()
getMaxSampleRate
in class DaqSystem
public boolean isRealTime()
isRealTime
in class DaqSystem
public int getChannels()
public int getSampleRate()
public double getPeak2PeakVoltage(int swChannel)
getPeak2PeakVoltage
in class DaqSystem
public java.io.Serializable getSettingsReference()
getSettingsReference
in interface PamSettings
public long getSettingsVersion()
getSettingsVersion
in interface PamSettings
public java.lang.String getUnitName()
getUnitName
in interface PamSettings
public java.lang.String getUnitType()
getUnitType
in interface PamSettings
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
restoreSettings
in interface PamSettings
public void useSettings()
public void enableMasterDevice()
public void setMasterDevice(int iDevice)
public void fullBuffer(int iChan, double[] data)
We also need to swap threads at this point, so add the new data to a list that some other process will be emptying on a timer.
iChan
- channel numberdata
- data array.public void daqHasEnded()
DaqSystem
daqHasEnded
in class DaqSystem
public boolean supportsChannelLists()
supportsChannelLists
in class DaqSystem
public java.util.ArrayList<NIDeviceInfo> getNiDevices()
public java.lang.String getDeviceName()
DaqSystem
getDeviceName
in class DaqSystem
public Nidaq getNiDaq()
public boolean fillXMLParameters(org.w3c.dom.Document doc, org.w3c.dom.Element paramsEl)
DaqSystem
fillXMLParameters
in class DaqSystem
doc
- XML documentparamsEl
- XML element.public NIChannelListPanel getNiChannelListPanel()