Base class for all snBlocks in SNACS. More...
#include <snBlock.h>
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 |
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.
double snBlock::get_blks_simulation_time | ( | ) |
returns current simulation time dependent on current block number
|
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
|
protected |
has to be called by snBlocks after processing of the actual concbuf block
|
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.
|
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()
|
protected |
can be used by snBlocks to log data to log text widget.
|
protected |
can be used by snBlocks to log data to log text widget.
|
protected |
|
signal |
is connected in snMainWindow to the log text widget.
|
signal |
is connected in snMainWindow to the log text widget.
|
private |
saves the amount of processed blocks. unprotected.
|
private |
saves the amount of processed blocks for sink snBlocks. protected with a mutex.
|
private |
|
protected |
|
protected |
|
private |
|
private |
|
protected |
|
protected |
holds the simulation parameters which are common to all snBlocks
|
private |
amount of blocks to be processed in total