areaDetector  3-13
EPICS areaDetector framework
GenICamFeature.h
Go to the documentation of this file.
1 #ifndef GENICAM_FEATURE_H
2 #define GENICAM_FEATURE_H
3 
4 #include <string>
5 #include <vector>
6 #include <map>
7 
8 #include <asynPortDriver.h>
9 
10 #include "ADGenICamAPI.h"
11 
12 typedef enum
13 {
24 
25 typedef enum
26 {
30 
31 typedef enum {
36 
37 
38 class GenICamFeatureSet;
39 
41 {
42 
43 private:
44  int getParam (epicsInt64 & value);
45  int getParam (epicsInt32 & value);
46  int getParam (double & value);
47  int getParam (std::string & value);
48 
49  int setParam (epicsInt64 value);
50  int setParam (epicsInt32 value);
51  int setParam (double value);
52  int setParam (std::string const & value);
53  int setParam (bool value);
54 
55 protected:
57  asynParamType mAsynType;
61  std::vector<std::string> mEnumStrings;
62  std::vector<int> mEnumValues;
64 
66 
67 public:
69  std::string const & asynName, asynParamType asynType, int asynIndex,
70  std::string const & featureName, GCFeatureType_t featureType);
71 
72  // These are the pure virtual functions that derived classes must implement
73  virtual bool isImplemented(void) = 0;
74  virtual bool isAvailable(void) = 0;
75  virtual bool isReadable(void) = 0;
76  virtual bool isWritable(void) = 0;
77  virtual epicsInt64 readInteger(void) = 0;
78  virtual epicsInt64 readIntegerMin(void) = 0;
79  virtual epicsInt64 readIntegerMax(void) = 0;
80  virtual epicsInt64 readIncrement(void) = 0;
81  virtual void writeInteger(epicsInt64 value) = 0;
82  virtual bool readBoolean(void) = 0;
83  virtual void writeBoolean (bool value) = 0;
84  virtual double readDouble(void) = 0;
85  virtual double readDoubleMin(void) = 0;
86  virtual double readDoubleMax(void) = 0;
87  virtual void writeDouble(double value) = 0;
88  virtual int readEnumIndex(void) = 0;
89  virtual void writeEnumIndex(int value) = 0;
90  virtual std::string readEnumString(void) = 0;
91  virtual void writeEnumString(std::string const & value) = 0;
92  virtual void readEnumChoices(std::vector<std::string>& enumStrings, std::vector<int>& enumValues) = 0;
93  virtual std::string readString(void) = 0;
94  virtual void writeString(std::string const & value) = 0;
95  virtual void writeCommand(void) = 0;
96 
97  // Put the value both to the detector (if it is connected to a detector
98  // parameter) and to the underlying asyn parameter if successful. Update
99  // other modified parameters automatically.
100  int write(void *pValue, void *pReadbackValue, bool setParam);
101 
102  // Fetch the current value from the detector, update underlying asyn parameter
103  // and return the value
104  int read(void *pValue, bool bSetParam);
105 
106  void report (FILE *fp, int details);
107 
108  int getAsynIndex(void);
109  std::string getAsynName(void);
110  asynParamType getAsynType(void);
111  std::string getFeatureName(void);
112  std::string getValueAsString(void);
113  GCFeatureType_t getFeatureType(void);
114 
115  virtual epicsInt32 convertEnum(epicsInt32 inputValue, GCConvertDirection_t direction);
116  virtual double convertDoubleUnits(double inputValue, GCConvertDirection_t direction);
117 };
118 
119 typedef std::multimap<std::string, GenICamFeature*> GCFeatureMap_t;
120 typedef std::map<int, GenICamFeature*> GCAsynMap_t;
121 
123 {
124 private:
125  asynPortDriver *mPortDriver;
126  asynUser *mUser;
127 
128  GCFeatureMap_t mFeatureMap;
129  GCAsynMap_t mAsynMap;
130 
131 public:
132  GenICamFeatureSet (asynPortDriver *portDriver, asynUser *user);
133 
134  void insert(GenICamFeature *pFeature, std::string const & name = "");
135 
136  asynPortDriver *getPortDriver (void);
137  GenICamFeature *getByName (std::string const & name);
138  GenICamFeature *getByIndex (int index);
139  asynUser *getUser (void);
140  int readAll (void);
141  int readFeatures (std::vector<std::string> const & params);
142  void report (FILE *fp, int details);
143 
144  // These are used for mapping between areaDetector ImageMode and GenICam AcquisitionMode
148 
149 };
150 
151 #endif
#define ADGENICAM_API
Definition: ADGenICamAPI.h:41
GCConvertDirection_t
Definition: GenICamFeature.h:26
@ GCConvertToEPICS
Definition: GenICamFeature.h:27
@ GCConvertFromEPICS
Definition: GenICamFeature.h:28
GCAcquisitionMode_t
Definition: GenICamFeature.h:31
@ GCAcquisitionMode_SingleFrame
Definition: GenICamFeature.h:33
@ GCAcquisitionMode_Continuous
Definition: GenICamFeature.h:32
@ GCAcquisitionMode_MultipleFrame
Definition: GenICamFeature.h:34
std::multimap< std::string, GenICamFeature * > GCFeatureMap_t
Definition: GenICamFeature.h:119
GCFeatureType_t
Definition: GenICamFeature.h:13
@ GCFeatureTypeBoolean
Definition: GenICamFeature.h:15
@ GCFeatureTypeString
Definition: GenICamFeature.h:20
@ GCFeatureTypeDouble
Definition: GenICamFeature.h:17
@ GCFeatureTypeCmd
Definition: GenICamFeature.h:21
@ GCFeatureTypeDoubleMin
Definition: GenICamFeature.h:18
@ GCFeatureTypeUnknown
Definition: GenICamFeature.h:22
@ GCFeatureTypeEnum
Definition: GenICamFeature.h:16
@ GCFeatureTypeDoubleMax
Definition: GenICamFeature.h:19
@ GCFeatureTypeInteger
Definition: GenICamFeature.h:14
std::map< int, GenICamFeature * > GCAsynMap_t
Definition: GenICamFeature.h:120
Definition: GenICamFeature.h:41
virtual epicsInt64 readIntegerMax(void)=0
std::vector< std::string > mEnumStrings
Definition: GenICamFeature.h:61
std::string mFeatureName
Definition: GenICamFeature.h:59
virtual void writeBoolean(bool value)=0
virtual void writeString(std::string const &value)=0
GenICamFeatureSet * mSet
Definition: GenICamFeature.h:65
virtual std::string readString(void)=0
virtual double readDoubleMax(void)=0
virtual double readDouble(void)=0
virtual std::string readEnumString(void)=0
virtual bool isWritable(void)=0
virtual void writeDouble(double value)=0
virtual epicsInt64 readIntegerMin(void)=0
virtual bool isAvailable(void)=0
virtual epicsInt64 readIncrement(void)=0
virtual bool isReadable(void)=0
asynParamType mAsynType
Definition: GenICamFeature.h:57
virtual void writeInteger(epicsInt64 value)=0
virtual int readEnumIndex(void)=0
virtual epicsInt64 readInteger(void)=0
int mAsynIndex
Definition: GenICamFeature.h:58
virtual void writeEnumString(std::string const &value)=0
std::vector< int > mEnumValues
Definition: GenICamFeature.h:62
virtual void readEnumChoices(std::vector< std::string > &enumStrings, std::vector< int > &enumValues)=0
virtual void writeCommand(void)=0
virtual double readDoubleMin(void)=0
virtual bool isImplemented(void)=0
GCFeatureType_t mFeatureType
Definition: GenICamFeature.h:60
virtual void writeEnumIndex(int value)=0
int mImageMode
Definition: GenICamFeature.h:63
std::string mAsynName
Definition: GenICamFeature.h:56
virtual bool readBoolean(void)=0
Definition: GenICamFeature.h:123
int mAcquisitionModeMultiFrame
Definition: GenICamFeature.h:146
int mAcquisitionModeContinuous
Definition: GenICamFeature.h:147
int mAcquisitionModeSingleFrame
Definition: GenICamFeature.h:145
@ string
Definition: NDFileHDF5Layout.h:44
name
Definition: makeDbAndEdl.py:232
list value
Definition: makeDbAndEdl.py:234