QDaq
0.2.6
Qt-based Data Aqcuisition
|
A class that represent a stream of numerical data, a signal. More...
#include <QDaqChannel.h>
Public Types | |
enum | ChannelType { Normal, Clock, Random, Inc, Dec } |
Type of the channel. More... | |
enum | AveragingType { None, Running, Delta, ForgettingFactor, Median } |
Type of channel averaging. More... | |
enum | NumberFormat { General, FixedPoint, Scientific, Time } |
Type of format for textual representation of channel data. More... | |
Public Slots | |
void | push (double v) |
Insert a value into the channel. More... | |
void | clear () |
Clear internal channel memory. More... | |
double | value () const |
Get the current channel value. More... | |
double | std () const |
Get the current channel value standard deviation. More... | |
![]() | |
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. | |
Public Member Functions | |
virtual void | detach () |
Detach this QDaqObject from the QDaq tree. More... | |
virtual QString | formatedValue () |
Returns the channel value formatted according to format/digits. | |
![]() | |
Q_INVOKABLE | QDaqJob (const QString &name) |
QDaqJob constructor. More... | |
virtual void | attach () |
Attach this QDaqObject to 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. | |
Protected Member Functions | |
virtual bool | arm_ () |
Performs internal initialization for the job. More... | |
virtual bool | run () |
Perform channel tasks. 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... | |
virtual void | writeh5 (H5::Group *g, QDaqH5File *f) const |
Write contents of the object to a H5 group. More... | |
virtual void | readh5 (H5::Group *g, QDaqH5File *f) |
Read contents of the object from a H5 group. More... | |
Properties | |
ChannelType | type |
Type of the channel. | |
QString | signalName |
User supplied signal name. More... | |
QString | unit |
User supplied unit of measurement. More... | |
NumberFormat | format |
Option for formatting channel data for textual representation. More... | |
int | digits |
Number of decimal digits to display. More... | |
QDaqVector | range |
Signal range. More... | |
double | offset |
Channel offset. More... | |
double | multiplier |
Channel multiplier. More... | |
AveragingType | averaging |
Type of on-line averaging. | |
double | forgettingFactor |
Forgetting factor value. More... | |
uint | depth |
Averaging depth. More... | |
uint | memsize |
Channel memory used. More... | |
bool | dataReady |
True if valid data exist on the channel. More... | |
QString | parserExpression |
muParser Expression. More... | |
![]() | |
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. | |
![]() | |
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 represent a stream of numerical data, a signal.
Real time data is handeled in QDaq through the QDaqChannel class. E.g., an instrument provides measurement data through QDaqChannel objects.
QDaqChannel provides tools for displaying, transforming, averaging the data of the channel.
Definition at line 28 of file QDaqChannel.h.
Type of channel averaging.
Definition at line 104 of file QDaqChannel.h.
Type of the channel.
Definition at line 93 of file QDaqChannel.h.
Type of format for textual representation of channel data.
Enumerator | |
---|---|
General |
No special formating. |
FixedPoint |
No special formating. |
Scientific |
No special formating. |
Time |
No special formating. |
Definition at line 115 of file QDaqChannel.h.
|
protectedvirtual |
Performs internal initialization for the job.
It is called by the setArmed() function.
This function can be reimplemented to perform specific initialization for a job. The parent class arm_() function should be called afterwards.
In the default implementation, if a loopEngine() exists the script code is checked against the script engine for errors.
If initialization is sucessfull it returns true, otherwise the function returns false.
Reimplemented from QDaqJob.
Definition at line 130 of file QDaqChannel.cpp.
|
slot |
Clear internal channel memory.
Definition at line 297 of file QDaqChannel.cpp.
|
virtual |
Detach this QDaqObject from the QDaq tree.
This function is called just before the object becomes detached from the QDaq tree.
In the base class implementation it first calls detach() for each child QDaqObject and then signal root that the object is removed from the qdaq tree.
Subclasses may reimplement this function to perform needed actions before detaching.
Reimplemented from QDaqJob.
Definition at line 32 of file QDaqChannel.cpp.
|
inlineslot |
Insert a value into the channel.
Definition at line 214 of file QDaqChannel.h.
|
protectedvirtual |
Perform channel tasks.
The tasks are performed in the following order:
If new data is available the updateWidgets signal is emitted.
Reimplemented from QDaqJob.
Definition at line 214 of file QDaqChannel.cpp.
|
inlineslot |
Get the current channel value standard deviation.
Definition at line 220 of file QDaqChannel.h.
|
inlineslot |
Get the current channel value.
Definition at line 218 of file QDaqChannel.h.
|
read |
True if valid data exist on the channel.
If dataReady is true, then value() & std() return valid numbers.
Definition at line 83 of file QDaqChannel.h.
|
readwrite |
Averaging depth.
Number of past data values used in averaging.
Definition at line 75 of file QDaqChannel.h.
|
readwrite |
Number of decimal digits to display.
Used when displaying the channel in fixed or scientific format.
Definition at line 50 of file QDaqChannel.h.
|
readwrite |
Forgetting factor value.
Only used when this type of averaging is active.
Definition at line 71 of file QDaqChannel.h.
|
readwrite |
Option for formatting channel data for textual representation.
Used when displaying the channel.
Definition at line 46 of file QDaqChannel.h.
|
read |
Channel memory used.
Number of values stored in internal channel memory.
Definition at line 79 of file QDaqChannel.h.
|
readwrite |
Channel multiplier.
Applied imediately when data is inserted in the channel by the transformation y=a*x+b. b is the offset and a is the multiplier.
Definition at line 64 of file QDaqChannel.h.
|
readwrite |
Channel offset.
Applied imediately when data is inserted in the channel by the transformation y=a*x+b. b is the offset and a is the multiplier.
Definition at line 59 of file QDaqChannel.h.
|
readwrite |
muParser Expression.
If set the expression is executed on the channel data. Note that the data goes first through muParser and then they are scaled with multiplier and offset.
Definition at line 88 of file QDaqChannel.h.
|
readwrite |
Signal range.
When the signal is outside the range an error is raised.
Definition at line 54 of file QDaqChannel.h.
|
readwrite |
User supplied signal name.
Used when displaying the channel. It is different from the object name.
Definition at line 38 of file QDaqChannel.h.
|
readwrite |
User supplied unit of measurement.
Used when displaying the channel.
Definition at line 42 of file QDaqChannel.h.