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,9 +563,18 @@ void AttributeCombiner::add_dynamic_attributes() ...@@ -563,9 +563,18 @@ void AttributeCombiner::add_dynamic_attributes()
stringstream ss; stringstream ss;
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
ss.clear(); tolower(splited[i]);
ss << splited[i]; if( splited[i] == "nan"){
ss >> item->refData[i]; 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); this->get_device_attr()->get_w_attr_by_name(name.c_str()).set_write_value(item->refData, size);
...@@ -1185,13 +1194,12 @@ void AttributeCombiner::add_dynamic_commands() ...@@ -1185,13 +1194,12 @@ void AttributeCombiner::add_dynamic_commands()
void AttributeCombiner::READSPECTRUM(Tango::Attribute &attr, ATTITEM *item, Tango::GroupAttrReplyList arl[]) { void AttributeCombiner::READSPECTRUM(Tango::Attribute &attr, ATTITEM *item, Tango::GroupAttrReplyList arl[]) {
// Read spectrum attribute and combime them to multiple spectrum // Read spectrum attribute and combime them to multiple spectrum
Tango::DevULong length; Tango::DevLong length;
int nbAtt = (int) item->attNames.size(); int nbAtt = (int) item->attNames.size();
int nbDev = deviceGroup->get_size(); int nbDev = deviceGroup->get_size();
int size = nbDev * nbAtt; int size = nbDev * nbAtt;
if (isNumber(item->lengthAttName)) if (isNumber(item->lengthAttName))
length = atol(item->lengthAttName.c_str()); length = atol(item->lengthAttName.c_str());
else else
...@@ -1301,12 +1309,13 @@ void AttributeCombiner::add_dynamic_commands() ...@@ -1301,12 +1309,13 @@ void AttributeCombiner::add_dynamic_commands()
return; return;
} }
if(!item->isSpectrum) {
bool needCacheUpdate = (item->lastUpdate + refreshTime) < timeMS() || item->cacheData == nullptr;
bool needCacheUpdate = (item->lastUpdate + refreshTime) < timeMS() || item->cacheData == nullptr; if (!needCacheUpdate) {
setValueGoodCacheType(attr, item);
if (!needCacheUpdate) { return;
setValueGoodCacheType(attr, item); }
return;
} }
Tango::GroupAttrReplyList arl[MAXATTRIBUTE]; 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