added support for multi channel double
This commit is contained in:
@@ -22,25 +22,29 @@ using namespace epics::pvAccess;
|
||||
using namespace epics::pvaClient;
|
||||
|
||||
|
||||
static void exampleMonitor(PvaClientPtr const &pva)
|
||||
static void exampleMonitor(PvaClientPtr const &pva,string provider)
|
||||
{
|
||||
PvaClientMonitorPtr monitor = pva->channel("exampleDouble")->monitor("");
|
||||
PvaClientMonitorDataPtr pvaData = monitor->getData();
|
||||
PvaClientPutPtr put = pva->channel("exampleDouble")->put("");
|
||||
PvaClientMonitorPtr monitor = pva->channel("double00",provider,2.0)->monitor("");
|
||||
PvaClientMonitorDataPtr monitorData = monitor->getData();
|
||||
PvaClientPutPtr put = pva->channel("double00",provider,2.0)->put("");
|
||||
PvaClientPutDataPtr putData = put->getData();
|
||||
for(size_t ntimes=0; ntimes<5; ++ntimes)
|
||||
{
|
||||
double value = ntimes;
|
||||
cout << "put " << value << endl;
|
||||
putData->putDouble(value); put->put();
|
||||
if(!monitor->waitEvent()) {
|
||||
if(!monitor->waitEvent(.1)) {
|
||||
cout << "waitEvent returned false. Why???";
|
||||
continue;
|
||||
} else while(true) {
|
||||
cout << "monitor " << monitorData->getDouble() << endl;
|
||||
cout << "changed\n";
|
||||
monitorData->showChanged(cout);
|
||||
cout << "overrun\n";
|
||||
monitorData->showOverrun(cout);
|
||||
monitor->releaseEvent();
|
||||
if(!monitor->poll()) break;
|
||||
}
|
||||
cout << "changed\n";
|
||||
pvaData->showChanged(cout);
|
||||
cout << "overrun\n";
|
||||
pvaData->showOverrun(cout);
|
||||
monitor->releaseEvent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +52,10 @@ static void exampleMonitor(PvaClientPtr const &pva)
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
PvaClientPtr pva = PvaClient::create();
|
||||
exampleMonitor(pva);
|
||||
cout << "exampleMonitor pva\n";
|
||||
exampleMonitor(pva,"pva");
|
||||
cout << "exampleMonitor ca\n";
|
||||
exampleMonitor(pva,"ca");
|
||||
cout << "done\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user