Commit 675c2776 authored by Nicolas Tappret's avatar Nicolas Tappret

improve memoried value with infinity and nan value. Improve the no cache...

improve memoried value with infinity and nan value. Improve the no cache gesture for grouped readspectrum
parent f2f670aa
......@@ -563,10 +563,19 @@ void AttributeCombiner::add_dynamic_attributes()
stringstream ss;
for (int i = 0; i < size; i++) {
tolower(splited[i]);
if( splited[i] == "nan"){
item->refData[i] = NAN;
}else if( splited[i] == "inf" ){
item->refData[i] = INFINITY;
}else if( splited[i] == "-inf" ){
item->refData[i] = -1*INFINITY;
}else{
ss.clear();
ss << splited[i];
ss >> item->refData[i];
}
}
this->get_device_attr()->get_w_attr_by_name(name.c_str()).set_write_value(item->refData, size);
} catch (Tango::DevFailed &ex) {
......@@ -1185,13 +1194,12 @@ void AttributeCombiner::add_dynamic_commands()
void AttributeCombiner::READSPECTRUM(Tango::Attribute &attr, ATTITEM *item, Tango::GroupAttrReplyList arl[]) {
// Read spectrum attribute and combime them to multiple spectrum
Tango::DevULong length;
Tango::DevLong length;
int nbAtt = (int) item->attNames.size();
int nbDev = deviceGroup->get_size();
int size = nbDev * nbAtt;
if (isNumber(item->lengthAttName))
length = atol(item->lengthAttName.c_str());
else
......@@ -1301,13 +1309,14 @@ void AttributeCombiner::add_dynamic_commands()
return;
}
if(!item->isSpectrum) {
bool needCacheUpdate = (item->lastUpdate + refreshTime) < timeMS() || item->cacheData == nullptr;
if (!needCacheUpdate) {
setValueGoodCacheType(attr, item);
return;
}
}
Tango::GroupAttrReplyList arl[MAXATTRIBUTE];
......
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