Relacs  0.9.8
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
InData Class Reference

#include <indata.h>

Inheritance diagram for InData:
Inheritance graph
[legend]
Collaboration diagram for InData:
Collaboration graph
[legend]

Public Types

enum  RefType { RefDifferential =0, RefCommon =1, RefGround =2, RefOther =3 }
 
typedef InDataIterator const_iterator
 
typedef InDataTimeIterator const_range_iterator
 
- Public Types inherited from CyclicSampleData< T >
typedef double range_type
 
typedef LinearRangeIterator const_range_iterator
 
- Public Types inherited from CyclicArray< T >
typedef T value_type
 
typedef T * pointer
 
typedef T & reference
 
typedef const T & const_reference
 
typedef int size_type
 

Public Member Functions

 InData (void)
 
 InData (int n, double step)
 
 InData (int n, int m, double step)
 
 InData (const InData *d)
 
 InData (const InData &data)
 
virtual ~InData (void)
 
const InDataoperator= (const InData &data)
 
const InDataassign (const InData *data)
 
const InDataassign (void)
 
void copy (int first, int last, OutData &data, const string &name="") const
 
void copy (double tbegin, double tend, OutData &data, const string &name="") const
 
void copy (double time, SampleDataF &trace) const
 
void copy (double time, SampleDataD &trace) const
 
string errorMessage (void) const
 
int writeBufferCapacity (void) const
 
void setWriteBufferCapacity (int m)
 
void clear (void)
 
virtual int accessibleSize (void) const
 
int currentIndex (void) const
 
double currentTime (void) const
 
virtual int minIndex (void) const
 
double minTime (void) const
 
virtual double minPos (void) const
 
int maxIndex (void) const
 
double maxTime (void) const
 
int signalIndex (void) const
 
double signalTime (void) const
 
void setSignalIndex (int index)
 
void setSignalTime (double time)
 
int restartIndex (void) const
 
double restartTime (void) const
 
void setRestart (void)
 
void setRestartTime (double restarttime)
 
void update (void)
 
virtual int readSize (void) const
 
double minValue (void) const
 
double maxValue (void) const
 
void setMinValue (double minv)
 
void setMaxValue (double maxv)
 
double voltage (int index) const
 
double getVoltage (double val) const
 
double minVoltage (void) const
 
double maxVoltage (void) const
 
void setMinVoltage (double minv)
 
void setMaxVoltage (double maxv)
 
const_iterator begin (void) const
 
const_iterator begin (double time) const
 
const_iterator minBegin (void) const
 
const_iterator end (void) const
 
const_range_iterator timeBegin (void) const
 
const_range_iterator timeBegin (double time) const
 
const_range_iterator minTimeBegin (void) const
 
const_range_iterator timeEnd (void) const
 
double sampleRate (void) const
 
void setSampleRate (double rate)
 
double sampleInterval (void) const
 
void setSampleInterval (double step)
 
double delay (void) const
 
void setDelay (double delay)
 
int startSource (void) const
 
void setStartSource (int startsource)
 
bool priority (void) const
 
void setPriority (bool priority=true)
 
bool continuous (void) const
 
void setContinuous (bool continuous=true)
 
int device (void) const
 
void setDevice (int device)
 
int channel (void) const
 
void setChannel (int channel)
 
void setChannel (int channel, int device)
 
bool rawChannel (void) const
 
bool paramChannel (void) const
 
int trace (void) const
 
void setTrace (int trace)
 
string ident (void) const
 
void setIdent (const string &ident)
 
RefType reference (void) const
 
string referenceStr (void) const
 
void setReference (RefType ref)
 
void setReference (const string &ref)
 
bool unipolar (void) const
 
void setUnipolar (bool unipolar)
 
int gainIndex (void) const
 
void setGainIndex (int gainindex)
 
char * gainData (void) const
 
void setGainData (char *data)
 
float scale (void) const
 
void setScale (float scale)
 
string unit (void) const
 
void setUnit (const string &unit)
 
void setUnit (float scale, const string &unit)
 
string format (void) const
 
int source (void) const
 
void setSource (int source)
 
double readTime (void) const
 
void setReadTime (double time)
 
double updateTime (void) const
 
void setUpdateTime (double time)
 
int mode (void) const
 
void clearMode (void)
 
void setMode (int flags)
 
void addMode (int flags)
 
void delMode (int flags)
 
- Public Member Functions inherited from CyclicSampleData< T >
 CyclicSampleData (void)
 
 CyclicSampleData (int n, double stepsize=1.0)
 
 CyclicSampleData (int n, double offset, double stepsize)
 
 CyclicSampleData (double duration, double stepsize=1.0)
 
 CyclicSampleData (double duration, double offset, double stepsize)
 
 CyclicSampleData (CyclicSampleData< T > *csd)
 
 CyclicSampleData (const CyclicSampleData< T > &csd)
 
 ~CyclicSampleData (void)
 
const CyclicSampleData< T > & operator= (const CyclicSampleData< T > &a)
 
const CyclicSampleData< T > & assign (const CyclicSampleData< T > &a)
 
const CyclicSampleData< T > & assign (const CyclicSampleData< T > *a)
 
virtual void resize (int n, const T &val=0)
 
virtual void resize (double duration, const T &val=0)
 
virtual void reserve (int n)
 
virtual void reserve (double duration)
 
double offset (void) const
 
void setOffset (double offset)
 
double stepsize (void) const
 
void setStepsize (double stepsize)
 
void setRange (const T &offset, const T &stepsize)
 
double length (void) const
 
double rangeFront (void) const
 
double rangeBack (void) const
 
void shift (double val)
 
void scale (double scale)
 
double pos (int i) const
 
double interval (int indices) const
 
int index (double pos) const
 
int indices (double iv) const
 
bool contains (double p) const
 
const CyclicArray< T > & array (void) const
 
CyclicArray< T > & array (void)
 
LinearRange range (void)
 
min (int from, int upto) const
 
min (double from, double upto) const
 
min (double from) const
 
max (int from, int upto) const
 
max (double from, double upto) const
 
max (double from) const
 
void minMax (T &min, T &max, int from, int upto) const
 
void minMax (T &min, T &max, double from, double upto) const
 
void minMax (T &min, T &max, double from) const
 
minAbs (int from, int upto) const
 
minAbs (double from, double upto) const
 
minAbs (double from) const
 
maxAbs (int from, int upto) const
 
maxAbs (double from, double upto) const
 
maxAbs (double from) const
 
numerical_traits< T >::mean_type mean (int from, int upto) const
 
numerical_traits< T >::mean_type mean (double from, double upto) const
 
template<typename R >
void mean (double time, SampleData< R > &d, double width=0.0) const
 
numerical_traits< T >
::variance_type 
variance (int from, int upto) const
 
numerical_traits< T >
::variance_type 
variance (double from, double upto) const
 
template<typename R >
void variance (double time, SampleData< R > &d, double width=0.0) const
 
numerical_traits< T >
::variance_type 
stdev (int from, int upto) const
 
numerical_traits< T >
::variance_type 
stdev (double from, double upto) const
 
template<typename R >
void stdev (double time, SampleData< R > &d, double width=0.0) const
 
numerical_traits< T >
::variance_type 
rms (int from, int upto) const
 
numerical_traits< T >
::variance_type 
rms (double from, double upto) const
 
template<typename R >
void rms (double time, SampleData< R > &d, double width=0.0) const
 
template<typename S >
void hist (SampleData< S > &h, int from, int upto) const
 
template<typename S >
void hist (SampleData< S > &h, double from, double upto) const
 
template<typename S >
void hist (SampleData< S > &h) const
 
- Public Member Functions inherited from CyclicArray< T >
 CyclicArray (void)
 
 CyclicArray (int n)
 
 CyclicArray (CyclicArray< T > *ca)
 
 CyclicArray (const CyclicArray< T > &ca)
 
virtual ~CyclicArray (void)
 
const CyclicArray< T > & operator= (const CyclicArray< T > &a)
 
const CyclicArray< T > & assign (const CyclicArray< T > &a)
 
const CyclicArray< T > & assign (const CyclicArray< T > *a)
 
int size (void) const
 
bool empty (void) const
 
int capacity (void) const
 
void update (const CyclicArray< T > *a)
 
const T & operator[] (int i) const
 
T & operator[] (int i)
 
const T & at (int i) const
 
T & at (int i)
 
const T & front (void) const
 
T & front (void)
 
