void NTNDArrayRecord::update() { lock(); try { beginGroupPut(); PVUByteArray::svector bytes; imageGen->fillSharedVector(bytes,angle); setValue(freeze(bytes)); if (firstTime) { int dims[] = { imageGen->getWidth(), imageGen->getHeight() }; setDimension(dims, 2); setAttributes(); setSizes(static_cast<int64_t>(imageGen->getSize())); firstTime = false; } setDataTimeStamp(); setUniqueId(count++); process(); endGroupPut(); } catch(...) { unlock(); throw; } angle += 1; unlock(); }
void ExampleLink::monitorEvent(epics::pvData::MonitorPtr const & monitor) { cout << "ExampleLink::monitorEvent\n"; lock(); try { beginGroupPut(); process(); endGroupPut(); } catch(...) { unlock(); throw; } unlock(); MonitorElementPtr monitorElement = monitor->poll(); if(monitorElement) monitor->release(monitorElement); }
void ExampleMonitorLinkRecord::event(PvaClientMonitorPtr const & monitor) { while(monitor->poll()) { PVStructurePtr pvStructure = monitor->getData()->getPVStructure(); PVDoubleArrayPtr pvDoubleArray = pvStructure->getSubField<PVDoubleArray>("value"); if(!pvDoubleArray) throw std::runtime_error("value is not a double array"); lock(); try { beginGroupPut(); pvValue->replace(pvDoubleArray->view()); process(); endGroupPut(); } catch(...) { unlock(); throw; } unlock(); monitor->releaseEvent(); } }
void ExampleLink::monitorEvent(epics::pvData::MonitorPtr const & monitor) { while(true) { MonitorElementPtr monitorElement = monitor->poll(); if(!monitorElement) break; PVStructurePtr pvStructurePtr = monitorElement->pvStructurePtr; PVDoubleArrayPtr pvDoubleArray = pvStructurePtr->getSubField<PVDoubleArray>("value"); if(!pvDoubleArray) throw std::runtime_error("value is not a double array"); lock(); try { beginGroupPut(); pvValue->replace(pvDoubleArray->view()); process(); endGroupPut(); } catch(...) { unlock(); throw; } unlock(); monitor->release(monitorElement); } }