Commit 8d637cf1 authored by Jean-Luc Pons's avatar Jean-Luc Pons

Fixed bug for length attribute

parent 84a5901b
......@@ -1213,8 +1213,40 @@ void AttributeCombiner::add_dynamic_commands()
if (isNumber(item->lengthAttName))
length = atol(item->lengthAttName.c_str());
else
self->read_attribute(item->lengthAttName) >> length;
else {
Tango::DeviceAttribute da = self->read_attribute(item->lengthAttName);
switch( da.get_type() ) {
case Tango::DEV_SHORT: {
Tango::DevShort val;
da >> val;
length = (Tango::DevLong) val;
}
break;
case Tango::DEV_USHORT: {
Tango::DevUShort val;
da >> val;
length = (Tango::DevLong) val;
}
break;
case Tango::DEV_LONG: {
da >> length;
}
break;
case Tango::DEV_ULONG: {
Tango::DevULong val;
da >> val;
length = (Tango::DevLong) val;
}
break;
default:
Tango::Except::throw_exception(
(const char *) "AttributeCombiner::error_read",
(const char *) "Type unsupported for attLength",
(const char *) "AttributeCombiner::read_dynspec_attributes");
}
}
int blockSize = length * nbAtt;
Tango::DevDouble *result = new Tango::DevDouble[length * size];
......
Markdown is supported
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