Relacs  0.9.8
Classes | Public Member Functions | Friends | List of all members
InList Class Reference

#include <inlist.h>

Public Member Functions

 InList (void)
 
 InList (InData &data)
 
 InList (InData *data, bool own=false)
 
 InList (const InList *il)
 
 InList (const InList &il)
 
 ~InList (void)
 
int size (void) const
 
bool empty (void) const
 
void resize (int n, int m=0, int w=0, double step=1.0)
 
void clear (void)
 
InListoperator= (const InList &il)
 
InListassign (const InList *il)
 
InListassign (void)
 
const InDataoperator[] (int i) const
 
InDataoperator[] (int i)
 
const InDatafront (void) const
 
InDatafront (void)
 
const InDataback (void) const
 
InDataback (void)
 
const InDataoperator[] (const string &ident) const
 
InDataoperator[] (const string &ident)
 
int index (const string &ident) const
 
void push (InData &data)
 
void push (const InList &traces)
 
void add (InData *data, bool own=false)
 
void add (const InData *data, bool own=false)
 
void add (const InList &traces, bool own=false)
 
void set (int index, const InData *data, bool own=false)
 
void assign (int index, const InData *data)
 
void erase (int index)
 
void update (void)
 
void updateRaw (void)
 
void updateDerived (void)
 
void clearBuffer (void)
 
void sortByChannel (void)
 
void sortByDeviceChannel (void)
 
double currentTime (void) const
 
double currentTimeRaw (void) const
 
void setDevice (int device)
 
void setReference (InData::RefType ref)
 
void setUnipolar (bool unipolar)
 
void setStartSource (int startsource)
 
void setDelay (double delay)
 
void setPriority (bool priority=true)
 
void setSampleRate (double rate)
 
void setSampleInterval (double step)
 
void setContinuous (bool continuous=true)
 
void setScale (double scale)
 
void setUnit (const string &unit)
 
void setUnit (double scale, const string &unit)
 
void setReadTime (double time)
 
void setUpdateTime (double time)
 
void clearMode (void)
 
void setMode (int flags)
 
void addMode (int flags)
 
void delMode (int flags)
 
void setSignalIndex (int index)
 
void setSignalTime (double time)
 
void setRestart (void)
 
void setRestartTime (double restarttime)
 
string errorText (void) const
 
void clearError (void)
 
void setError (long long flags)
 
void addError (long long flags)
 
void delError (long long flags)
 
void addDaqError (int de)
 
void setErrorStr (const string &strg)
 
void addErrorStr (const string &strg)
 
void setErrorStr (int errnum)
 
void addErrorStr (int errnum)
 
bool success (void) const
 
bool failed (void) const
 

Friends

ostream & operator<< (ostream &str, const InList &il)
 
bool lessChannelILE (const ILE &a, const ILE &b)
 
bool lessDeviceChannelILE (const ILE &a, const ILE &b)
 

Detailed Description

A container for InData.

Author
Jan Benda

Constructor & Destructor Documentation

InList ( void  )

Constructs an empty InList.

InList ( InData data)

Constructs an InList containing the single InData data.

See Also
push( InData& )

References InList::push().

InList ( InData data,
bool  own = false 
)

Constructs an InList containing the single pointer data. Setting own to true transfers the ownership to the InList.

See Also
add( InData* )

References InList::add().

InList ( const InList il)

Copies il to this with copying pointers to the data buffers only.

InList ( const InList il)

Copy constructor.

~InList ( void  )

Destructor.

References InList::clear().

Member Function Documentation

int size ( void  ) const
inline

The number of InData in the InList.