const T & back (void) const
 
T & back (void)
 
void push (const T &val)
 
pop (void)
 
int maxPush (void) const
 
T * pushBuffer (void)
 
void push (int n)
 
int readIndex (void) const
 
read (void)
 
min (int from, int upto) const
 
max (int from, int upto) const
 
void minMax (T &min, T &max, int from, int upto) const
 
minAbs (int from, int upto) const
 
maxAbs (int from, int upto) const
 
numerical_traits< T >::mean_type mean (int from, int upto) const
 
numerical_traits< T >
::variance_type 
variance (int from, int upto) const
 
numerical_traits< T >
::variance_type 
stdev (int from, int upto) const
 
numerical_traits< T >
::variance_type 
rms (int from, int upto) const
 
template<typename S >
void hist (SampleData< S > &h, int from, int upto) const
 
template<typename S >
void hist (SampleData< S > &h) const
 
const T * readBuffer (int index, int &maxn) const
 
int saveBinary (ostream &os, int index) const
 
int loadBinary (istream &is, int index)
 
- Public Member Functions inherited from DaqError
 DaqError (void)
 
void clearError (void)
 
long long error (void) const
 
void setError (long long flags)
 
void addError (long long flags)
 
void delError (long long flags)
 
void addDaqError (int de)
 
void addAttError (int ae)
 
string errorStr (void) const
 
void setErrorStr (const string &strg)
 
void addErrorStr (const string &strg)
 
void setErrorStr (int errnum)
 
void addErrorStr (int errnum)
 
string errorText (void) const
 
bool success (void) const
 
bool failed (void) const
 
bool busy (void) const
 
bool overflow (void) const
 
bool underflow (void) const
 
bool attenuatorFailed (void) const
 
void update (const DaqError *de)
 

Static Public Member Functions

static string referenceStr (RefType ref)
 
static void setDefaultDevice (int deviceid)
 
static int defaultDevice (void)
 
- Static Public Member Functions inherited from DaqError
static string errorText (long long flags)
 

Static Public Attributes

static const int ParamChannel = 1000
 
- Static Public Attributes inherited from DaqError
static const long long NoDevice = 1LL<<0
 
static const long long DeviceNotOpen = 1LL<<1
 
static const long long MultipleDevices = 1LL<<2
 
static const long long InvalidStartSource = 1LL<<3
 
static const long long MultipleStartSources = 1LL<<4
 
static const long long InvalidDelay = 1LL<<5
 
static const long long MultipleDelays = 1LL<<6
 
static const long long MultiplePriorities = 1LL<<7
 
static const long long InvalidSampleRate = 1LL<<8
 
static const long long MultipleSampleRates = 1LL<<9
 
static const long long InvalidContinuous = 1LL<<10
 
static const long long MultipleContinuous = 1LL<<11
 
static const long long MultipleRestart = 1LL<<12
 
static const long long NoData = 1LL<<13
 
static const long long MultipleBuffersizes = 1LL<<14
 
static const long long InvalidBufferTime = 1LL<<15
 
static const long long MultipleBufferTimes = 1LL<<16
 
static const long long InvalidUpdateTime = 1LL<<17
 
static const long long MultipleUpdateTimes = 1LL<<18
 
static const long long InvalidTrace = 1LL<<19
 
static const long long InvalidChannel = 1LL<<20
 
static const long long MultipleChannels = 1LL<<21
 
static const long long InvalidReference = 1LL<<22
 
static const long long MultipleReferences = 1LL<<23
 
static const long long InvalidDither = 1LL<<24
 
static const long long MultipleDither = 1LL<<25
 
static const long long InvalidReglitch = 1LL<<26
 
static const long long MultipleReglitch = 1LL<<27
 
static const long long InvalidGain = 1LL<<28
 
static const long long MultipleGains = 1LL<<29
 
static const long long Underflow = 1LL<<30
 
static const long long Overflow = 1LL<<31
 
static const long long CalibrationFailed = 1LL<<32
 
static const long long InvalidChannelType = 1LL<<33
 
static const long long InvalidChannelSequence = 1LL<<34
 
static const long long Busy = 1LL<<35
 
static const long long DeviceError = 1LL<<36
 
static const long long OverflowUnderrun = 1LL<<37
 
