doc changes; add additional create method for RPC
This commit is contained in:
12
README.md
12
README.md
@ -15,8 +15,12 @@ then just type:
|
||||
|
||||
make
|
||||
|
||||
If RELEASE.local does not exist then look at <b>configure/RELEASE</b>
|
||||
for directions for how to build.
|
||||
It can also be built by:
|
||||
|
||||
cp configure/ExampleRELEASE.local configure/RELEASE.local
|
||||
edit configure/RELEASE.local
|
||||
make
|
||||
|
||||
|
||||
Examples
|
||||
------------
|
||||
@ -26,7 +30,7 @@ Project exampleCPP has examples for pvaClientCPP
|
||||
Status
|
||||
------
|
||||
|
||||
* The API is for EPICS Version 4 release 4.5.0
|
||||
* The API is for EPICS Version 4 release 4.6.0
|
||||
* Everything defined in pvaClient.h is ready but see below for remaining work.
|
||||
* Everything defined in pvaClientMultiChannel.h is ready but see below for remaining work.
|
||||
|
||||
@ -34,7 +38,7 @@ Status
|
||||
pvaClientChannel
|
||||
---------------
|
||||
|
||||
Channel::getField and channelArray are not supported for release 4.5
|
||||
Channel::getField and channelArray are not supported for release 4.6
|
||||
|
||||
pvaClientMultiChannel
|
||||
---------------
|
||||
|
@ -1,10 +1,9 @@
|
||||
EPICS V4 release 4.6
|
||||
==========================
|
||||
|
||||
PvaClientMultiChannel
|
||||
---------------------
|
||||
|
||||
checkConnected() now throws an exception if connect fails.
|
||||
* The examples are moved to exampleCPP.
|
||||
* Support for channelRPC is now available.
|
||||
* In PvaClientMultiChannel checkConnected() now throws an exception if connect fails.
|
||||
|
||||
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<div class="head">
|
||||
<h1>EPICS pvaClientCPP</h1>
|
||||
<h2 class="nocount">Release 4.2.0-SNAPSHOT - 2016-01-12</h2>
|
||||
<h2 class="nocount">Release 4.2.0-SNAPSHOT - 2016-07-14</h2>
|
||||
|
||||
<h2 class="nocount">Abstract</h2>
|
||||
|
||||
@ -69,341 +69,49 @@ The data for the channels is presented via normative type NTMultiChannel.
|
||||
<!-- Place what you would like in the Table of Contents, inside the contents div -->
|
||||
<div id="contents" class="contents">
|
||||
<hr />
|
||||
|
||||
<h2>Introduction</h2>
|
||||
|
||||
<p>PvaClient is a synchronous API for accessing PVData via PVAccess.
|
||||
It also provides a number of convenience methods.
|
||||
It allows the client to request access without checking for failure,
|
||||
but throws an exception if a request fails.
|
||||
A client can also check for failues and thus prevent exceptions.</p>
|
||||
|
||||
<p>Doxygen documentation is available at <a
|
||||
href="./html/index.html">doxygenDoc</a></p>
|
||||
|
||||
<p>The PvaClient API has the following features:</p>
|
||||
<ol>
|
||||
<li>Provides a synchronous API rather than the callback API provided by pvAccess.</li>
|
||||
<li>Makes common requests easy.</li>
|
||||
<li>Provides full access to the pvAccess API for more demanding
|
||||
applications</li>
|
||||
<li>Allows efficient client side programs.</li>
|
||||
<li>Takes care of most object resource management problems.</li>
|
||||
</ol>
|
||||
<p>Simple examples of using pva:</p>
|
||||
<pre>
|
||||
// pvaGet
|
||||
PvaClientPtr pva = PvaClient::create();
|
||||
double value = pva->channel("exampleDouble")->get()->getData()->getDouble();
|
||||
|
||||
// pvaPut
|
||||
PvaClientChannelPtr channel = pva->channel("exampleDouble");
|
||||
PvaClientPutPtr put = channel->put();
|
||||
PvaClientPutDataPtr putData = put->getData();
|
||||
putData->putDouble(3.0); put->put();
|
||||
|
||||
// pvaMonitor
|
||||
PvaClientMonitorPtr monitor = pva->channel("examplePowerSupply")->monitor("");
|
||||
PvaClientMonitorDataPtr pvaData = monitor->getData();
|
||||
while(true) {
|
||||
monitor->waitEvent();
|
||||
cout << "changed\n";
|
||||
pvaData->showChanged(cout);
|
||||
cout << "overrun\n";
|
||||
pvaData->showOverrun(cout);
|
||||
monitor->releaseEvent();
|
||||
}
|
||||
|
||||
// pvaProcess
|
||||
PvaClientChannelPtr channel = pva->channel("exampleDouble");
|
||||
PvaClientProcessPtr process = channel->createProcess();
|
||||
process->process();
|
||||
|
||||
</pre>
|
||||
<p>A separate project <b>exampleCPP</b> has examples for <b>pvDatabaseCPP</b>
|
||||
and for <b>pvaClientCPP</b>.
|
||||
See it for pvaClientCPP examples.
|
||||
</p>
|
||||
<p>pvaClient does <b>not</b> provide support for:</p>
|
||||
<dl>
|
||||
<dt>ChannelArray</dt>
|
||||
<dd>TBD</dd>
|
||||
<dt>ChannelRPC</dt>
|
||||
<dd>pvAccess itself already provides a synchronous interface.
|
||||
<b>exampleCPP</b> provides <b>helloRPC</b>, which is an example of using channelRPC.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h2>Building pvaClientCPP</h2>
|
||||
<h2>Overview</h2>
|
||||
<p>
|
||||
If a proper <b>RELEASE.local</b> is present one directory level above <b>pvaClientCPP</b>.
|
||||
pvaClientCPP is one of the components of
|
||||
<a href="http://epics-pvdata.sourceforge.net">
|
||||
EPICS Version 4
|
||||
</a>
|
||||
</p>
|
||||
<p>This document is only a guide to help locate code and documentation related to pvDatabaseCPP
|
||||
</p>
|
||||
<p>
|
||||
Just type:
|
||||
It is intended for developers that want to use pvDatabaseCPP.
|
||||
</p>
|
||||
<pre>
|
||||
make
|
||||
</pre>
|
||||
<p>
|
||||
An example of a proper <b>RELEASE.local</b> is:
|
||||
<h2>Developer Guide</h2>
|
||||
<p>A guide for developers is available at
|
||||
<a
|
||||
href="http://epics-pvdata.sourceforge.net/informative/developerGuide/developerGuide.html">
|
||||
developerGuide
|
||||
</a>
|
||||
</p>
|
||||
<pre>
|
||||
EPICS4_DIR=/home/epicsv4/master
|
||||
EXAMPLE=${EPICS4_DIR}/exampleCPP
|
||||
PVDATABASE=${EPICS4_DIR}/pvDatabaseCPP
|
||||
PVACLIENT=${EPICS4_DIR}/pvaClientCPP
|
||||
PVASRV=${EPICS4_DIR}/pvaSrv
|
||||
PVACCESS=${EPICS4_DIR}/pvAccessCPP
|
||||
NORMATIVETYPES=${EPICS4_DIR}/normativeTypesCPP
|
||||
PVDATA=${EPICS4_DIR}/pvDataCPP
|
||||
PVCOMMON=${EPICS4_DIR}/pvCommonCPP
|
||||
|
||||
EPICS_BASE=/home/install/epics/base
|
||||
</pre>
|
||||
|
||||
<p>pvaClientCPP can also be built if a file RELEASE.local exists in directory configure.
|
||||
To create one do the following:</p>
|
||||
<pre>
|
||||
mrk> pwd
|
||||
/home/hg/pvaClientCPP/configure
|
||||
mrk> cp ExampleRELEASE.local RELEASE.local
|
||||
</pre>
|
||||
<p>Then edit <b>RELEASE.local</b> so that it has the correct location of each
|
||||
product pvaClientCPP requires.
|
||||
Than at the top level just execute <b>make</b>:</p>
|
||||
<pre>
|
||||
mrk> cd ..
|
||||
mrk> pwd
|
||||
/home/epicsv4/master/pvaClientCPP
|
||||
mrk> make
|
||||
</pre>
|
||||
|
||||
<h2>PvaClient</h2>
|
||||
<p>An instance of PvaClient is obtained via the call:</p>
|
||||
<pre>
|
||||
PvaClientPtr pva = PvaClient::create();
|
||||
</pre>
|
||||
|
||||
<p>PvaClient has methods to create instances of <b>PvaClientChannel</b>.
|
||||
The client can specify the provider name or use the default provider.
|
||||
The client can manage it's own channels or can let pvaClient cache channels.
|
||||
An example of using the cached method is:</p>
|
||||
<pre>
|
||||
PvaClientChannelPtr pvaChannel = pva->channel("exampleDouble");
|
||||
</pre>
|
||||
<p>This will attempt to connect to channel exampleDouble.
|
||||
Since the client did not specify a timeout an exception wll be thrown if
|
||||
the connection request fails.
|
||||
The client will block until the connection is made or an exception is thrown.
|
||||
If the request succeeds, pva caches the pvaChannel so that if the
|
||||
client makes another request for the same channel the cached object is
|
||||
returned to the client.
|
||||
<p>This guide discusses all the components that are part of an <b>EPICS V4</b> release.
|
||||
Some understanding of the components and how they are related is necessary in order to
|
||||
develop code that uses pvDatabaseCPP.
|
||||
In particular read everything related to pvaClient.
|
||||
</p>
|
||||
<p>An example of using a non cached method is:</p>
|
||||
<pre>
|
||||
PvaClientChannelPtr pvaChannel = pva->createChannel("exampleDouble");
|
||||
</pre>
|
||||
<p>This will create an PvaClientChannel and return it to the client.
|
||||
The client must itself connect.
|
||||
This is useful if the client wants to connect to multiple channels in parallel.
|
||||
<p>The developerGuide discusses code in a way that applies to both CPP and C++.
|
||||
For the descriptions of the CPP specific code consult the next section.
|
||||
</p>
|
||||
|
||||
<h2>PvaClientChannel - Wrapper For Single Channel</h2>
|
||||
<h3>PvaClientChannel</h3>
|
||||
<p>This provides methods for connecting to a channel and for creating instances of
|
||||
PvaClientField, PvaClientProcess, ..., PvaClientPutGet.</p>
|
||||
<p>Connection must be made before any create method is called or
|
||||
an exception is raised.
|
||||
The following is a synchronous connection request:</p>
|
||||
<pre>
|
||||
pvaChannel->connect(5.0); // BLOCKS AND THROWS IF NO CONNECT
|
||||
</pre>
|
||||
<p>This blocks until then connection is made or until timout occurs.
|
||||
An exception is raised if the connection request fails.
|
||||
<h2>doxygen</h2>
|
||||
<p>doxygen documentation is available at
|
||||
<a
|
||||
href="./html/index.html">doxygen</a>
|
||||
</p>
|
||||
<p>The same request can be made without blocking and without exceptions.</p>
|
||||
<pre>
|
||||
pvaChannel->issueConnect(); // DOES NOT BLOCK
|
||||
.....
|
||||
Status status =pvaChannel->waitConnect(5.0); // BLOCKS DOES NOT THROW
|
||||
if(!status.isOK()) {
|
||||
// failure do something
|
||||
}
|
||||
</pre>
|
||||
<p>Once the channel is connected other PvaClient objects can be created.
|
||||
For example:</p>
|
||||
<pre>
|
||||
PvaClientGetPtr pvaGet = pvaChannel->get(); // DOES BLOCK
|
||||
</pre>
|
||||
<p>This is a caching request.
|
||||
If the client already has made an identical request the client will receive the
|
||||
cached object.
|
||||
If a new pvaGet is created than it is connected before it is returned to the client.
|
||||
</p>
|
||||
<p>The client can also managed it's own objects:</p>
|
||||
<pre>
|
||||
PvaClientGetPtr pvaGet = pvaChannel->createGet(); // DOES NOT BLOCK
|
||||
</pre>
|
||||
<p>The client must connect the pvaGet.</p>
|
||||
|
||||
<h3>PvaClientGetData</h3>
|
||||
<p>This provides the data returned by pvaGet and pvaPutGet.
|
||||
It is obtained via:</p>
|
||||
<pre>
|
||||
PvaClientGetDataPtr pvaData = pvaGet->getData();
|
||||
</pre>
|
||||
<p>It provides methods to get everything returned by channelGet.
|
||||
In addition there are methods that make it easier to handle a value
|
||||
field that is a scalar or a scalarArray.
|
||||
Also for a scalar that is a double or a scalarArray with element type double.
|
||||
<h2>exampleCPP</h2>
|
||||
<p>Example code is available as part of this release.
|
||||
<a
|
||||
href="http://epics-pvdata.sourceforge.net/docbuild/exampleCPP/tip/documentation/exampleCPP.html">
|
||||
exampleCPP
|
||||
</a>
|
||||
</p>
|
||||
<p>An example is:</p>
|
||||
<pre>
|
||||
double value = pvaData->getDouble();
|
||||
</pre>
|
||||
<p>It also keeps a bitSet showing which fields have changed since the last channelGet or channelPutGet.</p>
|
||||
|
||||
<h3>PvaClientMonitorData</h3>
|
||||
<p>To the client this looks identical to PvaClientGetData except that
|
||||
it provides two BitSets: changedBitSet and overrrunBitSet.
|
||||
It is used by pvaMonitor.
|
||||
</p>
|
||||
<h3>PvaClientPutData</h3>
|
||||
<p>This is used to provided data for pvaPut and pvaPutGet.
|
||||
It has many of the same methods as pvaGetData.
|
||||
It does not have a bitSet.
|
||||
It also has put methods like:</p>
|
||||
<pre>
|
||||
void pvaData->putDouble(5.0);
|
||||
</pre>
|
||||
<h3>PvaClientGet</h3>
|
||||
<p>This provides methods to connect to channelGet and to issue get request.
|
||||
To connect via a single synchronous call:</p>
|
||||
<pre>
|
||||
easyGet->connect(); // BLOCKS AND CAN THROW
|
||||
</pre>
|
||||
<p>This can also be done in two steps:</p>
|
||||
<pre>
|
||||
pvaGet->issueConnect(); // DOES NOT BLOCK
|
||||
...
|
||||
Status status = pvaGet->waitConnect(); // BLOCKS AND DOES NOT THROW
|
||||
</pre>
|
||||
<p>Once connected gets are issued via either:</p>
|
||||
<pre>
|
||||
void pvaGet->get(); // BLOCKS AND CAN THROW
|
||||
</pre>
|
||||
or
|
||||
<pre>
|
||||
pvaGet->issueGet(); // DOES NOT BLOCK
|
||||
...
|
||||
Status status = pvaGet->waitGet(); // BLOCKS AND DOES NOT THROW
|
||||
</pre>
|
||||
<h3>PvaClientPut</h3>
|
||||
<p>This is similar to pvaGet except that it wraps channelPut instead of channelGet.
|
||||
</p>
|
||||
<p>Once connected puts are issued via either:</p>
|
||||
<pre>
|
||||
void pvaPut->put(); // BLOCKS AND CAN THROW
|
||||
</pre>
|
||||
or
|
||||
<pre>
|
||||
pvaPut->issuePut(); // DOES NOT BLOCK
|
||||
...
|
||||
Status status = pvaPut->waitPut(); // BLOCKS AND DOES NOT THROW
|
||||
</pre>
|
||||
<h3>PvaClientMonitor</h3>
|
||||
<p>Connecting is similar to pvaGet and pvaPut.
|
||||
The other methods are:</p>
|
||||
<dl>
|
||||
<dt>start</dt>
|
||||
<dd>Starts monitoring</dd>
|
||||
<dt>stop</dt>
|
||||
<dd>Stops monitoring</dd>
|
||||
<dt>poll</dt>
|
||||
<dd>polls for a monitorEvent.
|
||||
The data is avalable via pvaMonitorData.
|
||||
</dd>
|
||||
<dt>releaseEvent</dt>
|
||||
<dd>Release the data from the last poll.
|
||||
Note that this must be called before another poll is requested.
|
||||
</dd>
|
||||
<dt>waitEvent</dt>
|
||||
<dd>Block until a monitorEvent is available.
|
||||
If true is returned a poll has already been issued.
|
||||
</dd>
|
||||
<dt>setRequester</dt>
|
||||
<dd>A client callback is registered to receive notice of monitorEvents.</dd>
|
||||
</dl>
|
||||
<h3>PvaClientProcess</h3>
|
||||
<p>Connecting is similar to pvaGet.
|
||||
It has methods:</p>
|
||||
<dl>
|
||||
<dt>process</dt>
|
||||
<dd>call issueProcess and waitProcess.</dd>
|
||||
<dt>issueProcess</dt>
|
||||
<dd>call channelProcess->process() and return immediately.
|
||||
</dd>
|
||||
<dt>waitProcess</dt>
|
||||
<dd>Wait for process to complete.</dd>
|
||||
</dl>
|
||||
<h3>PvaClientPutGet</h3>
|
||||
<p>Connecting is similar to pvaGet.
|
||||
It has methods:</p>
|
||||
<dl>
|
||||
<dt>putGet</dt>
|
||||
<dd>calls issuePutGet and waitPutGet.
|
||||
throws an exception if not successfull.
|
||||
</dd>
|
||||
<dt>issuePutGet</dt>
|
||||
<dd>
|
||||
Calls channel->putGet() and returns.
|
||||
</dd>
|
||||
<dt>waitPutGet</dt>
|
||||
<dd>
|
||||
Waits until putGet completes and returns status.
|
||||
</dd>
|
||||
<dt>getGet,issueGetGet, and waitGetGet</dt>
|
||||
<dd>Gets the data for the get part of channelPutGet.</dd>
|
||||
<dt>getPut,issueGetPut,and waitGetPut</dt>
|
||||
<dd>Gets the data for the put part of channelPutGet.</dd>
|
||||
<dt>getPutData</dt>
|
||||
<dd>
|
||||
Returns the PvaClientData for the put part of channelPutGet.
|
||||
</dd>
|
||||
<dt>getGetData</dt>
|
||||
<dd>
|
||||
Returns the PvaClientData for the get part of channelPutGet.
|
||||
</dd>
|
||||
</dl>
|
||||
<p>Look at javaDoc for details.</p>
|
||||
|
||||
<h2>PvaClientMultiChannel - Wrapper For Multiple Channels</h2>
|
||||
<h3>PvaClientMultiChannel</h3>
|
||||
<p>This provides methods for connecting to multiple channels.
|
||||
</p>
|
||||
<h3>PvaClientMultiGetDouble</h3>
|
||||
<p>This provides support for channelGet to multiple channels where each channel has a value field that is a numeric scalar.
|
||||
</p>
|
||||
<h3>PvaClientMultiPutDouble</h3>
|
||||
<p>This provides support for channelPut to multiple channels where each channel has a value field that is a numeric scalar.
|
||||
</p>
|
||||
<h3>PvaClientMultiMonitorDouble</h3>
|
||||
<p>This provides support for monitoring changes to multiple channels where each channel has a value field that is a numeric scalar.
|
||||
</p>
|
||||
<h3>PvaClientNTMultiGet</h3>
|
||||
<p>This provides support for channelGet to multiple channels where each channel has a value field that has any valid type.
|
||||
</p>
|
||||
<h3>PvaClientNTMultiPut</h3>
|
||||
<p>This provides support for channelPut to multiple channels where each channel has a value
|
||||
field that has any valid type.
|
||||
</p>
|
||||
<h3>PvaClientNTMultiMonitor</h3>
|
||||
<p>This provides support for monitoring changes to multiple channels where each channel has a
|
||||
value field that has any valid type.
|
||||
</p>
|
||||
<h3>PvaClientNTMultiData</h3>
|
||||
<p>This provides support for monitoring changes to multiple channels where each channel has a value field that has any valid type.
|
||||
The client can get the data as normative type NTMultiChannel.
|
||||
<p>In particular look at exampleClient.
|
||||
It has many examples of using pvaClientCPP.
|
||||
</p>
|
||||
|
||||
</div> <!-- class="contents" -->
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -62,7 +62,7 @@ class epicsShareClass PvaClientMultiChannel :
|
||||
{
|
||||
public:
|
||||
POINTER_DEFINITIONS(PvaClientMultiChannel);
|
||||
/** Create a PvaClientMultiChannel.
|
||||
/** @brief Create a PvaClientMultiChannel.
|
||||
* @param pvaClient The interface to pvaClient.
|
||||
* @param channelNames The names of the channel..
|
||||
* @param providerName The name of the provider.
|
||||
@ -76,69 +76,70 @@ public:
|
||||
size_t maxNotConnected=0
|
||||
);
|
||||
/**
|
||||
* Destructor
|
||||
* @brief Destructor
|
||||
*/
|
||||
~PvaClientMultiChannel();
|
||||
/** Get the channelNames.
|
||||
/** @brief Get the channelNames.
|
||||
* @return The names.
|
||||
*/
|
||||
epics::pvData::shared_vector<const std::string> getChannelNames();
|
||||
/** Connect to the channels.
|
||||
/** @brief Connect to the channels.
|
||||
*
|
||||
* This calls issueConnect and waitConnect.
|
||||
* An exception is thrown if connect fails.
|
||||
* @param timeout The time to wait for connecting to the channel.
|
||||
* @return status of request
|
||||
*/
|
||||
epics::pvData::Status connect(double timeout=5);
|
||||
/** Are all channels connected?
|
||||
/** @brief Are all channels connected?
|
||||
* @return if all are connected.
|
||||
*/
|
||||
bool allConnected();
|
||||
/** Has a connection state change occured?
|
||||
/** @brief Has a connection state change occured?
|
||||
* @return (true, false) if (at least one, no) channel has changed state.
|
||||
*/
|
||||
bool connectionChange();
|
||||
/** Get the connection state of each channel.
|
||||
/** @brief Get the connection state of each channel.
|
||||
* @return The state of each channel.
|
||||
*/
|
||||
epics::pvData::shared_vector<epics::pvData::boolean> getIsConnected();
|
||||
/** Get the pvaClientChannelArray.
|
||||
/** @brief Get the pvaClientChannelArray.
|
||||
* @return The shared pointer.
|
||||
*/
|
||||
PvaClientChannelArray getPvaClientChannelArray();
|
||||
/** Get pvaClient.
|
||||
/** @brief Get pvaClient.
|
||||
* @return The shared pointer.
|
||||
*/
|
||||
PvaClientPtr getPvaClient();
|
||||
/**
|
||||
* create a pvaClientMultiGetDouble
|
||||
* @brief create a pvaClientMultiGetDouble
|
||||
* @return The interface.
|
||||
*/
|
||||
PvaClientMultiGetDoublePtr createGet();
|
||||
/**
|
||||
* create a pvaClientMultiPutDouble
|
||||
* @brief Create a pvaClientMultiPutDouble.
|
||||
* @return The interface.
|
||||
*/
|
||||
PvaClientMultiPutDoublePtr createPut();
|
||||
/**
|
||||
* Create a pvaClientMultiMonitorDouble.
|
||||
* @brief Create a pvaClientMultiMonitorDouble.
|
||||
* @return The interface.
|
||||
*/
|
||||
PvaClientMultiMonitorDoublePtr createMonitor();
|
||||
/**
|
||||
* Create a pvaClientNTMultiPut.
|
||||
* @brief Create a pvaClientNTMultiPut.
|
||||
* @return The interface.
|
||||
*/
|
||||
PvaClientNTMultiPutPtr createNTPut();
|
||||
/**
|
||||
* Create a pvaClientNTMultiGet;
|
||||
* @brief Create a pvaClientNTMultiGet;
|
||||
* @param request The request for each channel.
|
||||
* @return The interface.
|
||||
*/
|
||||
PvaClientNTMultiGetPtr createNTGet(
|
||||
std::string const &request = "field(value,alarm,timeStamp)");
|
||||
/**
|
||||
* Create a pvaClientNTMultiPut.
|
||||
* @brief Create a pvaClientNTMultiPut.
|
||||
* @param request The request for each channel.
|
||||
* @return The interface.
|
||||
*/
|
||||
@ -181,7 +182,7 @@ public:
|
||||
POINTER_DEFINITIONS(PvaClientMultiGetDouble);
|
||||
|
||||
/**
|
||||
* Factory method that creates a PvaClientMultiGetDouble.
|
||||
* @brief Create a PvaClientMultiGetDouble.
|
||||
* @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
|
||||
* @param pvaClientChannelArray The PvaClientChannel array.
|
||||
* @return The interface.
|
||||
@ -193,15 +194,15 @@ public:
|
||||
~PvaClientMultiGetDouble();
|
||||
|
||||
/**
|
||||
* Create a channelGet for each channel.
|
||||
*/
|
||||
* @brief Create a channelGet for each channel.
|
||||
*/
|
||||
void connect();
|
||||
/**
|
||||
* get the data.
|
||||
* @brief Get the data.
|
||||
* @return The double[] where each element is the value field of the corresponding channel.
|
||||
*/
|
||||
epics::pvData::shared_vector<double> get();
|
||||
/** Get the shared pointer to self.
|
||||
/** @brief Get the shared pointer to self.
|
||||
* @return The shared pointer.
|
||||
*/
|
||||
PvaClientMultiGetDoublePtr getPtrSelf()
|
||||
@ -237,7 +238,7 @@ class epicsShareClass PvaClientMultiPutDouble :
|
||||
public:
|
||||
POINTER_DEFINITIONS(PvaClientMultiPutDouble);
|
||||
|
||||
/** Factory method that creates a PvaClientMultiPutDouble.
|
||||
/** @brief Create a PvaClientMultiPutDouble.
|
||||
* @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
|
||||
* @param pvaClientChannelArray The PvaClientChannel array.
|
||||
* @return The interface.
|
||||
@ -247,14 +248,14 @@ public:
|
||||
PvaClientChannelArray const &pvaClientChannelArray);
|
||||
~PvaClientMultiPutDouble();
|
||||
/**
|
||||
* Create a channelPut for each channel.
|
||||
* @brief Create a channelPut for each channel.
|
||||
*/
|
||||
void connect();
|
||||
/** put data to each channel as a double
|
||||
/** @brief put data to each channel as a double
|
||||
* @param data The array of data for each channel.
|
||||
*/
|
||||
void put(epics::pvData::shared_vector<double> const &data);
|
||||
/** Get the shared pointer to self.
|
||||
/** @brief Get the shared pointer to self.
|
||||
* @return The shared pointer.
|
||||
*/
|
||||
PvaClientMultiPutDoublePtr getPtrSelf()
|
||||
@ -289,7 +290,7 @@ class epicsShareClass PvaClientMultiMonitorDouble :
|
||||
public:
|
||||
POINTER_DEFINITIONS(PvaClientMultiMonitorDouble);
|
||||
|
||||
/** Factory method that creates a PvaClientMultiMonitorDouble.
|
||||
/** @brief Create a PvaClientMultiMonitorDouble.
|
||||
* @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
|
||||
* @param pvaClientChannelArray The PvaClientChannel array.
|
||||
* @return The interface.
|
||||
@ -299,17 +300,18 @@ public:
|
||||
PvaClientChannelArray const &pvaClientChannelArray);
|
||||
~PvaClientMultiMonitorDouble();
|
||||
/**
|
||||
* Create a channel monitor for each channel.
|
||||
*/
|
||||
* @brief Connect a channel monitor for each channel.
|
||||
*/
|
||||
void connect();
|
||||
/**
|
||||
* poll each channel.
|
||||
* @brief Poll each channel.
|
||||
*
|
||||
* If any has new data it is used to update the double[].
|
||||
* @return (false,true) if (no, at least one) value was updated.
|
||||
*/
|
||||
bool poll();
|
||||
/**
|
||||
* Wait until poll returns true.
|
||||
* @brief Wait until poll returns true.
|
||||
* @param secondsToWait The time to keep trying.
|
||||
* A thread sleep of .1 seconds occurs between each call to poll.
|
||||
* @return (false,true) if (timeOut, poll returned true).
|
||||
@ -320,7 +322,7 @@ public:
|
||||
* @return The double[] where each element is the value field of the corresponding channel.
|
||||
*/
|
||||
epics::pvData::shared_vector<double> get();
|
||||
/** Monitor the shared pointer to self.
|
||||
/** @brief Monitor the shared pointer to self.
|
||||
* @return The shared pointer.
|
||||
*/
|
||||
PvaClientMultiMonitorDoublePtr getPtrSelf()
|
||||
@ -356,7 +358,7 @@ class epicsShareClass PvaClientNTMultiGet :
|
||||
public:
|
||||
POINTER_DEFINITIONS(PvaClientNTMultiGet);
|
||||
/**
|
||||
* Factory method that creates a PvaClientNTMultiGet.
|
||||
* @brief Create a PvaClientNTMultiGet.
|
||||
* @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
|
||||
* @param pvaClientChannelArray The PvaClientChannel array.
|
||||
* @param pvRequest The pvRequest for each channel.
|
||||
@ -369,19 +371,19 @@ public:
|
||||
|
||||
~PvaClientNTMultiGet();
|
||||
/**
|
||||
* Create a channelGet for each channel.
|
||||
*/
|
||||
* @brief Connect a channelGet for each channel.
|
||||
*/
|
||||
void connect();
|
||||
/**
|
||||
* get data for each channel.
|
||||
* @brief Get each channel.
|
||||
*/
|
||||
void get();
|
||||
/**
|
||||
* get the data.
|
||||
* @brief Get the data from the last get.
|
||||
* @return the pvaClientNTMultiData.
|
||||
*/
|
||||
PvaClientNTMultiDataPtr getData();
|
||||
/** Get the shared pointer to self.
|
||||
/** @brief Get the shared pointer to self.
|
||||
* @return The shared pointer.
|
||||
*/
|
||||
PvaClientNTMultiGetPtr getPtrSelf()
|
||||
@ -421,7 +423,7 @@ class epicsShareClass PvaClientNTMultiPut :
|
||||
public:
|
||||
POINTER_DEFINITIONS(PvaClientNTMultiPut);
|
||||
/**
|
||||
* Factory method that creates a PvaClientNTMultiPut.
|
||||
* @brief Create a PvaClientNTMultiPut.
|
||||
* @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
|
||||
* @param pvaClientChannelArray The PvaClientChannel array.
|
||||
* @return The interface.
|
||||
@ -432,19 +434,19 @@ public:
|
||||
|
||||
~PvaClientNTMultiPut();
|
||||
/**
|
||||
* Create a channelPut for each channel.
|
||||
* @brief Connect a channelPut for each channel.
|
||||
*/
|
||||
void connect();
|
||||
/**
|
||||
* get the value field of each channel as a union.
|
||||
* @brief Get the value field of each channel as a union.
|
||||
* @return A shared vector of union.
|
||||
*/
|
||||
epics::pvData::shared_vector<epics::pvData::PVUnionPtr> getValues();
|
||||
/**
|
||||
* put the data to each channel.
|
||||
* @brief Issue a put for each channel.
|
||||
' */
|
||||
void put();
|
||||
/** Get the shared pointer to self.
|
||||
/** @brief Get the shared pointer to self.
|
||||
* @return The shared pointer.
|
||||
*/
|
||||
PvaClientNTMultiPutPtr getPtrSelf()
|
||||
@ -480,7 +482,7 @@ class epicsShareClass PvaClientNTMultiMonitor :
|
||||
|
||||
public:
|
||||
POINTER_DEFINITIONS(PvaClientNTMultiMonitor);
|
||||
/** Factory method that creates a PvaClientNTMultiMonitor.
|
||||
/** @brief Create a PvaClientNTMultiMonitor.
|
||||
* @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
|
||||
* @param pvaClientChannelArray The PvaClientChannel array.
|
||||
* @param pvRequest The pvRequest for each channel.
|
||||
@ -492,24 +494,25 @@ public:
|
||||
epics::pvData::PVStructurePtr const & pvRequest);
|
||||
~PvaClientNTMultiMonitor();
|
||||
/**
|
||||
* Create a channel monitor for each channel.
|
||||
* @brief Connect to a channel monitor for each channel.
|
||||
*/
|
||||
void connect();
|
||||
/**
|
||||
* poll each channel.
|
||||
* @brief Poll each channel.
|
||||
*
|
||||
* If any has new data it is used to update the double[].
|
||||
* @return (false,true) if (no, at least one) value was updated.
|
||||
*/
|
||||
bool poll();
|
||||
/**
|
||||
* Wait until poll returns true.
|
||||
* @brief Wait until poll returns true.
|
||||
* @param secondsToWait The time to keep trying.
|
||||
* A thread sleep of .1 seconds occurs between each call to poll.
|
||||
* @return (false,true) if (timeOut, poll returned true).
|
||||
*/
|
||||
bool waitEvent(double secondsToWait);
|
||||
/**
|
||||
* get the data.
|
||||
* @brief Get the data for the last successfull poll.
|
||||
* @return the pvaClientNTMultiData.
|
||||
*/
|
||||
PvaClientNTMultiDataPtr getData();
|
||||
@ -551,7 +554,8 @@ class epicsShareClass PvaClientNTMultiData :
|
||||
public:
|
||||
POINTER_DEFINITIONS(PvaClientNTMultiData);
|
||||
/**
|
||||
* Factory method that creates a PvaClientNTMultiData.
|
||||
* @brief Create a PvaClientNTMultiData.
|
||||
*
|
||||
* Normally only called by PvaClientNTMultiGet and PvaClientNTMultiMonitor.
|
||||
* @param u The union interface for the value field of each channel.
|
||||
* @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
|
||||
@ -566,31 +570,31 @@ public:
|
||||
~PvaClientNTMultiData();
|
||||
|
||||
/**
|
||||
* Get the number of channels.
|
||||
* @brief Get the number of channels.
|
||||
* @return The number of channels.
|
||||
*/
|
||||
size_t getNumber();
|
||||
|
||||
/**
|
||||
* Set the timeStamp base for computing deltaTimes.
|
||||
* @brief Set the timeStamp base for computing deltaTimes.
|
||||
*/
|
||||
void startDeltaTime();
|
||||
|
||||
/**
|
||||
* Update NTMultiChannel fields.
|
||||
* @brief Update NTMultiChannel fields.
|
||||
*/
|
||||
void endDeltaTime();
|
||||
/**
|
||||
* Get the time when the last get was made.
|
||||
* @brief Get the time when the last get was made.
|
||||
* @return The timeStamp.
|
||||
*/
|
||||
epics::pvData::TimeStamp getTimeStamp();
|
||||
/**
|
||||
* Get the NTMultiChannel.
|
||||
* @brief Get the NTMultiChannel.
|
||||
* @return The value.
|
||||
*/
|
||||
epics::nt::NTMultiChannelPtr getNTMultiChannel();
|
||||
/** Get the shared pointer to self.
|
||||
/** @brief Get the shared pointer to self.
|
||||
* @return The shared pointer.
|
||||
*/
|
||||
PvaClientNTMultiDataPtr getPtrSelf()
|
||||
|
@ -547,9 +547,17 @@ PVStructurePtr PvaClientChannel::rpc(
|
||||
PVStructurePtr PvaClientChannel::rpc(
|
||||
PVStructurePtr const & pvArgument)
|
||||
{
|
||||
return rpc(pvArgument,pvArgument);
|
||||
PvaClientRPCPtr rpc = createRPC();
|
||||
return rpc->request(pvArgument);
|
||||
}
|
||||
|
||||
PvaClientRPCPtr PvaClientChannel::createRPC()
|
||||
{
|
||||
if(connectState!=connected) connect(5.0);
|
||||
PvaClientPtr yyy = pvaClient.lock();
|
||||
if(!yyy) throw std::runtime_error("PvaClient was destroyed");
|
||||
return PvaClientRPC::create(yyy,channel);
|
||||
}
|
||||
|
||||
PvaClientRPCPtr PvaClientChannel::createRPC(PVStructurePtr const & pvRequest)
|
||||
{
|
||||
|
@ -72,7 +72,14 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
PvaClientRPCPtr PvaClientRPC::create(
|
||||
PvaClientPtr const &pvaClient,
|
||||
Channel::shared_pointer const & channel)
|
||||
{
|
||||
StructureConstPtr structure(getFieldCreate()->createStructure());
|
||||
PVStructurePtr pvRequest(getPVDataCreate()->createPVStructure(structure));
|
||||
return create(pvaClient,channel,pvRequest);
|
||||
}
|
||||
PvaClientRPCPtr PvaClientRPC::create(
|
||||
PvaClientPtr const &pvaClient,
|
||||
Channel::shared_pointer const & channel,
|
||||
|
Reference in New Issue
Block a user