areaDetector  3-14
EPICS areaDetector framework
pvaDriver.h
Go to the documentation of this file.
1 #include <pv/clientFactory.h>
2 #include <pv/pvAccess.h>
3 #include <pv/ntndarray.h>
4 
5 #define PVAOverrunCounterString "OVERRUN_COUNTER"
6 #define PVAPvNameString "PV_NAME"
7 #define PVAPvConnectionStatusString "PV_CONNECTION"
8 
9 #define DRIVER_VERSION 1
10 #define DRIVER_REVISION 6
11 #define DRIVER_MODIFICATION 0
12 
13 class pvaDriver;
14 
15 typedef epics::pvAccess::Channel::shared_pointer ChannelPtr;
16 typedef epics::pvAccess::ChannelProvider::shared_pointer ChannelProviderPtr;
17 typedef std::tr1::shared_ptr<pvaDriver> pvaDriverPtr;
18 
19 class epicsShareClass pvaDriver : public ADDriver,
20  public virtual epics::pvAccess::ChannelRequester,
21  public virtual epics::pvData::MonitorRequester
22 {
23 
24 public:
25  pvaDriver (const char *portName, const char *pvName, int maxBuffers,
26  size_t maxMemory, int priority, int stackSize);
27 
28  // Overriden from ADDriver:
29  asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
30  asynStatus writeOctet(asynUser *pasynUser, const char *value, size_t nChars, size_t *nActual);
31  virtual void report (FILE *fp, int details);
32 
33 protected:
35  #define FIRST_PVA_DRIVER_PARAM PVAOverrunCounter
36  int PVAPvName;
38  #define LAST_PVA_DRIVER_PARAM PVAPvConnectionStatus
39 
40 private:
41  std::string m_pvName;
42  std::string m_request;
43  short m_priority;
44  ChannelProviderPtr m_provider;
45  ChannelPtr m_channel;
46  epics::pvData::PVStructurePtr m_pvRequest;
47  epics::pvData::MonitorPtr m_monitor;
48  pvaDriverPtr m_thisPtr;
49  asynStatus connectPv(std::string const & pvName);
50 
51  // Implemented for pvData::Requester
52  std::string getRequesterName (void);
53  void message (std::string const & message,
54  epics::pvData::MessageType messageType);
55 
56  // Implemented for pvAccess::ChannelRequester
57  void channelCreated (const epics::pvData::Status& status,
58  ChannelPtr const & channel);
59  void channelStateChange (ChannelPtr const & channel,
61 
62  // Implemented for pvData::MonitorRequester
63  void monitorConnect (epics::pvData::Status const & status,
64  epics::pvData::MonitorPtr const & monitor,
65  epics::pvData::StructureConstPtr const & structure);
66  void monitorEvent (epics::pvData::MonitorPtr const & monitor);
67  void unlisten (epics::pvData::MonitorPtr const & monitor);
68 };
69 
70 #define NUM_PVA_DRIVER_PARAMS ((int)(&LAST_PVA_DRIVER_PARAM - &FIRST_PVA_DRIVER_PARAM + 1))
Class from which areaDetector drivers are directly derived.
Definition: ADDriver.h:132
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value)
Sets an int32 parameter.
Definition: ADDriver.cpp:84
virtual asynStatus writeOctet(asynUser *pasynUser, const char *value, size_t maxChars, size_t *nActual)
Called when asyn clients call pasynOctet->write().
Definition: asynNDArrayDriver.cpp:511
virtual void report(FILE *fp, int details)
Report status of the driver.
Definition: asynNDArrayDriver.cpp:753
Definition: pvaDriver.h:22
int PVAPvConnectionStatus
Definition: pvaDriver.h:37
int PVAOverrunCounter
Definition: pvaDriver.h:34
int PVAPvName
Definition: pvaDriver.h:36
@ string
Definition: NDFileHDF5Layout.h:44
list structure
Definition: makeAdl.py:78
list value
Definition: makeDbAndEdl.py:234
epics::pvAccess::ChannelProvider::shared_pointer ChannelProviderPtr
Definition: pvaDriver.h:16
std::tr1::shared_ptr< pvaDriver > pvaDriverPtr
Definition: pvaDriver.h:17
epics::pvAccess::Channel::shared_pointer ChannelPtr
Definition: pvaDriver.h:13
ConnectionState
Definition: pxrd2_interface_misc.h:50