cumbia-tango 1.x
C++ multi threaded library based on cumbia and the Tango control system
|
Key | Type | Value | Description | Notes |
---|---|---|---|---|
type | string | "property" | Identifies a configuration content within CuData | Fixed value to identify the type of CuData |
src | string | - | The source name as configured with setSource. Tango device / attribute | src key always present in CuData |
value | CuVariant | - | The attribute value that is normally fetched during the configuration. | - |
data | bool | true | A CuData with configuration data will have the "data" key always set to true | - |
msg | string | - | A message bearing information about the success of the operation. | See the err key below |
err | bool | - | true if an error occurred, false otherwise | See the msg key above |
df | Tango::AttrDataFormat (enum) | - | Tango attribute format, Scalar,Spectrum,... | convert with toInt() |
dfs | string | - | string representation of data_format | - |
data_type | int | - | Tango data type | - |
description | string | - | Tango attribute description from AttributeInfo | - |
display_unit | string | - | Tango display unit from AttributeInfo | - |
standard_unit | string | - | Tango standard unit from AttributeInfo | - |
unit | string | - | Tango "unit" from AttributeInfo | - |
label | string | - | Tango "label" from AttributeInfo | - |
writable | Tango::AttrWriteType | - | Tango write type (enum) { READ, READ_WITH_WRITE, WRITE, READ_WRITE, WT_UNKNOWN } | convert with toInt() |
writable_attr_name | string | - | writable_attr_name from AttributeInfo | - |
max_alarm | string | - | Tango::AttributeAlarmInfo max_alarm | devapi.h |
min_alarm | string | - | Tango::AttributeAlarmInfo min_alarm | devapi.h |
max_warning | string | - | Tango::AttributeAlarmInfo max_warning | devapi.h |
min_warning | string | - | Tango::AttributeAlarmInfo min_warning | devapi.h |
delta_t | string | - | Tango::AttributeAlarmInfo delta_t | devapi.h |
delta_val | string | - | Tango::AttributeAlarmInfo delta_val | devapi.h |
archive_abs_change | string | - | Tango::AttributeEventInfo.arch_event.archive_abs_change | devapi.h |
archive_rel_change | string | - | Tango::AttributeEventInfo.arch_event.archive_rel_change | devapi.h |
archive_period | string | - | Tango::AttributeEventInfo.arch_event.archive_period | devapi.h |
abs_change | string | - | Tango::AttributeEventInfo.ch_event.abs_change | devapi.h |
rel_change | string | - | Tango::AttributeEventInfo.ch_event.rel_change | devapi.h |
periodic_period | string | - | Tango::AttributeEventInfo.per_event.period | devapi.h |
max | string | - | Tango AttributeConfig max_value | Named "max" for consistency with Epics |
min | string | - | Tango AttributeConfig min_value | Named "min" for consistency with Epics |
name | string | - | Tango name string from AttributeInfo | - |
max_dim_x | int | - | Tango attribute max x dimension | - |
max_dim_y | int | - | Tango attribute max y dimension | - |
disp_level | Tango::DispLevel | - | Tango::DispLevel from AttributeInfoEx (lib/cpp/server/idl/tango.h: { OPERATOR, EXPERT, DL_UNKNOWN) } | convert with toInt() |
root_attr_name | string | - | from AttributeInfoEx: Root attribute name (in case of forwarded attribute) | - |
description | string | - | Tango attribute description from AttributeInfo | - |
display_unit | string | - | Tango display unit from AttributeInfo | - |
standard_unit | string | - | Tango standard unit from AttributeInfo | - |
unit | string | - | Tango "unit" from AttributeInfo | - |
success | string | - | A string with the name of the color provided the class CuTangoWorldConfig associated to an error/success | Can be used to decorate widgets |
Key | Type | Value | Description | Notes |
---|---|---|---|---|
type | string | "property" | Identifies a configuration content within CuData | Fixed value to identify the type of CuData |
src | string | - | The source name as configured with setSource. Tango device / attribute | src |
data | bool | true | A CuData with configuration data will have the "data" key always set to true | - |
msg | string | - | A message bearing information about the success of the operation. | See the err key below |
err | bool | - | true if an error occurred, false otherwise | See the msg key abovekey always present in CuData |
value | CuVariant | - | The attribute value that is normally fetched during the configuration. | - |
cmd_name | string | - | The command name, from Tango::CommandInfo | from Tango::CommandInfo, devapi.h |
in_type | long | - | Input parameter data type | from Tango::CommandInfo, devapi.h |
out_type | long | - | Output parameter data type | from Tango::CommandInfo, devapi.h |
dt | long | - | Output parameter type, same as "out_type", in order to be consistent with attribute configuration CuData | see CuData "data_type" from attribute configuration above |
in_type_desc | string | - | Input parameter description | from Tango::CommandInfo, devapi.h |
out_type_desc | string | - | Output parameter description | from Tango::CommandInfo, devapi.h |
df | Tango::AttrDataFormat (enum) | - | Provided for consistency with attribute configuration CuData, determined from CommandInfo out_type | see CuData "df" from attribute configuration above |
color | string | - | A string with the name of the color provided the class CuTangoWorldConfig associated to an error/success | Can be used to decorate widgets |
In this example, we discuss how a plot is configured using the CuData with "type" set to "property".
When reading attributes, the key/values you should expect to find within the CuData are shown in the following table:
Key | Type | Value | Description | Notes |
---|---|---|---|---|
data | bool | true | A CuData with configuration data will have the "data" key always set to true | - |
src | string | - | The source name as configured with setSource. Tango device / attribute | src |
msg | string | - | A message bearing information about the success of the operation. | See the err key below |
err | bool | - | true if an error occurred, false otherwise | See the msg key abovekey always present in CuData |
color | string | - | A string with the name of the color provided the class CuTangoWorldConfig associated to an error/success | Can be used to decorate widgets |
timestamp_ms | time_t + suseconds_t | - | Timestamp as integer: a struct timeval is used to store the timestamp. Formula: tiv.tv_sec * 1000 + tiv.tv_usec / 1000; | can convert with toLongInt() |
timestamp_us | double | - | timestamp in a double: seconds.microseconds: static_cast<double>(tiv.tv_sec) + static_cast<double>(tiv.tv_usec) * 1e-6 | convert with toDouble |
q | const Tango::AttrQuality | - | Tango attribute quality { ATTR_VALID, ATTR_INVALID, ATTR_ALARM, ATTR_CHANGING, ATTR_WARNING } | from server/idl/tango.h. Convert with toInt |
qc | string | - | A string with the name of the color provided the class CuTangoWorldConfig | can be used to decorate widgets. Use in combination with QuPalette. Convert with toString |
dfs | string | - | Data format as string ("scalar", "vector", matrix", "data format unknown") | consistent naming across tango and epics |
value | CuVariant | - | The attribute value. (read) | The tango read value |
value | string | - | For Tango::DEV_STATE attribute types, the state is mapped into its string representation. | Convenience conversion applied only for DEV_STATE attribute data type. |
w_value | CuVariant | - | The attribute write value. Available if the attribute is read/write, key missing otherwise. | Tango write value in read/write attributes |
sc | string | - | state color: a string describing a color for a Tango::DEV_STATE, configuration possible through CuTangoWorldConfig. | Can be used to decorate a widget. Available only if attribute.get_type() == Tango::DEV_STATE |
s | long int | - | A Tango::DEV_STATE casted to long int. Available for Tango::DEV_STATE attributes | Available only if attribute.get_type() == Tango::DEV_STATE |
When getting output arguments from commands, the key/values you should expect to find within the CuData are shown in the following table:
Key | Type | Value | Description | Notes |
---|---|---|---|---|
data | bool | true | A CuData with configuration data will have the "data" key always set to true | - |
src | string | - | The source name as configured with setSource. Tango device / attribute | src |
msg | string | - | A message bearing information about the success of the operation. | See the err key below |
err | bool | - | true if an error occurred, false otherwise | See the msg key abovekey always present in CuData |
color | string | - | A string with the name of the color provided the class CuTangoWorldConfig associated to an error/success | Can be used to decorate widgets |
timestamp_ms | time_t + suseconds_t | - | Timestamp as integer: a struct timeval is used to store the timestamp. Formula: tiv.tv_sec * 1000 + tiv.tv_usec / 1000; | can convert with toLongInt() |
timestamp_us | double | - | timestamp in a double: seconds.microseconds: static_cast<double>(tiv.tv_sec) + static_cast<double>(tiv.tv_usec) * 1e-6 | convert with toDouble |
dfs | string | - | Data format as string ("scalar", "vector", matrix", "data format unknown") | consistent naming across tango and epics |
dt | int | - | Tango::CmdArgType casted to an int: enum CmdArgType {DEV_VOID = 0,DEV_BOOLEAN,DEV_SHORT,DEV_LONG,... } | From /lib/cpp/server/tango_const.h |
value | CuVariant | - | The attribute value. (read) | The tango read value |
value | string | - | For Tango::DEV_STATE attribute types, the state is mapped into its string representation. | Convenience conversion applied only for DEV_STATE attribute data type. |
sc | string | - | A string describing a color for a Tango::DEV_STATE, configuration possible through CuTangoWorldConfig. | Can be used to decorate a widget. Available only if attribute.get_type() == Tango::DEV_STATE |
s | long int | - | A Tango::DEV_STATE casted to long int. Available for Tango::DEV_STATE attributes | Available only if attribute.get_type() == Tango::DEV_STATE |
The contents of CuData when used to fetch properties from the database are more dynamic and depend on the type of property fetched: attribute, class or device. Please refer to the Writing an activity to read Tango device, attribute and class properties for more information and for an example of application reading from the tango database.
To fetch properties from the Tango database, a list of input CuData must be provided.
Key | Type | Description | Example |
---|---|---|---|
device | string | The tango device name | "test/device/1" |
name | string | The attribute property name | "description" |
Key | Type | Description | Example |
---|---|---|---|
device | string | The tango device name | "test/device/1" |
name | string | The device property name | "description" |
Key | Type | Description | Example |
---|---|---|---|
class | string | The class name of the device | "TangoTest" |
name | string | The property name | "description" |
The following code shows how to set up a list of CuData where every element describes the type and name of the property to be fetched. The PropertyReader class implements CuDataListener, so that when properties are available, the onUpdate method is invoked.
The result is again a CuData compiled as follows:
Key | Type | Description | Example | Notes |
---|---|---|---|---|
err | bool | true if an error occurred, false otherwise | if(data["err"].toBool() { ... error ... } | See the msg key below |
msg | string | A message bearing information about the success of the operation. | - | See the err key above |
list | vector of strings | The list of the properties contained in the result | "test/device/1/long_scalar:abs_change", "TangoTest:Description", "test/device/1:helperApplication" | use this to get the list of fetched properties |
property1 | CuVariant | The property value corresponding to the "property1" property | double abs_ch = std::stod(data["test/device/1/long_scalar:abs_change"].toString()); | always use toString, properties are fetched as strings |
property2 | CuVariant | The property value corresponding to the "property2" property | std::string helperApp = data["test/device/1:helperApplication"].toString(); | always use toString, properties are fetched as strings |
... | CuVariant | The i-th property value... | - | always use toString, properties are fetched as strings |
propertyN | CuVariant | The N-th property value corresponding to the "propertyN" property | std::string nthpropval = data["propertyN"].toString(); | always use toString, properties are fetched as strings |
and is delivered as argument of the onUpdate method.