XORDE  v1.0
eXtensible Operational Robotic Development Environment
Signals | Public Member Functions | List of all members
ModuleBaseONB Class Referenceabstract

The base class for XORDE module. More...

#include <ModuleBaseONB.h>

Inheritance diagram for ModuleBaseONB:
ModuleBaseAppONB

Signals

void componentCreated (unsigned short id)
 Notify when the component is created with assigned componentID by the core. More...
 

Public Member Functions

 ModuleBaseONB (QObject *parent=nullptr)
 Default constructor. Runs timestamp timer.
 
 ~ModuleBaseONB ()
 It had to destroy the components but something went wrong.
 
template<class T >
void declareComponent (T *component)
 Declare the ONB component. More...
 
void setIcon (QImage icon)
 Set an icon to the module. More...
 
void setIcon (QString filename)
 Set an icon to the module from file. More...
 
ComponentBasecomponent (unsigned short id)
 Get the component by id. More...
 
void log (QString message)
 Send the arbitrary message to the core's log output.
 
QList< QJsonObject > getClassesInfo () const
 WHY?? it must be in proxy!
 
QJsonArray getComponentsConfigList () const
 it's too.
 
virtual QJsonObject getJsonConfig () const
 why?? why it is located here?
 

Detailed Description

The base class for XORDE module.

XORDE module has an unique name, icon and contains a list of ONB components.

These components are self-describing by means of ONB protocol. They have its own name, icon, version info etc. and list of the Objects.

Object is bound to a certain variable, and its value is changed by accessing the variable. Data exchange is performed by implicit or explicit transferring the objects.

The ModuleBaseONB class contains methods to declare and manage components.
If you want to create an external module, use ModuleBaseAppONB.

See also
ModuleBaseAppONB, ComponentBase, ONBObject

Member Function Documentation

ComponentBase* ModuleBaseONB::component ( unsigned short  id)
inline

Get the component by id.

Parameters
idcomponentID assigned by the core.
Returns
Pointer to the component. Returns false if the component with the given componentID does not exist
void ModuleBaseONB::componentCreated ( unsigned short  id)
signal

Notify when the component is created with assigned componentID by the core.

Parameters
idAssigned componentID of the created component.
template<class T >
void ModuleBaseONB::declareComponent ( T *  component)
inline

Declare the ONB component.

The component must be derived from ComponentBase.

declareComponent(new MyONBComponent);
Parameters
componentThe component to declare.
void ModuleBaseONB::setIcon ( QImage  icon)

Set an icon to the module.

Component icon is used in the UI.

Parameters
iconThe image containing icon.
void ModuleBaseONB::setIcon ( QString  filename)

Set an icon to the module from file.

This is an overloaded method.

Parameters
filenameName of icon file. Supported formats matches ones in Qt's QImage.