Abstract base class for a data input thread owned by the SourceNode. More...
#include <DataThread.h>
Public Member Functions | |
DataThread (SourceNode *sn) | |
~DataThread () | |
void | run () |
Calls 'updateBuffer()' continuously while the thread is being run. | |
DataBuffer * | getBufferAddress () |
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 |
Public Attributes | |
ScopedPointer< DataBuffer > | dataBuffer |
SourceNode * | sn |
int16 | eventCode |
uint64 | timestamp |
Time | timer |
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.
DataThread::DataThread | ( | SourceNode * | sn | ) |
DataThread::~DataThread | ( | ) |
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.
|
pure virtual |
Fills the DataBuffer with incoming data.
This is the most important method for each DataThread.
|
virtual |
Experimental method used for testing data sources that can deliver outputs.
Reimplemented in FPGAThread.
|
virtual |
Experimental method used for testing data sources that can deliver outputs.
Reimplemented in FPGAThread.
|
pure virtual |
Returns true if the data source is connected, false otherwise.
Implemented in NetworkThread, FileReaderThread, FPGAThread, and IntanThread.
|
pure virtual |
Initializes data transfer.
Implemented in NetworkThread, and FileReaderThread.
|
pure virtual |
Stops data transfer.
Implemented in NetworkThread, and FileReaderThread.
|
pure virtual |
Returns the number of continuous channels the data source can provide.
Implemented in NetworkThread, FileReaderThread, FPGAThread, and IntanThread.
|
pure virtual |
Returns the sample rate of the data source.
Implemented in NetworkThread, FileReaderThread, FPGAThread, and IntanThread.
|
pure virtual |
Returns the volts per bit of the data source.
Implemented in FileReaderThread, FPGAThread, and IntanThread.
|
virtual |
Returns the number of event channels of the data source.
Reimplemented in FPGAThread, and IntanThread.
|
virtual |
Returns a pointer to the data input device, in case other processors
need to communicate with it.
ScopedPointer<DataBuffer> DataThread::dataBuffer |
SourceNode* DataThread::sn |
int16 DataThread::eventCode |
uint64 DataThread::timestamp |
Time DataThread::timer |