XORDE
v1.0
eXtensible Operational Robotic Development Environment
|
Component-side ONB Object. More...
#include <onbobject.h>
Public Member Functions | |
ONBObject () | |
Default constructor. More... | |
ONBObject< T > & | min (const T &value) |
Set the minimum value of the object. More... | |
ONBObject< T > & | max (const T &value) |
Set the maximum value of the object. More... | |
ONBObject< T > & | def (const T &value) |
Set the default value of the object. More... | |
ONBObject< T > & | step (const T &value) |
Set the step value of the object. More... | |
ONBObject< T > & | MMD (const T &minValue, const T &maxValue, const T &defValue) |
Set the minimum, maximum and default value of the object. More... | |
ONBObject< T > & | mime (const QString &value) |
Set the mime-type of the object. More... | |
ONBObject< T > & | hint (const QString &value) |
Set the human-readable description of the object. More... | |
ONBObject< T > & | unit (const QString &value) |
Set the unit of the object. More... | |
ONBObject< T > & | opt (const QString &value) |
Set the optional text associated to the object. More... | |
ONBObject< T > & | sampling (std::chrono::milliseconds value) |
Set the default sampling interval of the object. More... | |
template<typename... Args> | |
ONBObject< T > & | enumeration (QString s, Args...a) |
Specify the list of the enumeration object values. More... | |
template<typename... Args> | |
ONBObject< T > & | enumeration (QStringList list) |
Specify the names of the enumeration object with given string list. More... | |
Public Member Functions inherited from ObjectInfo | |
ObjectInfo () | |
Common constructor. Initializes unbound object. | |
ObjectInfo (const ObjectDescription &desc) | |
Construct Object with given description. More... | |
ObjectInfo (const ObjectInfo &other)=delete | |
no copy allowed!! | |
const ObjectDescription & | description () const |
Get description of the object. More... | |
QString | name () const |
Get name of the object. More... | |
Flags | flags () const |
Get access flags. | |
int | RMIP () const |
Get default sampling interval. | |
unsigned long | timestamp () const |
Get timestamp of the last received value. | |
QJsonObject | createJsonInfo () const |
Create JSON object with info about the ONB Object. More... | |
bool | isVolatile () const |
Test an access flag. | |
bool | isReadable () const |
Test an access flag. | |
bool | isWritable () const |
Test an access flag. | |
bool | isStorable () const |
Test an access flag. | |
bool | isDual () const |
Test an access flag. | |
bool | isHidden () const |
Test an access flag. | |
bool | isFunction () const |
Test an access flag. | |
bool | isArray () const |
Test an access flag. | |
bool | hasMinimum () const |
Test a meta-value flag. | |
bool | hasMaximum () const |
Test a meta-value flag. | |
bool | hasDefault () const |
Test a meta-value flag. | |
bool | hasStep () const |
Test a meta-value flag. | |
bool | hasMimeType () const |
Test a meta-value flag. | |
bool | hasHint () const |
Test a meta-value flag. | |
bool | hasUnit () const |
Test a meta-value flag. | |
bool | hasOptions () const |
Test a meta-value flag. | |
bool | hasExtInfo () const |
Test a meta-value flag. | |
bool | isEnum () const |
Test a meta-value flag. | |
Additional Inherited Members | |
Public Types inherited from ObjectInfo | |
enum | Flags |
Access flags of the Object. More... | |
enum | Type |
Supported types of the object. More... | |
Component-side ONB Object.
It used for data exchange between components.
ONBObject contains variable binding and meta-information about it such as name, type, size, access flags and meta-values. Assigning meta-values is provided by methods min(), max() etc. that return a reference to the object, so you can write meta-description of the object in one line. All meta-values are optional.
To create ONB objects use convenient methods of ComponentBase class.
Default constructor.
Sets ONB Object to contain ExtInfo since ONB protocol v2. You shouln't create ONBObject explicitly. Use more convenient methods of ComponentBase class instead.
Set the default value of the object.
value | The default value to be set. |
|
inline |
Specify the list of the enumeration object values.
The object can be bound to integer variable, the string or the native enumeration. If the object bound to integer variable, it defines the minimum and maximum values as 0 and (count-1) respectively. If the object bound to the string, the given names are the possible values of the string.
s | The first string to be set. |
a | The next strings, you can provide arbitrary argument count. |
|
inline |
Specify the names of the enumeration object with given string list.
This is overloaded function.
list | The string list to be set. |
Set the human-readable description of the object.
The description helps users to understand purpose of the object.
For example, if you'd develop some kind of PID controller you probably should write like this:
value | The string containing description to be set. |
Set the maximum value of the object.
value | The maximum value to be set. |
Set the mime-type of the object.
Mime-type is arbitrary text used for specifying content of the object.
For example:
value | The string containing mime-type to be set. |
Set the minimum value of the object.
value | The minimum value to be set. |
|
inline |
Set the minimum, maximum and default value of the object.
The method is implemented as consequent call to min(), max() and def() and can be used to simplify the code.
minValue | The minimum value to be set. |
maxValue | The maximum value to be set. |
defValue | The default value to be set. |
Set the optional text associated to the object.
Can contain arbitrary text, but some special words are used for UI enhancement.
value | The string of optional text to be set. |
|
inline |
Set the default sampling interval of the object.
It is applicable to inputs or outputs and denotes the recommended time interval to request or send the value of the object. If the sampling interval is set, the object will include timestamp. and can be used in real-time dataflow.
value | The sampling interval. If the special value of zero is set, the object will be sent as soon as it is touched. |
Set the step value of the object.
Step is used commonly for changing the value in discrete steps.
value | The step value to be set. |
Set the unit of the object.
Unit is arbitrary text used for specifying measure of the value of the object.
value | The string containing unit to be set. |