Signals | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
snBlock Class Reference

Base class for all snBlocks in SNACS. More...

#include <snBlock.h>

Inheritance diagram for snBlock:
snBlockSerial snProcessorADC snProcessorChannel snProcessorLPF snProcessorNoise snSignalGenerate snSignalInputBinary snSignalOutputBinary snSignalOutputWidget

Signals

void snLogSignal (const QString &mess)
 is connected in snMainWindow to the log text widget. More...
 
void snLogSignalDebug (const QString &mess, int d)
 is connected in snMainWindow to the log text widget. More...
 

Public Member Functions

 snBlock (SNSignal pSNSignal)
 snBlock constructor More...
 
Blocks_Type getBlks ()
 returns current block number which is being processed More...
 
Blocks_Type getOutputBlks ()
 returns processed block number of a signal sink More...
 
Blocks_Type getTotalBlks ()
 returns total amount of blocks to be processed More...
 
double get_time_per_block ()
 
double get_blks_simulation_time ()
 returns current simulation time dependent on current block number More...
 
bool isActive ()
 returns snBlock status. will return true after requestStop() was called. More...
 
void requestStop ()
 requests to stop processing and return the snBlock main program in run() More...
 

Protected Member Functions

void snLog (QString mess)
 can be used by snBlocks to log data to log text widget. More...
 
void snLogErr (QString mess)
 
void snLogDeb (QString mess, int DebugLevel)
 can be used by snBlocks to log data to log text widget. More...
 
void increaseBlks ()
 has to be called by snBlocks after processing of the actual concbuf block More...
 
void increaseOutputBlks ()
 has to be called by the sink snBlocks after processing of the actual concbuf block More...
 
void printSummary (std::string caller)
 This member function prints a summary of how much data was processed after the calling snBlock's exit. More...
 

Protected Attributes

SNSignal Sig
 holds the simulation parameters which are common to all snBlocks More...
 
unsigned int plot_x_max
 
double max_simulation_length
 
Blocks_Type max_blocks
 

Private Attributes

Blocks_Type cBlks
 saves the amount of processed blocks. unprotected. More...
 
Blocks_Type cOutputBlks
 saves the amount of processed blocks for sink snBlocks. protected with a mutex. More...
 
Blocks_Type total_blocks
 amount of blocks to be processed in total More...
 
QReadWriteLock mBlk
 
QReadWriteLock mfActive
 
bool fActive
 

Detailed Description

Base class for all snBlocks in SNACS.

This class serves as base for all processing blocks. All blocks that work in the simulation chain are called snBlocks. snBlock is derived from QThread. The processing blocks simply inherit from snBlock and implement the run() member function. In the main program (i.e. snMainWindow), a base class pointer of type std::vector<snBlock *> is used to access start() and stop() of all snBlocks.

snBlocks process the data block-wise. If an application needs to read one samples after another, snBlockSerial can be used.

Constructor & Destructor Documentation

snBlock::snBlock ( SNSignal  pSNSignal)

snBlock constructor

Member Function Documentation

double snBlock::get_blks_simulation_time ( )

returns current simulation time dependent on current block number

double snBlock::get_time_per_block ( )
inline
Blocks_Type snBlock::getBlks ( )

returns current block number which is being processed

Blocks_Type snBlock::getOutputBlks ( )

returns processed block number of a signal sink

Blocks_Type snBlock::getTotalBlks ( )

returns total amount of blocks to be processed

void snBlock::increaseBlks ( )
protected

has to be called by snBlocks after processing of the actual concbuf block

void snBlock::increaseOutputBlks ( )
protected

has to be called by the sink snBlocks after processing of the actual concbuf block

bool snBlock::isActive ( )

returns snBlock status. will return true after requestStop() was called.

void snBlock::printSummary ( std::string  caller)
protected

This member function prints a summary of how much data was processed after the calling snBlock's exit.

void snBlock::requestStop ( )

requests to stop processing and return the snBlock main program in run()

void snBlock::snLog ( QString  mess)
protected

can be used by snBlocks to log data to log text widget.

void snBlock::snLogDeb ( QString  mess,
int  DebugLevel 
)
protected

can be used by snBlocks to log data to log text widget.

void snBlock::snLogErr ( QString  mess)
protected
void snBlock::snLogSignal ( const QString &  mess)
signal

is connected in snMainWindow to the log text widget.

void snBlock::snLogSignalDebug ( const QString &  mess,
int  d 
)
signal

is connected in snMainWindow to the log text widget.

Member Data Documentation

Blocks_Type snBlock::cBlks
private

saves the amount of processed blocks. unprotected.

Blocks_Type snBlock::cOutputBlks
private

saves the amount of processed blocks for sink snBlocks. protected with a mutex.

bool snBlock::fActive
private
Blocks_Type snBlock::max_blocks
protected
double snBlock::max_simulation_length
protected
QReadWriteLock snBlock::mBlk
private
QReadWriteLock snBlock::mfActive
private
unsigned int snBlock::plot_x_max
protected
SNSignal snBlock::Sig
protected

holds the simulation parameters which are common to all snBlocks

Blocks_Type snBlock::total_blocks
private

amount of blocks to be processed in total


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