예제 #1
0
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);
}
예제 #2
0
void TestChannelMonitorRequester::monitorEvent(pvd::MonitorPtr const & monitor)
{
    testDiag("monitorEvent %p", monitor.get());
    mon = monitor;
    eventCnt++;
    wait.trigger();
}
예제 #3
0
void TestChannelMonitorRequester::unlisten(pvd::MonitorPtr const & monitor)
{
    testDiag("unlisten %p", monitor.get());
    Guard G(lock);
    unlistend = true;
    wait.trigger();
}
예제 #4
0
void TestChannelMonitorRequester::monitorConnect(pvd::Status const & status,
                                                 pvd::MonitorPtr const & monitor,
                                                 pvd::StructureConstPtr const & structure)
{
    testDiag("monitorConnect %p %d", monitor.get(), (int)status.isSuccess());
    Guard G(lock);
    connectStatus = status;
    dtype = structure;
    connected = true;
    wait.trigger();
}
예제 #5
0
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);
    }
}