Relacs DAQ Library  0.9.8
Public Member Functions | Friends | List of all members
TraceSpec Class Reference

#include <tracespec.h>

Public Member Functions

 TraceSpec (void)
 
 TraceSpec (int index, const string &name, int device, int channel, double scale=1.0, const string &unit="", double value=0.0, double maxrate=-1.0, const string &modality="")
 
 TraceSpec (const TraceSpec &trace)
 
int device (void) const
 
void setDevice (int device)
 
int channel (void) const
 
void setChannel (int channel)
 
void setChannel (int channel, int device)
 
int trace (void) const
 
void setTrace (int index)
 
string traceName (void) const
 
void setTraceName (const string &name)
 
double scale (void) const
 
void setScale (double scale)
 
string unit (void) const
 
void setUnit (const string &unit)
 
void setUnit (double scale, const string &unit)
 
double value (void) const
 
void setValue (double value)
 
double maxSampleRate (void) const
 
void setMaxSampleRate (double maxrate)
 
bool fixedSampleRate (void) const
 
void setFixedSampleRate (double rate)
 
string modality (void) const
 
void setModality (const string &modality)
 
int apply (OutData &signal) const
 

Friends

bool operator== (const TraceSpec &trace, const OutData &signal)
 
bool operator== (const OutData &signal, const TraceSpec &trace)
 

Detailed Description

Specification of an output signal.

Author
Jan Benda

Constructor & Destructor Documentation

TraceSpec ( void  )
TraceSpec ( int  index,
const string &  name,
int  device,
int  channel,
double  scale = 1.0,
const string &  unit = "",
double  value = 0.0,
double  maxrate = -1.0,
const string &  modality = "" 
)
TraceSpec ( const TraceSpec trace)

Copy constructor.

Member Function Documentation

int device ( void  ) const

The index of the output device.

See Also
setDevice(), channel(), trace(), traceName()

Referenced by TraceSpec::setChannel(), and TraceSpec::setDevice().

void setDevice ( int  device)

Set the device index to device.

See Also
device(), setChannel(), setTrace(), setTraceName()

References TraceSpec::device().

int channel ( void  ) const

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

See Also
setChannel(), device(), trace(), traceName()

Referenced by TraceSpec::setChannel().

void setChannel ( int  channel)

Set the number of the channel on the specified device that should be used for output to channel.

See Also
channel(), setDevice(), setTrace(), setTraceName()

References TraceSpec::channel().

void setChannel ( int  channel,
int  device 
)

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

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

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

int trace ( void  ) const

The index of the output trace.

See Also
setTrace(), channel(), device(), traceName()
void setTrace ( int  index)

Set the index of the output trace to index.

See Also
trace(), setChannel(), setDevice(), setTraceName()
string traceName ( void  ) const

The name of the output trace.

See Also
setTraceName(), channel(), device(), trace()
void setTraceName ( const string &  name)

Set the name of the output trace to name.

See Also
traceName(), setChannel(), setDevice(), setTrace()
double scale ( void  ) const

The scale factor used for scaling the output signal to the voltage that is put out by the analog output device.

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

Referenced by TraceSpec::setScale(), and TraceSpec::setUnit().

void setScale ( double  scale)

Set the scale factor to scale. The scale factor scale is used to scale the output signal to the voltage that is put out by the analog output device.

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

References TraceSpec::scale().

string unit ( void  ) const

The unit of the signal.

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

Referenced by TraceSpec::setUnit().

void setUnit ( const string &  unit)

Set the unit of the signal to unit.

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

References TraceSpec::unit().

void setUnit ( double  scale,
const string &  unit 
)

Set the specifications for the output signal. The signal with unit unit is scaled by scale to the voltage that is put out by the analog output device.

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

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

double value ( void  ) const

The initial value of the output trace.

See Also
setValue()

Referenced by TraceSpec::setValue().

void setValue ( double  value)

Set the initial value of the output trace to value.

See Also
value()

References TraceSpec::value().

double maxSampleRate ( void  ) const

The maximum or fixed sampling rate to be used in Hertz.

See Also
setMaxSampleRate(), setFixedSampleRate(), fixedSampleRate()
void setMaxSampleRate ( double  maxrate)

Set the maximum sampling rate to maxrate Hertz.

See Also
maxSampleRate(), setFixedSampleRate()
bool fixedSampleRate ( void  ) const

True if the sampling rate is fixed.

void setFixedSampleRate ( double  rate)

Set the fixed sampling rate to rate Hertz.

See Also
maxSampleRate(), setMaxSampleRate(), fixedSampleRate()
string modality ( void  ) const

The modality of the signal, i.e. electric, visual, acoustic, etc.

See Also
setModality()

Referenced by TraceSpec::setModality().

void setModality ( const string &  modality)

Set the modality of the signal to modality.

See Also
modality()

References TraceSpec::modality().

int apply ( OutData signal) const

If signal has an output trace specified (via OutData::setTrace() or OutData::setTraceName()) then the corresponding settings (channel, device, ...) are applied to signal. If either OutData::traceName() or OutData::trace() do not match this TraceSpec, the DaqError::InvalidTrace error flag of signal is set.

Returns
  • 0: success
  • -1: invalid match

References DaqError::addError(), DaqError::InvalidTrace, OutData::setChannel(), OutData::setDevice(), OutData::setFixedSampleRate(), OutData::setMaxSampleRate(), OutData::setScale(), OutData::setTrace(), OutData::setUnit(), OutData::trace(), and OutData::traceName().

Friends And Related Function Documentation

bool operator== ( const TraceSpec trace,
const OutData signal 
)
friend

Returns true if trace and signal use the same device() and channel().

bool operator== ( const OutData signal,
const TraceSpec trace 
)
friend

Returns true if trace and signal use the same device() and channel().


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