Referenced by InList::add(), InList::addDaqError(), InList::addError(), InList::addErrorStr(), InList::addMode(), Acquire::adjustGain(), InList::assign(), FilterData::autoConfigure(), InList::clearBuffer(), InList::clearError(), InList::clearMode(), FilterDetectors::createTracesEvents(), PlotTrace::currentTime(), InList::currentTime(), InList::currentTimeRaw(), InList::delError(), InList::delMode(), Model::deltat(), PlotTrace::displayIndex(), InList::erase(), InList::errorText(), InList::failed(), SaveFiles::RelacsFiles::openTraceFiles(), relacs::operator<<(), AISim::prepareRead(), InList::push(), RELACSPlugin::rawTraceNames(), Simulator::read(), Acquire::read(), Acquire::restartRead(), Model::scale(), InList::set(), InList::setContinuous(), InList::setDelay(), InList::setDevice(), InList::setError(), InList::setErrorStr(), Acquire::setGain(), InList::setMode(), InList::setPriority(), InList::setReadTime(), InList::setReference(), InList::setRestart(), InList::setRestartTime(), InList::setSampleInterval(), InList::setSampleRate(), InList::setScale(), AnalogInput::setSettings(), InList::setSignalIndex(), InList::setSignalTime(), InList::setStartSource(), InList::setUnipolar(), InList::setUnit(), InList::setUpdateTime(), PlotTrace::signalTime(), RELACSWidget::startFirstAcquisition(), InList::success(), Acquire::testRead(), AnalogInput::testReadData(), Model::time(), FilterDetectors::traceInputEvent(), Model::traceName(), RELACSPlugin::traceNames(), Model::traces(), InList::update(), InList::updateDerived(), PlotTrace::updateMenu(), and InList::updateRaw().

bool empty ( void  ) const
inline

True if there are no InData contained in the InList.

Referenced by RELACSWidget::startFirstAcquisition().

void resize ( int  n,
int  m = 0,
int  w = 0,
double  step = 1.0 
)

Resize the InList such that it contains n InData. If n equals zero, clear() is called. If a larger size than the current size() is requested than empty InData are appended, each of capacity m, size of write buffer w, and sampling interval step seconds.

See Also
clear(), size(), empty()

References InList::clear().

Referenced by FilterDetectors::createFilters(), and Acquire::restartRead().

void clear ( void  )
InList & operator= ( const InList il)

Assignment.

InList & assign ( const InList il)

Copies il to this with copying pointers to the data buffers only.

References InList::assign().

Referenced by AudioMonitor::assignTraces(), RELACSPlugin::assignTracesEvents(), and RELACSWidget::startFirstAcquisition().

InList & assign ( void  )

Copies again all settings and indices from the reference InData.

Referenced by InList::assign().

const InData& operator[] ( int  i) const
inline

Returns a const reference of the i -th InData of the list.

Referenced by InList::currentTime(), InList::currentTimeRaw(), and InList::errorText().

InData& operator[] ( int  i)
inline

Returns a reference of the i -th InData of the list.

const InData & front ( void  ) const

Returns a const reference to the first InData in the list.

Referenced by InList::operator[]().

InData & front ( void  )

Returns a reference to the first InData in the list.

const InData & back ( void  ) const

Returns a const reference to the last InData in the list.

Referenced by PlotTrace::displayIndex(), and AudioMonitor::start().

InData & back ( void  )

Returns a reference to the last InData in the list.

const InData & operator[] ( const string &  ident) const

Returns a const reference of the InData element with identifier ident.

Warning
No "range checking" is performed. If there is no InData element with identifier ident a reference to the first element is returned.

References InList::front().

InData & operator[] ( const string &  ident)

Returns a reference of the InData element with identifier ident.

Warning
No "range checking" is performed. If there is no InData element with identifier ident a reference to the first element is returned.

References InList::front().

int index ( const string &  ident) const

Return the index of the input data trace with identifier ident. If there is no trace with this identifier -1 is returned.

Referenced by InList::assign(), FilterDetectors::createTracesEvents(), InList::erase(), RELACSPlugin::filterTrace(), StandardTraces::initStandardEventTraces(), StandardTraces::initStandardTraces(), PlotTrace::print(), InList::set(), and RELACSPlugin::traceIndex().

void push ( InData data)

Copy data as a new element to the end of the list.

Referenced by FilterDetectors::createTracesEvents(), PlotTrace::displayIndex(), InList::InList(), and Model::push().

void push ( const InList traces)

Copy each trace from traces to the end of the list.

References InList::size().

void add ( InData data,
bool  own = false 
)

Add the pointer data as a new element to the end of the list. If own is set to true then the ownership of data is transfered to the InList, i.e. the InList might delete it.

Referenced by InList::InList(), Simulator::read(), Acquire::read(), SaveFiles::setTracesEvents(), RELACSPlugin::setTracesEvents(), and PlotTrace::updateMenu().

void add ( const InData data,
bool  own = false 
)

Add the pointer data as a new element to the end of the list. If own is set to true then the ownership of data is transfered to the InList, i.e. the InList might delete it.

void add ( const InList traces,
bool  own = false 
)

Add pointers to each trace in traces to the end of the list. If own is set to true then the ownership of the traces is transfered to the InList, i.e. the InList might delete it.

References InList::size().

void set ( int  index,
const InData data,
bool  own = false 
)

Set the pointer to data as the index-th element. If own is set to true then the ownership of the traces is transferred to the InList, i.e. the InList might delete it.

References InList::index(), and InList::size().

void assign ( int  index,
const InData data 
)

Make the index-th element a copy of data with shared buffer.

References InList::index(), and InList::size().

void erase ( int  index)

Erase the InData at index index.

References InList::index(), and InList::size().

void update ( void  )

Make written data of all traces available for reading.

References InList::size().

Referenced by RELACSWidget::getData().

void updateRaw ( void  )

Make written data of raw traces (source == 0) available for reading.

References InList::size().

Referenced by Acquire::getRawData().

void updateDerived ( void  )

Make written data of derived traces (source != 0 ) available for reading.

References InList::size().

Referenced by AudioMonitor::updateDerivedTraces(), and RELACSPlugin::updateDerivedTracesEvents().

void clearBuffer ( void  )

Clear buffer and reset indices of all InData traces.

References InList::size().

Referenced by RELACSWidget::clearActivity().

void sortByChannel ( void  )

Sort the input traces by increasing channel number.

References InList::lessChannelILE.

void sortByDeviceChannel ( void  )

Sort the input traces by increasing device and by increasing channel number.

References InList::lessDeviceChannelILE.

double currentTime ( void  ) const
double currentTimeRaw ( void  ) const
void setDevice ( int  device)

Set the device id of all traces to device.

References InList::size().

Referenced by Simulator::read(), Acquire::read(), Acquire::testRead(), and AnalogInput::testReadData().

void setReference ( InData::RefType  ref)

Set the reference of all input lines to ref. Possible values are Differential, Referenced, Nonreferenced. Defaults to Differential.

References InList::size().

Referenced by AnalogInput::testReadData().

void setUnipolar ( bool  unipolar)

Set the polarity of all input traces 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 InList::size().

void setStartSource ( int  startsource)

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

References InList::size().

Referenced by AnalogInput::testReadData().

void setDelay ( double  delay)

Set delay for all traces to delay (in seconds).

References InList::size().

Referenced by AnalogInput::testReadData().

void setPriority ( bool  priority = true)

Set the priority of all input traces 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 InList::size().

void setSampleRate ( double  rate)

Set the sampling rate of all input traces to rate Hertz

References InList::size().

Referenced by AnalogInput::testReadData().

void setSampleInterval ( double  step)

Set the sampling interval of all input traces to step seconds.

References InList::size().

void setContinuous ( bool  continuous = true)

Set continuous mode of data aquisition for all traces to continuous.

References InList::size().

Referenced by AnalogInput::testReadData().

void setScale ( double  scale)

Set the scale factor for all input traces to scale. The scale factor scale is used to scale the voltage data to a secondary unit.

See Also
setUnit()

References InList::size().

void setUnit ( const string &  unit)

Set the secondary unit for all input traces to unit.

See Also
setScale()

References InList::size().

Referenced by FilterDetectors::createTracesEvents().

void setUnit ( double  scale,
const string &  unit 
)

Set the specifications of a secondary unit for all input traces. The scale factor scale is used to scale the voltage data to a secondary unit unit.

See Also
setScale()

References InList::size().

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
setUpdateTime()

References InList::size().

Referenced by Simulator::read(), Acquire::read(), and AnalogInput::testReadData().

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 InData::capacity() is used for the size of this buffer.

See Also
setReadTime()

References InList::size().

Referenced by Simulator::read(), Acquire::read(), and AnalogInput::testReadData().

void clearMode ( void  )

Clear all mode flags for all input traces.

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

References InList::size().

void setMode ( int  flags)

Set mode flags for all input traces to flags.

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

References InList::size().

Referenced by FilterDetectors::createTracesEvents().

void addMode ( int  flags)

Add the bits specified by flags to the mode flags of all input traces.

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

References InList::size().

Referenced by Simulator::restartRead().

void delMode ( int  flags)

Clear the bits specified by flags of the mode flags of all input traces.

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

References InList::size().

Referenced by Acquire::activateGains(), Simulator::directWrite(), Acquire::directWrite(), Simulator::restartRead(), Simulator::write(), and Acquire::write().

void setSignalIndex ( int  index)

Set index of start of last signal to restart() + index in all input traces.

See Also
setSignalTime()

References InList::size().

Referenced by PlotTrace::displayIndex().

void setSignalTime ( double  time)

Set time of start of last signal to time in all input traces.

See Also
setSignalIndex()

References InList::size().

Referenced by Acquire::waitForData().

void setRestart ( void  )

Set restart-index of all input traces to current size().

See Also
setRestartTime()

References InList::size().

Referenced by Simulator::read(), Acquire::read(), Simulator::restartRead(), and Acquire::restartRead().

void setRestartTime ( double  restarttime)

Set Restart-index of all input traces to the element at restarttime.

See Also
setRestart()

References InList::size().

string errorText ( void  ) const
void clearError ( void  )

Clear all error flags of all input traces.

References InList::size().

Referenced by Acquire::read(), Acquire::restartRead(), AnalogInput::testRead(), Acquire::testRead(), and RELACSWidget::updateData().

void setError ( long long  flags)

Set error flags of all input traces to flags.

References InList::size().

void addError ( long long  flags)

Add the bits specified by flags to the error flags of all input traces.

References InList::size().

Referenced by AISim::prepareRead(), Simulator::read(), Acquire::read(), Acquire::testRead(), and AnalogInput::testReadData().

void delError ( long long  flags)

Clear the bits specified by flags of the error flags of all input traces.

References InList::size().

void addDaqError ( int  de)

Add error code de originating from daq board to the error flags of all input traces.

References InList::size().

void setErrorStr ( const string &  strg)

Set additional error string of all input traces to strg.

References InList::size().

void addErrorStr ( const string &  strg)

Add msg to the additional error string of all input traces.

References InList::size().

Referenced by Simulator::read(), and Acquire::read().

void setErrorStr ( int  errnum)

Set additional error string of all input traces to the string describing the standard C error code errnum (from errno).

References InList::size().

void addErrorStr ( int  errnum)

Add the string describing the standard C error code errnum (from errno) to the additional error string of all input traces.

References InList::size().

bool success ( void  ) const

Returns true if all input traces are ok.

References InList::size().

Referenced by RELACSWidget::getData(), and Acquire::getRawData().

bool failed ( void  ) const

Friends And Related Function Documentation

ostream& operator<< ( ostream &  str,
const InList il 
)
friend

Write content of all InData variables to stream str (for debugging only).

bool lessChannelILE ( const ILE &  a,
const ILE &  b 
)
friend

Referenced by InList::sortByChannel().

bool lessDeviceChannelILE ( const ILE &  a,
const ILE &  b 
)
friend

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