static const long long Unknown = 1LL<<38
 
static const long long NoIntensity = 1LL<<39
 
static const long long AttNotOpen = 1LL<<40
 
static const long long AttInvalidDevice = 1LL<<41
 
static const long long AttFailed = 1LL<<42
 
static const long long AttUnderflow = 1LL<<43
 
static const long long AttOverflow = 1LL<<44
 
static const long long AttIntensityUnderflow = 1LL<<45
 
static const long long AttIntensityOverflow = 1LL<<46
 
static const long long AttIntensityFailed = 1LL<<47
 

Friends

ostream & operator<< (ostream &str, const InData &id)
 

Additional Inherited Members

- Protected Attributes inherited from CyclicSampleData< T >
double Offset
 
double Stepsize
 
- Protected Attributes inherited from CyclicArray< T >
bool Own
 
T * Buffer
 
int NBuffer
 
int RCycles
 
int R
 
int LCycles
 
int L
 
Val
 
Dummy
 

Detailed Description

A cyclic buffer for data acquired from a data acquisition board.

Author
Jan Benda

InData contains all data necessary to specify the acquisition of data from a data-acquisition board as well as a cyclic buffer for the read in data. The content of the data buffer can be accesed by the []-operators, and the at() functions.

To convert indices to the buffer into the corresponding time and vice versa use the functions pos(), interval(), index() and indices(). pos( int index ) returns the time corresponding to the data element with index index. index( double pos ) is the index of the data element at time pos given in seconds.

Since the buffer is cyclic it cannot contain all data, but only the last accessibleSize() read in data values. The index of the first accessible data element is returned by minIndex() and an iterator by minBegin(). The index behind the most recent data element is returned by currentIndex() and equals the size() of the buffer. signalIndex() returns the index of the output of the last signal and restartIndex() the index where the data acquisition was restarted.

The data are stored as floats in a secondary unit. Multiplication of the voltage obtained from the data acquisition board with scale() results in the data value stored in the InData buffer with an unit returned by unit().

The acquisition of the data is specified by sampleRate(), delay(), startSource(), priority(), continuous(), device(), channel(), reference(), unipolar(), gainIndex(), and updateTime(). Further, the InData has an identifier string ident(), a unique trace number trace() and mode() flags.

InputData inherits an error flag from the class DaqError. The error flag can be read with error() where errors of the last input operation are coded. With success() it can be checked whether the last input/output operation was successful. For more details, see DaqError.

Member Typedef Documentation

Const iterator used to iterate through InData.

Const iterator used to iterate through InData.

Member Enumeration Documentation

enum RefType

Reference types for analog input lines.

Enumerator
RefDifferential 

Differential input.

RefCommon 

A "common" reference (the low inputs of all the channels are tied together, but are isolated from ground). Also called "nonreferenced single-ended".

RefGround 

Referenced to ground. Also called "referenced single-ended".

RefOther 

Any reference that does not fit into the above categories.

Constructor & Destructor Documentation

InData ( void  )

Constructor.

InData ( int  n,
double  step 
)

Constructs an InData with capacity n, and sampling interval step.

InData ( int  n,
int  m,
double  step 
)

Constructs an InData with capacity n, reserved elements for writing m, and sampling interval step.

References InData::setWriteBufferCapacity().

InData ( const InData d)

Constructs an InData with the same settings as d and using the same buffer as d.

References InData::assign().

InData ( const InData data)

Copy constructor.

~InData ( void  )
virtual

Destructor.

Member Function Documentation

const InData & operator= ( const InData data)

Assignment operator.

References CyclicSampleData< T >::assign().

const InData & assign ( const InData data)

Make data internal reference to an InData and copy its properties and a pointer to its buffer to this.

References CyclicSampleData< T >::assign().

const InData & assign ( void  )

Assign all properties from the internal reference to an InData instance to this.

See Also
update()

Referenced by InData::InData().

void copy ( int  first,
int  last,
OutData data,
const string &  name = "" 
) const

Copy the data from element first to element last to data. No amplitude information is stored into the description of data. Set the name of the description to name.

References Options::addNumber(), Options::addText(), OutData::clear(), Options::clear(), OutData::description(), InData::ident(), SampleData< T >::length(), InData::maxIndex(), InData::minIndex(), SampleData< T >::resize(), InData::sampleRate(), Options::setName(), OutData::setSampleRate(), Options::setType(), and SampleData< T >::size().

