#include <gaussproducer.h>
Public Slots | |
void | generateNDataSets (int) |
Generate a number of datasets. | |
Public Member Functions | |
GaussProducer (QObject *=0) | |
Simple constructor. | |
~GaussProducer () | |
Simple destructor. | |
Private Slots | |
void | generateDataSet () |
The real working function. | |
void | cacheDirty () |
mark the internal parameter-cache as dirty. | |
void | generateOneDataSet () |
void | generateNDataSets () |
Private Member Functions | |
QString | debug () const |
Custom debug text. | |
QDomNode | saveToXML (QDomDocument doc) |
Store the information of this element into a new QDomElement. | |
bool | restoreFromXML (QDomNode) |
Restore the state of this element from the given QDomNode. | |
Private Attributes | |
int | _togenerate |
Number of datasets to generate. | |
bool | _ownthread |
whether this is running in the main-thread or not | |
NamedParameterTreeItem * | _p |
Configuration elements. | |
NamedParameterTreeItem * | _number |
Number of datasets to create on "Generate N events". | |
bool | _dirty |
Caching of parameters for speed. | |
cache_t * | _cache |
Caching of parameters for speed. |
This class can (and will) be used to determine the mathematical resolution of algorithms or to simulate and test other parts of the system.
It produces a pair of pulses that are gauss-shaped and that have a time- distance that is gauss-distributed. Several options can be changed:
NSCore::GaussProducer::GaussProducer | ( | QObject * | = 0 |
) |
Simple constructor.
NSCore::GaussProducer::~GaussProducer | ( | ) |
Simple destructor.
void NSCore::GaussProducer::generateNDataSets | ( | int | ) | [slot] |
Generate a number of datasets.
void NSCore::GaussProducer::generateDataSet | ( | ) | [private, slot] |
The real working function.
void NSCore::GaussProducer::cacheDirty | ( | ) | [inline, private, slot] |
void NSCore::GaussProducer::generateOneDataSet | ( | ) | [inline, private, slot] |
References generateNDataSets().
void NSCore::GaussProducer::generateNDataSets | ( | ) | [inline, private, slot] |
References _number, and NSCore::NamedParameterTreeItem::toInt().
Referenced by generateOneDataSet().
QString NSCore::GaussProducer::debug | ( | ) | const [inline, private, virtual] |
Custom debug text.
This function has to be implemented and has to return the internal debug-data that is to be printed...
Implements NSCore::QTreeItem.
QDomNode NSCore::GaussProducer::saveToXML | ( | QDomDocument | doc | ) | [private, virtual] |
Store the information of this element into a new QDomElement.
This function is only to save the state of this element, all the recursive stuff will be done by toXml().
doc | The QDomDocument to use for creation of the element |
Implements NSCore::QTreeItem.
bool NSCore::GaussProducer::restoreFromXML | ( | QDomNode | node | ) | [private, virtual] |
Restore the state of this element from the given QDomNode.
You don't have to do the recursive stuff here, that is handled in fromXml() for you. Only the things done in saveToXML need/can be restored here.
If you succeeded and want the childs to be restored too, return true.
node | The QDomNode to restore from |
Implements NSCore::QTreeItem.
int NSCore::GaussProducer::_togenerate [private] |
Number of datasets to generate.
This internal variable is decremented ( by generateDataSet() ) every time a data set is generated and incremented ( by generateNDataSets( int ) ) when more data sets are to be generated.
bool NSCore::GaussProducer::_ownthread [private] |
whether this is running in the main-thread or not
Basicly this caches the information whether this object lives in a child-thread or in the main ( gui- )thread. The rescheduling of generateDataSet depends on that. If this information wasn't cached, QThread::currentThread() and this->thread() would be called every time a data set is generated...
NamedParameterTreeItem* NSCore::GaussProducer::_p [private] |
Configuration elements.
bool NSCore::GaussProducer::_dirty [private] |
cache_t* NSCore::GaussProducer::_cache [private] |
Caching of parameters for speed.