本文整理汇总了C++中PvaClientChannelPtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ PvaClientChannelPtr::get方法的具体用法?C++ PvaClientChannelPtr::get怎么用?C++ PvaClientChannelPtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PvaClientChannelPtr
的用法示例。
在下文中一共展示了PvaClientChannelPtr::get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exampleDoubleArray
static void exampleDoubleArray(PvaClientPtr const &pva,string const & channelName,string const & providerName)
{
cout << "__exampleDoubleArray__ channelName " << channelName << " providerName " << providerName << endl;
PvaClientChannelPtr channel = pva->channel(channelName,providerName,2.0);
PvaClientPutPtr put = channel->put();
PvaClientPutDataPtr putData = put->getData();
PvaClientMonitorPtr monitor = pva->channel(channelName,providerName,2.0)->monitor("value");
PvaClientMonitorDataPtr monitorData = monitor->getData();
size_t num = 5;
shared_vector<double> data(num,0);
for(size_t i=0; i<num; ++i) data[i] = .1*i;
putData->putDoubleArray(freeze(data)); put->put();
cout << channel->get("field(value)")->getData()->showChanged(cout) << endl;
data = shared_vector<double>(num,0);
for(size_t i=0; i<num; ++i) data[i] = .1*(i + 1);
putData->putDoubleArray(freeze(data)); put->put();
cout << channel->get("field(value)")->getData()->showChanged(cout) << endl;
if(!monitor->waitEvent()) {
cout << "waitEvent returned false. Why???";
} else while(true) {
cout << "monitor changed\n" << monitorData->showChanged(cout);
monitor->releaseEvent();
if(!monitor->poll()) break;
}
}
示例2: exampleProcess
static void exampleProcess(PvaClientPtr const &pva)
{
cout << "example process\n";
PvaClientChannelPtr channel = pva->channel("PVRdouble");
PvaClientProcessPtr process = channel->createProcess();
process->process();
cout << channel->get("field()")->getData()->showChanged(cout) << endl;
process->process();
cout << channel->get("field()")->getData()->showChanged(cout) << endl;
}
示例3: examplePVFieldPut
static void examplePVFieldPut(PvaClientPtr const &pva,string const & channelName,string const & providerName)
{
cout << "__examplePVFieldPut__ channelName " << channelName << " providerName " << providerName << endl;
PvaClientChannelPtr channel = pva->channel(channelName,providerName,2.0);
PvaClientPutPtr put = channel->put();
PvaClientPutDataPtr putData = put->getData();
PVScalarPtr pvScalar = static_pointer_cast<PVScalar>(putData->getValue());
convert->fromDouble(pvScalar,1.0); put->put();
cout << channel->get("field(value)")->getData()->showChanged(cout) << endl;
convert->fromDouble(pvScalar,2.0); put->put();
cout << channel->get("field(value)")->getData()->showChanged(cout) << endl;
}
示例4: exampleProcess
static void exampleProcess(PvaClientPtr const &pva)
{
cout << "example process\n";
PvaClientChannelPtr channel = pva->channel("PVRdouble");
PvaClientProcessPtr process = channel->createProcess();
try {
process->process();
cout << channel->get("field()")->getData()->showChanged(cout) << endl;
process->process();
cout << channel->get("field()")->getData()->showChanged(cout) << endl;
} catch (std::runtime_error e) {
cout << "exception " << e.what() << endl;
}
}
示例5: examplePVFieldPut
static void examplePVFieldPut(PvaClientPtr const &pva)
{
cout << "example put\n";
PvaClientChannelPtr channel = pva->channel("exampleDouble");
PvaClientPutPtr put = channel->put();
PvaClientPutDataPtr putData = put->getData();
PVFieldPtr pvField = putData->getValue();
PVScalarPtr pvScalar = static_pointer_cast<PVScalar>(pvField);
try {
convert->fromDouble(pvScalar,1.0); put->put();
cout << channel->get("field()")->getData()->showChanged(cout) << endl;
convert->fromDouble(pvScalar,2.0); put->put();
cout << channel->get("field()")->getData()->showChanged(cout) << endl;
} catch (std::runtime_error e) {
cout << "exception " << e.what() << endl;
}
}
示例6: exampleDouble
static void exampleDouble(PvaClientPtr const &pva,string const & channelName,string const & providerName)
{
cout << "__exampleDouble__ channelName " << channelName << " providerName " << providerName << endl;
PvaClientChannelPtr channel = pva->channel(channelName,providerName,2.0);
PvaClientPutPtr put = channel->put();
PvaClientPutDataPtr putData = put->getData();
PvaClientMonitorPtr monitor = pva->channel(channelName,providerName,2.0)->monitor("value");
PvaClientMonitorDataPtr monitorData = monitor->getData();
putData->putDouble(3.0); put->put();
cout << channel->get("field(value)")->getData()->showChanged(cout) << endl;
putData->putDouble(4.0); put->put();
cout << channel->get("field(value)")->getData()->showChanged(cout) << endl;
if(!monitor->waitEvent()) {
cout << "waitEvent returned false. Why???";
} else while(true) {
cout << "monitor changed\n" << monitorData->showChanged(cout);
monitor->releaseEvent();
if(!monitor->poll()) break;
}
}
示例7: examplePut
static void examplePut(PvaClientPtr const &pva)
{
cout << "example put\n";
PvaClientChannelPtr channel = pva->channel("exampleDouble");
PvaClientPutPtr put = channel->put();
PvaClientPutDataPtr putData = put->getData();
PvaClientMonitorPtr monitor = pva->channel("exampleDouble")->monitor("");
PvaClientMonitorDataPtr monitorData = monitor->getData();
try {
putData->putDouble(3.0); put->put();
cout << channel->get("field()")->getData()->showChanged(cout) << endl;
putData->putDouble(4.0); put->put();
cout << channel->get("field()")->getData()->showChanged(cout) << endl;
if(!monitor->waitEvent()) {
cout << "waitEvent returned false. Why???";
} else while(true) {
cout << "monitor changed\n" << monitorData->showChanged(cout);
monitor->releaseEvent();
if(!monitor->poll()) break;
}
} catch (std::runtime_error e) {
cout << "exception " << e.what() << endl;
}
}