Referenced by InData::copy().

void copy ( double  tbegin,
double  tend,
OutData data,
const string &  name = "" 
) const

Copy the data from time tbegin to time tend seconds to data. No amplitude information is stored into the description of data. Set the name of the description to name.

References InData::copy(), and CyclicSampleData< T >::index().

void copy ( double  time,
SampleDataF trace 
) const

Copy the data values from time + trace.leftMargin() to time + trace.rightMargin() to trace. The sample interval given by trace is used. If the sample intervals differ the values are obtained by linear interpolation. If time + trace.rightMargin() is larger than length() trace is appropriately truncated.

References CyclicSampleData< T >::index(), CyclicArray< T >::operator[](), CyclicSampleData< T >::pos(), SampleData< T >::pos(), SampleData< T >::rangeFront(), SampleData< T >::resize(), InData::sampleInterval(), CyclicArray< T >::size(), SampleData< T >::size(), and SampleData< T >::stepsize().

void copy ( double  time,
SampleDataD trace 
) const

Copy the data values from time + trace.leftMargin() to time + trace.rightMargin() to trace. The sample interval given by trace is used. If the sample intervals differ the values are obtained by linear interpolation. If time + trace.rightMargin() is larger than length() trace is appropriately truncated.

References CyclicSampleData< T >::index(), CyclicArray< T >::operator[](), CyclicSampleData< T >::pos(), SampleData< T >::pos(), SampleData< T >::rangeFront(), SampleData< T >::resize(), InData::sampleInterval(), CyclicArray< T >::size(), SampleData< T >::size(), and SampleData< T >::stepsize().

string errorMessage ( void  ) const

Return string with an error message: "Channel # on device #: error message". If there isn't any error, an empty string is returned.

References InData::channel(), InData::device(), DaqError::errorStr(), and DaqError::success().

int writeBufferCapacity ( void  ) const
Returns
the size of the part of the buffer reserved for writing new data.
void setWriteBufferCapacity ( int  m)

Set the capacity of the part of the bufer to be used for writing new data to m. If m is greater than capacity() it is set to capacity().

References CyclicArray< T >::capacity().

Referenced by InData::InData().

void clear ( void  )
virtual

Empties the buffer and resets all indices.

Reimplemented from CyclicArray< T >.

References CyclicArray< T >::clear().

int accessibleSize ( void  ) const
virtual

The number of data elements that are actually stored in the array and therefore are accessible.

Reimplemented from CyclicArray< T >.

References CyclicArray< T >::accessibleSize().

int currentIndex ( void  ) const

Index + 1 where data end. Equals size().

See Also
currentTime()

References CyclicArray< T >::size().

double currentTime ( void  ) const
int minIndex ( void  ) const
virtual

The index of the first accessible data element.

See Also
minTime()

Reimplemented from CyclicSampleData< T >.

References CyclicArray< T >::NBuffer, CyclicArray< T >::R, and CyclicArray< T >::RCycles.

Referenced by AudioMonitor::audioCallback(), InData::copy(), InData::minBegin(), and InData::minTimeBegin().

double minTime ( void  ) const

The time in seconds corresponding to the first accessible data element.

See Also
minIndex()

References InData::minPos().

double minPos ( void  ) const
virtual

The time in seconds corresponding to the first accessible data element. Same as minTime().

See Also
minIndex()

Reimplemented from CyclicSampleData< T >.

References CyclicSampleData< T >::minPos().

Referenced by InData::minTime().

int maxIndex ( void  ) const

Maximum possible index.

See Also
maxTime()

Referenced by InData::copy(), and InData::maxTime().

double maxTime ( void  ) const

Time in seconds corresponding to the maximum possible index.

See Also
maxIndex()

References InData::maxIndex(), and CyclicSampleData< T >::pos().

int signalIndex ( void  ) const

Index of start of last signal. If there wasn't any signal yet, -1 is returned.

See Also
signalTime(), setSignalIndex(), setSignalTime()
double signalTime ( void  ) const

Time in seconds of start of last signal. If there wasn't any signal yet, -1.0 is returned.

See Also
signalIndex(), setSignalIndex(), setSignalTime()

