Commit 4869c598 authored by Ralph Lange's avatar Ralph Lange
Browse files

uasdk: only push to DataElement for readComplete or monitor=y

(fixes #49)
parent 665f6023
......@@ -193,21 +193,23 @@ void
DataElementUaSdk::setIncomingData (const UaVariant &value, ProcessReason reason)
{
if (isLeaf()) {
Guard(pconnector->lock);
bool wasFirst = false;
// Make a copy of this element and cache it
incomingData = value;
// Make another copy of the value for this element and put it on the queue
UpdateUaSdk *u(new UpdateUaSdk(getIncomingTimeStamp(), reason, value, getIncomingReadStatus()));
incomingQueue.pushUpdate(std::shared_ptr<UpdateUaSdk>(u), &wasFirst);
if (debug() >= 5)
std::cout << "Element " << name << " set data ("
<< processReasonString(reason)
<< ") for record " << pconnector->getRecordName()
<< " (queue use " << incomingQueue.size()
<< "/" << incomingQueue.capacity() << ")" << std::endl;
if (wasFirst)
pconnector->requestRecordProcessing(reason);
if (reason == ProcessReason::readComplete || pconnector->plinkinfo->monitor) {
Guard(pconnector->lock);
bool wasFirst = false;
// Make a copy of this element and cache it
incomingData = value;
// Make another copy of the value for this element and put it on the queue
UpdateUaSdk *u(new UpdateUaSdk(getIncomingTimeStamp(), reason, value, getIncomingReadStatus()));
incomingQueue.pushUpdate(std::shared_ptr<UpdateUaSdk>(u), &wasFirst);
if (debug() >= 5)
std::cout << "Element " << name << " set data ("
<< processReasonString(reason)
<< ") for record " << pconnector->getRecordName()
<< " (queue use " << incomingQueue.size()
<< "/" << incomingQueue.capacity() << ")" << std::endl;
if (wasFirst)
pconnector->requestRecordProcessing(reason);
}
} else {
if (debug() >= 5)
std::cout << "Element " << name << " splitting data structure to "
......
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