areaDetector  3-14
EPICS areaDetector framework
ADPylon.h
Go to the documentation of this file.
1 #ifndef ADPYLON_H
2 #define ADPYLON_H
3 
4 #include <string>
5 #include <vector>
6 
7 #include <epicsEvent.h>
8 #include <epicsMessageQueue.h>
9 
10 #include <ADGenICam.h>
11 #include <PylonFeature.h>
12 
13 #include <pylon/PylonIncludes.h>
14 
15 #define PYLONConvertPixelFormatString "PYLON_CONVERT_PIXEL_FORMAT" // asynParamInt32, R/W
16 #define PYLONTimeStampModeString "PYLON_TIME_STAMP_MODE" // asynParamInt32, R/O
17 #define PYLONUniqueIdModeString "PYLON_UNIQUE_ID_MODE" // asynParamInt32, R/O
18 
22 class ADPylon : public ADGenICam
23 {
24 public:
25  ADPylon(const char *portName, const char *cameraId,
26  size_t maxMemory, int priority, int stackSize);
27 
28  // virtual methods to override from ADGenICam
29  //virtual asynStatus writeInt32( asynUser *pasynUser, epicsInt32 value);
30  //virtual asynStatus writeFloat64( asynUser *pasynUser, epicsFloat64 value);
31  virtual asynStatus readEnum(asynUser *pasynUser, char *strings[], int values[], int severities[],
32  size_t nElements, size_t *nIn);
33  virtual void report(FILE *fp, int details);
35  std::string const & asynName, asynParamType asynType, int asynIndex,
36  std::string const & featureName, GCFeatureType_t featureType);
37  virtual asynStatus startCapture();
38  virtual asynStatus stopCapture();
39  virtual asynStatus connect(asynUser *pasynUser);
40 
41  /* These should be private but are called from C callback functions, must be public. */
42  void imageGrabTask();
43  void shutdown();
44  asynStatus processFrame(const Pylon::CGrabResultPtr& pGrabResult);
45  void cameraDisconnected();
46  void readEventData (int index);
47 
48 protected:
49  asynStatus extractChunkData(const GenApi::INodeMap& nodeMap, NDAttributeList *pAttributeList);
50 
51 private:
52  int PYLONConvertPixelFormat;
53 #define FIRST_PYLON_PARAM PYLONConvertPixelFormat;
54  int PYLONConvertBitAlignment;
55  int PYLONConvertShiftBits;
56  int PYLONTimeStampMode;
57  int PYLONUniqueIdMode;
58 
59  /* Local methods to this class */
60  asynStatus connectCamera();
61 
62  std::string cameraId_;
63  Pylon::CInstantCamera camera_;
64  Pylon::CImageDecompressor decompressor_;
65 
66  bool exiting_;
67  bool acquiring_;
68  epicsEventId startEventId_;
69  epicsEventId newFrameEventId_;
70  int uniqueId_;
71 
72  std::vector<std::string> TLStatisticsFeatureNames_;
73 
74  std::vector<class PylonFeature*> featureList_;
75  std::vector<std::vector<std::string>> eventList_;
76  class ADPylonCameraEventHandler *pCameraEventHandler_;
77 };
78 
79 #endif
80 
GCFeatureType_t
Definition: GenICamFeature.h:13
Definition: ADGenICam.h:25
Pylon camera event handler.
Definition: ADPylon.cpp:77
Main driver class inherited from areaDetectors ADGenICam class.
Definition: ADPylon.h:23
void cameraDisconnected()
Called by Pylon when the camera is disconnected.
Definition: ADPylon.cpp:279
void shutdown()
Called by epicsAtExit.
Definition: ADPylon.cpp:267
asynStatus processFrame(const Pylon::CGrabResultPtr &pGrabResult)
Convert Pylon grab result data to areaDetector NDArray.
Definition: ADPylon.cpp:458
asynStatus extractChunkData(const GenApi::INodeMap &nodeMap, NDAttributeList *pAttributeList)
Definition: ADPylon.cpp:687
virtual GenICamFeature * createFeature(GenICamFeatureSet *set, std::string const &asynName, asynParamType asynType, int asynIndex, std::string const &featureName, GCFeatureType_t featureType)
Definition: ADPylon.cpp:244
virtual asynStatus startCapture()
Definition: ADPylon.cpp:774
virtual asynStatus connect(asynUser *pasynUser)
Connects driver to device; This method is called when the driver's pasynCommon->connect() function is...
Definition: ADPylon.cpp:840
virtual asynStatus readEnum(asynUser *pasynUser, char *strings[], int values[], int severities[], size_t nElements, size_t *nIn)
Definition: ADPylon.cpp:756
virtual void report(FILE *fp, int details)
Print out a report; calls ADDriver::report to get base class report as well.
Definition: ADPylon.cpp:865
virtual asynStatus stopCapture()
Definition: ADPylon.cpp:817
ADPylon(const char *portName, const char *cameraId, size_t maxMemory, int priority, int stackSize)
Constructor for the ADPylon class.
Definition: ADPylon.cpp:176
void imageGrabTask()
Task to grab images off the camera and send them up to areaDetector.
Definition: ADPylon.cpp:398
void readEventData(int index)
Definition: ADPylon.cpp:290
Definition: GenICamFeature.h:41
Definition: GenICamFeature.h:123
NDAttributeList.h.
Definition: NDAttributeList.h:21
class NDAttributeList * pAttributeList
An NDAttributeList object used to obtain the current values of a set of attributes.
Definition: asynNDArrayDriver.h:238
@ string
Definition: NDFileHDF5Layout.h:44