References CyclicSampleData< T >::pos().

void setSignalIndex ( int  index)

Set index of start of last signal to index.

See Also
setSignalTime()

References CyclicSampleData< T >::index().

void setSignalTime ( double  time)

Set time of start of last signal to time.

See Also
setSignalIndex()

References CyclicSampleData< T >::index().

int restartIndex ( void  ) const

Index where aquisition was restarted.

See Also
restartTime(), setRestart()
double restartTime ( void  ) const

Time in seconds where aquisition was restarted.

See Also
restartIndex(), setRestart()

References CyclicSampleData< T >::pos().

void setRestart ( void  )

Set Restart-index to current size().

See Also
setRestartTime(), restartIndex(), restartTime()

References CyclicArray< T >::size().

void setRestartTime ( double  restarttime)

Set Restart-index to the element at restarttime.

See Also
setRestart(), restartTime()

References CyclicSampleData< T >::index().

void update ( void  )

Copy all indices from the internal reference to an InData instance to this.

See Also
assign()

References CyclicArray< T >::update(), and DaqError::update().

int readSize ( void  ) const
virtual

The number of data elements available to be read from the buffer.

See Also
read(), readIndex(), size(), accessibleSize()

Reimplemented from CyclicArray< T >.

References CyclicArray< T >::readSize().

double minValue ( void  ) const

Minimum possible value (in the secondary unit).

See Also
maxValue(), minVoltage(), setMinValue()

Referenced by InData::format().

double maxValue ( void  ) const

Maximum possible value (in the secondary unit).

See Also
minValue(), maxVoltage(), setMaxValue()

Referenced by Acquire::adjustGain(), AudioMonitor::audioCallback(), InData::format(), and Acquire::maxValues().

void setMinValue ( double  minv)

Set the minimum possible value to minv.

void setMaxValue ( double  maxv)

Set the maximum possible value to maxv.

double voltage ( int  index) const

Get the voltage of the index -th element in Volt. index must be a valid index.

References CyclicArray< T >::operator[](), and InData::scale().

double getVoltage ( double  val) const

Returns the voltage corresponding to the value val in Volt.

References InData::scale().

double minVoltage ( void  ) const

Minimum possible voltage value.

See Also
maxVoltage(), minValue(), setMinVoltage()

References InData::scale().

double maxVoltage ( void  ) const

Maximum possible voltage value.

See Also
minVoltage(), maxValue(), setMaxVoltage()

References InData::scale().

Referenced by Acquire::maxVoltages().

void setMinVoltage ( double  minv)

Set the minimum possible voltage value to minv.

See Also
setMaxVoltage(), setMinValue(), minValue()

References InData::scale().

void setMaxVoltage ( double  maxv)

Set the maximum possible votlage value to maxv.

See Also
setMinVoltage(), setMaxValue(), maxValue()

References InData::scale().

InData::const_iterator begin ( void  ) const

Returns an iterator pointing to the first data element.

InData::const_iterator begin ( double  time) const

Returns an iterator pointing to the element at time time seconds.

References CyclicSampleData< T >::index().

InData::const_iterator minBegin ( void  ) const

Returns an iterator pointing to the first accessible element

See Also
minIndex().

References InData::minIndex().

InData::const_iterator end ( void  ) const

Returns an iterator pointing behind the last element.

References CyclicArray< T >::size().

InDataTimeIterator timeBegin ( void  ) const

Returns an iterator for the time associated with the data elements pointing to the first data element.

InDataTimeIterator timeBegin ( double  time) const

Returns an iterator for the time associated with the data elements pointing to the element at time time seconds.

References CyclicSampleData< T >::index().

InDataTimeIterator minTimeBegin ( void  ) const

Returns an iterator for the time associated with the data elements pointing to the first accessible element

See Also
minIndex().

References InData::minIndex().

InDataTimeIterator timeEnd ( void  ) const

Returns an iterator for the time associated with the data elements pointing behind the last element.

References CyclicArray< T >::size().

double sampleRate ( void  ) const

The sampling rate of the input trace in Hertz

References CyclicSampleData< T >::stepsize().

Referenced by InData::copy().

void setSampleRate ( double  rate)

Set the sampling rate of the input trace to rate Hertz

References CyclicSampleData< T >::setStepsize().

