Commit 3f8b2a54 authored by Jean-Luc Pons's avatar Jean-Luc Pons
Browse files

Added DevEnum Type

parent dc3dcc2d
...@@ -451,7 +451,22 @@ void AttributeCombiner::add_dynamic_attributes() ...@@ -451,7 +451,22 @@ void AttributeCombiner::add_dynamic_attributes()
// We group all blm attribute in only one (for scalar only) // We group all blm attribute in only one (for scalar only)
DynAttribute *att = new DynAttribute(name.c_str(), type, rwType,expert); DynAttribute *att = new DynAttribute(name.c_str(), type, rwType,expert);
add_attribute(att); add_attribute(att);
if( type==Tango::DEV_ENUM ) {
// Retrieve the enum list from the first attribute
// All grouped attributes must have the same list
// get_device starts at one !!!!!
Tango::AttributeInfoEx ae = deviceGroup->get_device(1)->get_attribute_config(attNames[0]);
Tango::Attribute &eAtt = get_device_attr()->get_attr_by_name(name.c_str());
Tango::MultiAttrProp<Tango::DevEnum> presetProps;
eAtt.get_properties(presetProps);
presetProps.enum_labels = ae.enum_labels;
eAtt.set_properties(presetProps);
}
} else { } else {
...@@ -811,6 +826,9 @@ void AttributeCombiner::read_dyn_attributes(Tango::Attribute &attr, DynAttribute ...@@ -811,6 +826,9 @@ void AttributeCombiner::read_dyn_attributes(Tango::Attribute &attr, DynAttribute
case Tango::DEV_DOUBLE: case Tango::DEV_DOUBLE:
READG(attr,item->dVal,item,arl); READG(attr,item->dVal,item,arl);
break; break;
case Tango::DEV_ENUM:
READG(attr,item->eVal,item,arl);
break;
} }
...@@ -1031,6 +1049,13 @@ void AttributeCombiner::read_dynspec_attributes(Tango::Attribute &attr,DynSpectr ...@@ -1031,6 +1049,13 @@ void AttributeCombiner::read_dynspec_attributes(Tango::Attribute &attr,DynSpectr
READSCALAR<Tango::DevBoolean, Tango::DevDouble>(attr,item,arl,NAN,NAN); READSCALAR<Tango::DevBoolean, Tango::DevDouble>(attr,item,arl,NAN,NAN);
break; break;
case Tango::DEV_ENUM:
if(item->isSpectrum)
READSPECTRUM<Tango::DevEnum>(attr,item,arl);
else
READSCALAR<Tango::DevEnum, Tango::DevDouble>(attr,item,arl,NAN,NAN);
break;
case Tango::DEV_USHORT: case Tango::DEV_USHORT:
if(item->isSpectrum) if(item->isSpectrum)
READSPECTRUM<Tango::DevUShort>(attr,item,arl); READSPECTRUM<Tango::DevUShort>(attr,item,arl);
...@@ -1289,7 +1314,9 @@ int AttributeCombiner::ToTangoType(string name,string type) { ...@@ -1289,7 +1314,9 @@ int AttributeCombiner::ToTangoType(string name,string type) {
return Tango::DEV_ULONG64; return Tango::DEV_ULONG64;
} else if ( type.compare("DevDouble")==0 ) { } else if ( type.compare("DevDouble")==0 ) {
return Tango::DEV_DOUBLE; return Tango::DEV_DOUBLE;
} else { } else if ( type.compare("DevEnum")==0 ) {
return Tango::DEV_ENUM;
} else {
cerr << "ERROR: Wrong attribute configuration property for " << name << endl; cerr << "ERROR: Wrong attribute configuration property for " << name << endl;
cerr << "Data type " << type << " not supported" << endl; cerr << "Data type " << type << " not supported" << endl;
exit(0); exit(0);
......
...@@ -56,6 +56,7 @@ typedef struct _ATTITEM { ...@@ -56,6 +56,7 @@ typedef struct _ATTITEM {
Tango::DevULong ulVal; Tango::DevULong ulVal;
Tango::DevULong64 ulVal64; Tango::DevULong64 ulVal64;
Tango::DevDouble dVal; Tango::DevDouble dVal;
Tango::DevEnum eVal;
// Reference data // Reference data
bool isRef; bool isRef;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment