pvAlarm, pvTimeStamp, pvControl, pvDisplay: only put to fields that have changed

This commit is contained in:
mrkraimer
2017-10-16 10:00:22 -04:00
parent a88d491012
commit 6fdeadf171
5 changed files with 89 additions and 19 deletions

View File

@@ -70,10 +70,25 @@ bool PVControl::set(Control const & control)
throw std::logic_error(notAttached);
}
if(pvLow->isImmutable() || pvHigh->isImmutable() || pvMinStep->isImmutable()) return false;
pvLow->put(control.getLow());
pvHigh->put(control.getHigh());
pvMinStep->put(control.getMinStep());
return true;
Control current;
get(current);
bool returnValue = false;
if(current.getLow()!=control.getLow())
{
pvLow->put(control.getLow());
returnValue = true;
}
if(current.getHigh()!=control.getHigh())
{
pvHigh->put(control.getHigh());
returnValue = true;
}
if(current.getMinStep()!=control.getMinStep())
{
pvMinStep->put(control.getMinStep());
returnValue = true;
}
return returnValue;
}
}}