double sampleInterval ( void  ) const

The sampling interval of the input trace in seconds. Same as stepszie().

References CyclicSampleData< T >::stepsize().

Referenced by InData::copy().

void setSampleInterval ( double  step)

Set the sampling interval of the input trace to step seconds. Same as setStepsize().

References CyclicSampleData< T >::setStepsize().

double delay ( void  ) const

Delay in seconds from start trigger to start of aquisition.

void setDelay ( double  delay)

Set delay to delay (in seconds).

int startSource ( void  ) const

The source for the start trigger of the data aquisition.

void setStartSource ( int  startsource)

Set the source for the start trigger of the data aquisition to startsource.

bool priority ( void  ) const

Returns true if the input trace has the priority to run even if there still is a data acquisition running.

Referenced by InData::setPriority().

void setPriority ( bool  priority = true)

Set the priority of the input trace to priority. If priority is true then the input trace is processed even if there still is a data acquisition running. Otherwise the input trace is not processed and returns with an error.

References InData::priority().

bool continuous ( void  ) const

Is aquisition performed in continuous mode?

Referenced by InData::setContinuous().

void setContinuous ( bool  continuous = true)

Set continuous mode of data aquisition to continuous.

References InData::continuous().

int device ( void  ) const
void setDevice ( int  device)

Set the device id to device. You only need to specify an input device if more than one output devices are available and the data should be acquired from an input device other than the default one.

See Also
channel(), setChannel(), device()

References InData::device().

Referenced by FilterDetectors::createTracesEvents().

int channel ( void  ) const

The number of the channel on the specified device that is used for input.

See Also
setChannel(), device(), setDevice()

Referenced by Acquire::adjustGain(), InData::errorMessage(), InList::errorText(), Acquire::maxValues(), Acquire::maxVoltages(), InData::setChannel(), and Acquire::setGain().

void setChannel ( int  channel)

Set the number of the channel on the specified device that should be used for input to channel. Default is the first ('0') channel.

See Also
channel(), device(), setDevice()

References InData::channel().

Referenced by FilterDetectors::createTracesEvents().

void setChannel ( int  channel,
int  device 
)

Set the number of the channel to channel and the device to device.

See Also
channel(), device(), setDevice()

References InData::channel(), and InData::device().

bool rawChannel ( void  ) const

true if this is a channel sampling from a acquisition device.

See Also
paramChannel()

References InData::ParamChannel.

bool paramChannel ( void  ) const

true if this is a channel sampling from model or status variables.

See Also
rawChannel()

References InData::ParamChannel.

int trace ( void  ) const

The trace-number.

Referenced by InData::setTrace().

void setTrace ( int  trace)

Set the trace number to trace.

References InData::trace().

string ident ( void  ) const

The description of the input trace.

Referenced by RELACSPlugin::adjustGain(), InData::copy(), and InData::setIdent().

void setIdent ( const string &  ident)

Set the description of the input trace to ident.

References InData::ident().

Referenced by PlotTrace::displayIndex().

InData::RefType reference ( void  ) const

The reference for the input line. Possible return values are RefDifferential, RefCommon, RefGround, RefOther.

See Also
referenceStr(), setReference()
string referenceStr ( void  ) const

The reference for the input line as a string.

See Also
reference(), setReference()

Referenced by InputConfig::fillCells(), InputConfig::insertRows(), and RELACSWidget::RELACSWidget().

string referenceStr ( RefType  ref)
static

The reference type ref as a string.

See Also
reference(), setReference()
void setReference ( InData::RefType  ref)

Set the reference of the input line to ref. Possible values are RefDifferential, RefCommon, RefGround, RefOther. Defaults to RefDifferential.

See Also
reference(), referenceStr()
void setReference ( const string &  ref)

Set the reference of the input line to ref. Possible values are "differential", "common", "ground", "other".

See Also
reference(), referenceStr()

References InData::RefDifferential, and InData::RefOther.

bool unipolar ( void  ) const

True if only positive values are acquired.

Referenced by Acquire::adjustGain(), Acquire::maxValues(), Acquire::maxVoltages(), Acquire::setGain(), and InData::setUnipolar().

void setUnipolar ( bool  unipolar)

Set the polarity of the input trace to unipolar. If unipolar is true only positive values are acquired, if it is false positive and negative values are acquired. By default acquisition is bipolar.

