public class AcquisitionProcess extends PamProcess
DaqSystem
,
PamRawDataBlock
,
PamDataUnit
Modifier and Type | Method and Description |
---|---|
void |
acquisitionStopped() |
double |
dbMicropascalToSignal(int channel,
double dBMuPascal)
Converts dB in micropascal to ADC counts on a 0 - 1 scale.
|
double[] |
fftAmplitude2dB(double[] fftAmplitude,
int channel,
float sampleRate,
int fftLength,
boolean isSquared)
Convert the amplitude of fft data into a spectrum level measurement in
dB re 1 micropacal / sqrt(Hz) for an array of double values.
|
double |
fftAmplitude2dB(double fftAmplitude,
int channel,
float sampleRate,
int fftLength,
boolean isSquared,
boolean fast)
Convert the amplitude of fft data into a spectrum level measurement in
dB re 1 micropacal / sqrt(Hz).
|
double |
fftBandAmplitude2dB(double fftAmplitude,
int channel,
int fftLength,
boolean isSquared,
boolean fast)
Convert the amplitude of fft data into a level measurement in
dB re 1 micropacal / sqrt(Hz).
|
AcquisitionControl |
getAcquisitionControl() |
double |
getBufferSeconds() |
double |
getMaxBufferSeconds() |
java.util.List<RawDataUnit> |
getNewDataUnits() |
int |
getOfflineData(PamDataBlock dataBlock,
PamObserver endUser,
long startMillis,
long endMillis,
RequestCancellationObject cancellationObject)
Request offline data.
|
double |
getPeak2PeakVoltage(int swChannel)
Some devices may be setting this per channel.
|
PamRawDataBlock |
getRawDataBlock() |
DaqSystem |
getRunningSystem() |
long |
getTotalSamples(int iChannel)
Get the total number of samples acquired by a particular channel.
|
boolean |
needRestart() |
void |
newData(PamObservable o,
PamDataUnit arg) |
void |
pamStart()
Interval between daq checks in milliseconds
|
void |
pamStop()
Stops the process.
|
void |
pamStop(java.lang.String reason) |
void |
prepareFastAmplitudeCalculation(int channel)
Prepares for fast amplitude calculations
|
void |
prepareProcess()
Called for each process before any of them receive the PamStart command
|
double[] |
rawAmplitude2dB(double[] rawAmplitude,
int channel)
Convert a raw amplitude to dB re 1 micropascal based on
calibration information held in the AcquisitionController
for an array of double data
|
double |
rawAmplitude2dB(double rawAmplitude,
int channel,
boolean fast)
Convert a raw amplitude to dB re 1 micropascal based on
calibration information held in the AcquisitionController
|
void |
setNumChannels(int numChannels) |
void |
setNumChannels(int numChannels,
int[] channelList)
Set up channels when using a channel list - note
that hardware channels are no longer passed through the system
so software channels are now used throughout.
|
void |
setSampleRate(float sampleRate,
boolean notify)
New sample rate
|
void |
setupDataBlock()
called when acquisition parameters change.
|
void |
streamClosed() |
void |
streamEnded() |
void |
streamOpen() |
void |
streamPaused() |
absMillisecondsToSamples, absSamplesToMilliseconds, addOutputDataBlock, changedThreading, clearOldData, createAnnotations, destroyProcess, fillXMLElement, flushDataBlockBuffers, getAncestorDataBlock, getAnnotation, getChainPosition, getCpuPercent, getNumAnnotations, getNumOutputDataBlocks, getObserverName, getObserverObject, getOutputDataBlock, getOutputDataBlocks, getPamControlledUnit, getParentDataBlock, getParentProcess, getProcessName, getRawSourceDataBlock, getRequiredDataHistory, getSampleRate, getSourceDataBlock, getSourceProcess, isCanMultiThread, makePamProcess, masterClockUpdate, noteNewSettings, notifyModelChanged, processNewBuoyData, relMillisecondsToSamples, relSamplesToMilliseconds, removeAllDataBlocks, removeObservable, removeOutputDatablock, resetDataBlocks, saveViewerData, setCanMultiThread, setParentDataBlock, setParentDataBlock, setProcessName, setupProcess, toString, update, updateData
public void setupDataBlock()
public void pamStart()
pamStart
in class PamProcess
public void pamStop()
PamProcess
pamStop
in class PamProcess
public void pamStop(java.lang.String reason)
public void acquisitionStopped()
public void prepareProcess()
PamProcess
prepareProcess
in class PamProcess
public void setSampleRate(float sampleRate, boolean notify)
PamObserver
setSampleRate
in interface PamObserver
setSampleRate
in class PamProcess
notify
- Notify other PamObservers and PamObservables in the chain.public void setNumChannels(int numChannels)
public void setNumChannels(int numChannels, int[] channelList)
numChannels
- channelList
- public void streamClosed()
public void streamEnded()
public void streamOpen()
public void streamPaused()
public double getBufferSeconds()
public double getMaxBufferSeconds()
public boolean needRestart()
public void newData(PamObservable o, PamDataUnit arg)
newData
in class PamProcess
public java.util.List<RawDataUnit> getNewDataUnits()
public DaqSystem getRunningSystem()
public double rawAmplitude2dB(double rawAmplitude, int channel, boolean fast)
rawAmplitude
- raw amplitude (should be -1 < rawAmplitude < 1)public double getPeak2PeakVoltage(int swChannel)
swChannel
- software channel numberpublic void prepareFastAmplitudeCalculation(int channel)
channel
- public double[] rawAmplitude2dB(double[] rawAmplitude, int channel)
rawAmplitude
- raw amplitude (should be -1 < rawAmplitude < 1)public double fftAmplitude2dB(double fftAmplitude, int channel, float sampleRate, int fftLength, boolean isSquared, boolean fast)
fftAmplitude
- magnitude of the fft data (not the magnitude squared !)channel
- channel numbersampleRate
- sample rate - this needs to be sent, since this function is
often called from decimated data, in which case the sample rate will be different.fftLength
- length of the FFT (needed for Parsevals correction)isSquared
- is magnitude squared (in which case sqrt will be taken).fast
- use fast calculation (after call to prepareFastAmplitudeCalculation(...).public double[] fftAmplitude2dB(double[] fftAmplitude, int channel, float sampleRate, int fftLength, boolean isSquared)
fftAmplitude
- magnitude of the fft data (not the magnitude squared !)fftLength
- lengthof the fft (needed for Parsevals correction)public double fftBandAmplitude2dB(double fftAmplitude, int channel, int fftLength, boolean isSquared, boolean fast)
Note that this function differs from fftAmplitude2dB in that this one used the FFT length to correct for Parsevals theorum and integratin over the length of the FFT, but it does NOT convert the result to a spectrum level measurement.
fftAmplitude
- magnitude of the fft data (not the magnitude squared !)fftLength
- lengthof the fft (needed for Parsevals correction)public double dbMicropascalToSignal(int channel, double dBMuPascal)
channel
- channel number.dBMuPascal
- db in micropascalpublic AcquisitionControl getAcquisitionControl()
public PamRawDataBlock getRawDataBlock()
public int getOfflineData(PamDataBlock dataBlock, PamObserver endUser, long startMillis, long endMillis, RequestCancellationObject cancellationObject)
PamProcess
This will be called from a PamDatablock in offline viewer mode from requestOfflineData(PamObserver observer, long startMillis, long endMillis).
this is used to request data from upstream processes, e.g. o get raw data to turn into FFT data units to go to the spectrogram display (possible going via decimators and any other processes before spitting out the right data.
getOfflineData
in class PamProcess
dataBlock
- data block making the request.endUser
- observer which made the original data request.startMillis
- start time in millisecondsendMillis
- end time in milliseconds.public long getTotalSamples(int iChannel)
iChannel
-