QDaq
0.2.6
Qt-based Data Aqcuisition
|
A class that provides storage of channel or other data. More...
#include <QDaqDataBuffer.h>
Public Slots | |
void | clear () |
Clear all data. | |
void | push (const QDaqVector &v) |
Append a new row of values. More... | |
QDaqVector | get (int i) |
Return the i-th QDaqBuffer. | |
![]() | |
QString | errorBacktrace (int maxItems=10) const |
Print a backtrace of recent errors in this QDaqObject. | |
QString | path () const |
Return the object's path in the QDaq tree. More... | |
QString | objectTree () const |
Output in a string the object hierarchy beneath this object. | |
QString | listProperties () const |
List the objects properties. | |
QString | listFunctions () const |
List the objects scriptable functions. | |
QDaqObject * | parent () const |
QDaqObjectList | children () const |
Return a list of children of this object. | |
bool | hasChildren () const |
Returns true if the object has children. | |
QDaqObject * | appendChild (QDaqObject *obj) |
Adds a new child QDaqObject, as the last child and returns a pointer to it. | |
QDaqObject * | insertBefore (QDaqObject *newobj, QDaqObject *existingobj) |
Adds a new child QDaqObject, before an existing child and returns a pointer to it. | |
QDaqObject * | clone () |
Clone a QDaqObject with its child objects. | |
QDaqObject * | removeChild (QDaqObject *obj) |
Remove a child and return a pointer to it. | |
QDaqObject * | replaceChild (QDaqObject *newobj, QDaqObject *oldobj) |
Replace a child and return a pointer to the old child. | |
QDaqObject * | findChild (const QString &name) const |
Find the first child QDaqObject with objectName equal to name. | |
Protected Member Functions | |
virtual void | writeh5 (H5::Group *h5g, QDaqH5File *f) const |
Write contents of the object to a H5 group. More... | |
virtual void | readh5 (H5::Group *h5g, QDaqH5File *f) |
Read contents of the object from a H5 group. More... | |
virtual bool | run () |
Perform the QDaqDataBuffer tasks within a loop. More... | |
![]() | |
virtual bool | arm_ () |
Performs internal initialization for the job. More... | |
virtual void | disarm_ () |
Performs internal de-initialization. More... | |
bool | setArmed (bool on) |
Arms or disarms a job. More... | |
virtual bool | exec () |
Called when the job is executed. More... | |
![]() | |
void | pushError (const QString &type, const QString &descr=QString()) const |
Push an error in the error queue. | |
void | throwScriptError (const QString &msg) const |
Throw a script error with message msg. | |
bool | checkName (const QString &name) const |
Check if name is a legal name for an QDaqObject. More... | |
Properties | |
uint | backBufferDepth |
Size of the back buffer in rows. | |
uint | capacity |
Total capacity (allocated memory) of the data buffer in rows. | |
uint | size |
Current size of the data buffer in rows. | |
uint | columns |
Number of data columns. | |
bool | circular |
True if buffer is circular. | |
QDaqObjectList | channels |
A QList of the channels monitored by this object. | |
QStringList | columnNames |
A list of column names. | |
![]() | |
bool | armed |
True if job is armed. More... | |
QString | runCode |
Script code executed by the job at each repetition. More... | |
QString | armCode |
Script code executed by the job in the arming face. More... | |
QString | disarmCode |
Script code executed by the job in the dis-arming face. More... | |
Additional Inherited Members | |
![]() | |
void | propertiesChanged () |
Fired when object properties have changed. | |
void | updateWidgets () |
Fired when widgets need update. | |
![]() | |
Q_INVOKABLE | QDaqJob (const QString &name) |
QDaqJob constructor. More... | |
virtual void | attach () |
Attach this QDaqObject to the QDaq tree. More... | |
virtual void | detach () |
Detach this QDaqObject from the QDaq tree. More... | |
QDaqLoop * | topLoop () const |
Returns the top level loop that this job belongs to. | |
QDaqLoop * | loop () const |
Returns the loop that this job belongs to. | |
virtual QDaqScriptEngine * | loopEngine () const |
Returns the QDaqScriptEngine of the top level loop. | |
![]() | |
Q_INVOKABLE | QDaqObject (const QString &name) |
Construct a QDaqObject with a name. More... | |
bool | isAttached () const |
Returns true is this object is attached to the QDaq tree. | |
![]() | |
static QDaqRoot * | root () |
Obtain a pointer to the one-and-only QDaqRoot object. | |
static QDaqObject * | fromPath (const QString &path) |
Return a pointer to an object given its full path in the QDaq tree. More... | |
![]() | |
QMutex | comm_lock |
A recursive mutex for synching thread access to this object. | |
A class that provides storage of channel or other data.
If QDaqDataBuffer is used within a QDaqLoop then at each repetition it will store the values of all channels that have been assigned to it. The data are stored internally as a matrix of QDaqBuffer objects, keeping one QDaqBuffer per channel. A new row of data is added at each loop repetition.
QDaqDataBuffer has an internal back buffer, where data generated in the loop thread are initially stored. The data is later transferred to the main buffer whenever possible and becomes available to the main application thread. The process is marshalled internally by a semaphore and the Qt signal/slot mechanism. Increasing the size of the back buffer can prevent data loss in fast loops.
The QDaqDataBuffer may be also used as a static object outside of a loop. Data may be appended by the push() function.
Definition at line 34 of file QDaqDataBuffer.h.
|
slot |
Append a new row of values.
v | Vector of data values. v.size() must be equal to size(). |
Definition at line 357 of file QDaqDataBuffer.cpp.
|
protectedvirtual |
Read contents of the object from a H5 group.
The base class implementation reads all properties (static & dynamic) from corresponding datasets of the HDF5 file group.
Reimplement in QDaqObject descendants to read additional data.
g | HDF5 Group object |
Reimplemented from QDaqObject.
Definition at line 46 of file QDaqH5Serialize.cpp.
|
protectedvirtual |
Perform the QDaqDataBuffer tasks within a loop.
The following tasks are performed at each loop repetition
Reimplemented from QDaqJob.
Definition at line 251 of file QDaqDataBuffer.cpp.
|
protectedvirtual |
Write contents of the object to a H5 group.
The base class implementation writes all properties (static & dynamic) as datasets of the HDF5 file group.
Reimplement in QDaqObject descendants to write additional data.
g | HDF5 Group object |
Reimplemented from QDaqObject.
Definition at line 22 of file QDaqH5Serialize.cpp.