QDaq
0.2.6
Qt-based Data Aqcuisition
|
QDaq root object class. More...
#include <QDaqRoot.h>
Public Slots | |
QStringList | classNames () |
Return the names of registered object classes. | |
![]() | |
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. | |
Signals | |
void | daqWindowsChanged () |
Fired when a top level window is opened or closed. | |
void | objectAttached (QDaqObject *obj) |
Fired when object is attached. | |
void | objectDetached (QDaqObject *obj) |
Fired when object is detached. | |
![]() | |
void | propertiesChanged () |
Fired when object properties have changed. | |
void | updateWidgets () |
Fired when widgets need update. | |
Public Member Functions | |
QDaqObject * | createObject (const QString &name, const QString &className) |
Create a QDaqObject with name name and class className. More... | |
void | postError (const QDaqError &e) |
Called to post an error at the QDaq error queue. More... | |
QWidgetList | daqWindows () const |
Return a list of QDaq top level windows. | |
QDaqIDE * | ideWindow () |
Return a pointer to the QDaq IDE window. | |
QDaqIDE * | createIdeWindow () |
Create the QDaq IDE window and return a pointer to it. | |
QDaqSession * | rootSession () |
Returns a pointer to the root script session. | |
const QDaqErrorQueue * | errorQueue () const |
Returns a pointer to the QDaq error queue. | |
void | registerClass (const QMetaObject *metaObj) |
Register a QDaqObject-derived class type Registered classes can be created by createObject(). More... | |
QList< const QMetaObject * > | registeredClasses () const |
Returns list of registered class metaObjects. | |
![]() | |
Q_INVOKABLE | QDaqObject (const QString &name) |
Construct a QDaqObject with a name. More... | |
virtual void | attach () |
Attach this QDaqObject to the QDaq tree. More... | |
virtual void | detach () |
Detach this QDaqObject from the QDaq tree. More... | |
bool | isAttached () const |
Returns true is this object is attached to the QDaq tree. | |
Properties | |
QString | rootDir |
The application root directory. | |
QString | logDir |
The directory where log files are written. | |
Additional Inherited Members | |
![]() | |
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. | |
![]() | |
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... | |
QDaq root object class.
At the top of the QDaq tree structure there is an object of type QDaqRoot. It is a subclass of QDaqObject.
The QDaq root is a single static object which can be accessed by QDaqObject::root().
The QDaq root should be instantiated in the main function, after QApplication.
The name of QDaq root is "qdaq".
A number of static items available to all QDaq objects are defined under QDaqRoot:
Definition at line 59 of file QDaqRoot.h.
QDaqObject * QDaqRoot::createObject | ( | const QString & | name, |
const QString & | className | ||
) |
Create a QDaqObject with name name and class className.
Calls the constructor of className with name as the single argument.
The class with name className must be previously be registered with registerClass.
Typically used by QDaqScriptEngine to create QDaq objects in script code.
Definition at line 98 of file QDaqRoot.cpp.
|
inline |
Called to post an error at the QDaq error queue.
This function is thread safe.
Definition at line 101 of file QDaqRoot.h.
void QDaqRoot::registerClass | ( | const QMetaObject * | metaObj | ) |
Register a QDaqObject-derived class type Registered classes can be created by createObject().
metaObj | meta-object of the class |
Definition at line 120 of file QDaqRoot.cpp.