References InData::unipolar().

int gainIndex ( void  ) const

Returns the gain index that is used to select the gain of the input trace on the data acquisition board.

See Also
setGainIndex(), scale(), setScale(), unit(), setUnit()

Referenced by Acquire::adjustGain().

void setGainIndex ( int  gainindex)

Set the gain index to gainindex. The gain index selects the gain of the input trace on the data acquisition board.

See Also
gainIndex(), scale(), setScale(), unit(), setUnit()
char * gainData ( void  ) const

Returns the data to be used by AnalogInput for converting raw data to voltage.

See Also
setGainData(), gainIndex()
void setGainData ( char *  data)

Set the data to be used by AnalogInput for converting raw data to voltage to data.

See Also
gainData(), setGainIndex()
float scale ( void  ) const
void setScale ( float  scale)

Set the scale factor to scale. The scale factor scale is used to scale the voltage data to a secondary unit.

See Also
scale(), unit(), setUnit()

References InData::scale().

string unit ( void  ) const

The secondary unit.

See Also
setUnit(), scale(), setScale()

Referenced by InData::setUnit().

void setUnit ( const string &  unit)

Set the secondary unit to unit.

See Also
unit(), scale(), setScale()

References InData::unit().

void setUnit ( float  scale,
const string &  unit 
)

Set the specifications of a secondary unit. The voltage data are scaled by scale to get the data in the secondary unit unit.

See Also
unit(), scale(), setScale()

References InData::scale(), and InData::unit().

string format ( void  ) const

Return a format string that is appropriate for writing out the data values.

References relacs::ceil(), relacs::log10(), InData::maxValue(), InData::minValue(), and CyclicSampleData< T >::range().

int source ( void  ) const

Returns 0 if the data are acquired, 1 if the data are filtered from an InData, 2 if the data are filtered from an EventData.

See Also
setSource()

Referenced by RELACSPlugin::adjustGain(), and InData::setSource().

void setSource ( int  source)

Set the source of the data to source.

See Also
source()

References InData::source().

double readTime ( void  ) const

The maximum time in seconds the hardware driver can buffer data.

See Also
setReadTime(), updateTime()
void setReadTime ( double  time)

Set the maximum time the hardware driver should buffer the data before they are transferred to the AnalogInput implementation to time seconds. If time is zero or negative, the default buffer time of the driver is used for the size of the driver's buffer.

See Also
readTime(), setUpdateTime()
double updateTime ( void  ) const

The maximum time in seconds the AnalogInput implementation buffers data internally before they are converted to the secondary unit and written to the InData buffer.

See Also
setUpdateTime(), readTime()
void setUpdateTime ( double  time)

Set the maximum time the AnalogInput implementaion should buffer the data internally before they are converted to the secondary unit and written into the InData buffer to time seconds. If time is zero or negative, the capacity() is used for the size of this buffer.

See Also
updateTime(), setReadTime()
int mode ( void  ) const

Return mode flags. The mode flags can be used to label the input trace. They do not effect the data aquisition.

See Also
clearMode(), setMode(), addMode(), delMode()
void clearMode ( void  )

Clear all mode flags.

See Also
mode(), setMode(), addMode(), delMode()
void setMode ( int  flags)

Set mode flags to flags.

See Also
mode(), clearMode(), addMode(), delMode()
void addMode ( int  flags)

Add the bits specified by flags to the mode flags.

See Also
mode(), clearMode(), setMode(), delMode()
void delMode ( int  flags)

Clear the bits specified by flags of the mode flags.

See Also
mode(), clearMode(), setMode(), addMode()
static void setDefaultDevice ( int  deviceid)
static

Set the id of the default device to deviceid.

static int defaultDevice ( void  )
static

The id of the default device.

Friends And Related Function Documentation

ostream& operator<< ( ostream &  str,
const InData id 
)
friend

Write the internal variables to str.

Member Data Documentation

const int ParamChannel = 1000
static

Channel numbers larger or equal than this are additional traces not acquired from the daq board.

Referenced by Acquire::maxValues(), Acquire::maxVoltages(), InData::paramChannel(), InData::rawChannel(), and AnalogInput::testReadData().


The documentation for this class was generated from the following files: