Open Ephys GUI
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Public Attributes
DataThread Class Reference

Abstract base class for a data input thread owned by the SourceNode. More...

#include <DataThread.h>

Inheritance diagram for DataThread:
FileReaderThread FPGAThread IntanThread NetworkThread

List of all members.

Public Member Functions

 DataThread (SourceNode *sn)
 ~DataThread ()
void run ()
 Calls 'updateBuffer()' continuously while the thread is being run.
DataBuffergetBufferAddress ()
 Returns the address of the DataBuffer that the input source will fill.
virtual bool updateBuffer ()=0
 Fills the DataBuffer with incoming data.
virtual void setOutputHigh ()
 Experimental method used for testing data sources that can deliver outputs.
virtual void setOutputLow ()
 Experimental method used for testing data sources that can deliver outputs.
virtual bool foundInputSource ()=0
 Returns true if the data source is connected, false otherwise.
virtual bool startAcquisition ()=0
 Initializes data transfer.
virtual bool stopAcquisition ()=0
 Stops data transfer.
virtual int getNumChannels ()=0
 Returns the number of continuous channels the data source can provide.
virtual float getSampleRate ()=0
 Returns the sample rate of the data source.
virtual float getBitVolts ()=0
 Returns the volts per bit of the data source.
virtual int getNumEventChannels ()
 Returns the number of event channels of the data source.
virtual void * getDevice ()
 
Returns a pointer to the data input device, in case other processors

need to communicate with it.

Public Attributes

ScopedPointer< DataBufferdataBuffer
SourceNodesn
int16 eventCode
uint64 timestamp
Time timer

Detailed Description

Abstract base class for a data input thread owned by the SourceNode.

To communicate with input sources that may have a different clock as the data acquisition callbacks, it's most efficient to use a separate thread. The DataThread class makes it easy to create threads that interact with new data sources, such as an FPGA, an Arduino, or a network stream.

See also:
SourceNode

Constructor & Destructor Documentation

DataThread::DataThread ( SourceNode sn)
DataThread::~DataThread ( )

Member Function Documentation

void DataThread::run ( )

Calls 'updateBuffer()' continuously while the thread is being run.

DataBuffer* DataThread::getBufferAddress ( )

Returns the address of the DataBuffer that the input source will fill.

virtual bool DataThread::updateBuffer ( )
pure virtual

Fills the DataBuffer with incoming data.

This is the most important method for each DataThread.

virtual void DataThread::setOutputHigh ( )
virtual

Experimental method used for testing data sources that can deliver outputs.

Reimplemented in FPGAThread.

virtual void DataThread::setOutputLow ( )
virtual

Experimental method used for testing data sources that can deliver outputs.

Reimplemented in FPGAThread.

virtual bool DataThread::foundInputSource ( )
pure virtual

Returns true if the data source is connected, false otherwise.

Implemented in NetworkThread, FileReaderThread, FPGAThread, and IntanThread.

virtual bool DataThread::startAcquisition ( )
pure virtual

Initializes data transfer.

Implemented in NetworkThread, and FileReaderThread.

virtual bool DataThread::stopAcquisition ( )
pure virtual

Stops data transfer.

Implemented in NetworkThread, and FileReaderThread.

virtual int DataThread::getNumChannels ( )
pure virtual

Returns the number of continuous channels the data source can provide.

Implemented in NetworkThread, FileReaderThread, FPGAThread, and IntanThread.

virtual float DataThread::getSampleRate ( )
pure virtual

Returns the sample rate of the data source.

Implemented in NetworkThread, FileReaderThread, FPGAThread, and IntanThread.

virtual float DataThread::getBitVolts ( )
pure virtual

Returns the volts per bit of the data source.

Implemented in FileReaderThread, FPGAThread, and IntanThread.

virtual int DataThread::getNumEventChannels ( )
virtual

Returns the number of event channels of the data source.

Reimplemented in FPGAThread, and IntanThread.

virtual void* DataThread::getDevice ( )
virtual

Returns a pointer to the data input device, in case other processors

need to communicate with it.


Member Data Documentation

ScopedPointer<DataBuffer> DataThread::dataBuffer
SourceNode* DataThread::sn
int16 DataThread::eventCode
uint64 DataThread::timestamp
Time DataThread::timer

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