areaDetector  3-5-0
EPICS areaDetector framework
ADLambda.h
Go to the documentation of this file.
1 
5 /* ADLambda.h
6  *
7  * This is an areaDetector driver for cameras that communicate
8  * with the X-Spectrum Lambda driver library
9  *
10  */
11 #ifndef ADLAMBDA_H
12 #define ADLAMBDA_H
13 
14 namespace DetCommonNS {
15 class LambdaSysImpl;
16 class LambdaInterface;}
17 using namespace DetCommonNS;
18 
19 #include <epicsString.h>
20 #include <epicsEvent.h>
21 #include <epicsThread.h>
22 
23 #include "ADDriver.h"
24 
28 class epicsShareClass ADLambda: public ADDriver {
29 public:
30  static const char *driverName;
31  static const int TWELVE_BIT, TWENTY_FOUR_BIT;
32  ADLambda(const char *portName, const char *configPath, int maxBuffers,
33  size_t maxMemory, int priority, int stackSize);
34  ~ADLambda();
35  virtual asynStatus disconnect(asynUser* paasynUser);
36  virtual asynStatus connect(asynUser* pasynUser);
37  asynStatus createImageHandlerThread();
38  void killImageHandlerThread();
39  int getImageDepth();
40 // int getQueueDepth();
41  short* getDecodedImageShort(long& lFrameNo, short& shErrCode);
42  int* getDecodedImageInt(long& lFrameNo, short& shErrCode);
43 // void getImageFormat(int& nX, int& nY, int& nImgDepth);
44  void handleNewImageTask(void);
45  void report(FILE *fp, int details);
46  virtual asynStatus readInt32 (asynUser *pasynUser, epicsInt32 *value);
47  virtual asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value);
48  virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
49  virtual asynStatus writeOctet(asynUser *pasynUser, const char *value,
50  size_t nChars, size_t *nActual);
51  virtual asynStatus readOctet (asynUser *pasynUser, char *value,
52  size_t maxChars, size_t *nActual, int *eomReason);
53 
54 protected:
55  // int reference to parameters
57 #define LAMBDA_FIRST_PARAM LAMBDA_VersionNumber
58 
66 #define LAMBDA_LAST_PARAM LAMBDA_BadImage
67 
68 private:
69  bool imageThreadKeepAlive;
70  asynStatus acquireStart();
71  asynStatus acquireStop();
72  asynStatus initializeDetector();
73  LambdaSysImpl* lambdaInstance;
74  int acquiredImages;
75  int imageHeight;
76  int imageWidth;
77  int imageDepth;
78  int queueDepth;
79  bool acquiringData;
80  int frameNumbersRead;
81  long totalLossFramesRead;
82  long latestImageNumberRead;
83  size_t imageDims[2];
84  char configFileName[256];
85  NDArray *pImage;
86  NDDataType_t imageDataType;
87 };
88 
89 #define LAMBDA_VersionNumberString "LAMBDA_VERSION_NUMBER"
90 #define LAMBDA_ConfigFilePathString "LAMBDA_CONFIG_FILE_PATH"
91 #define LAMBDA_EnergyThresholdString "LAMBDA_ENERGY_THRESHOLD"
92 #define LAMBDA_DecodedQueueDepthString "LAMBDA_DECODED_QUEUE_DEPTH"
93 #define LAMBDA_OperatingModeString "LAMBDA_OPERATING_MODE"
94 #define LAMBDA_DetectorStateString "LAMBDA_DETECTOR_STATE"
95 #define LAMBDA_BadFrameCounterString "LAMBDA_BAD_FRAME_COUNTER"
96 #define LAMBDA_BadImageString "LAMBDA_BAD_IMAGE"
97 
98 
99 #define NUM_LAMBDA_PARAMS ((int)(&LAMBDA_LAST_PARAM - &LAMBDA_FIRST_PARAM + 1))
100 
101 #endif
Class from which areaDetector drivers are directly derived.
Definition: ADDriver.h:141
NDDataType_t
Enumeration of NDArray data types.
Definition: NDAttribute.h:27
int LAMBDA_VersionNumber
Definition: ADLambda.h:56
int LAMBDA_ConfigFilePath
Definition: ADLambda.h:59
int LAMBDA_DetectorState
Definition: ADLambda.h:63
list value
Definition: makeDbAndEdl.py:234
int LAMBDA_EnergyThreshold
Definition: ADLambda.h:60
Class to wrap Lambda detector library provided by X-Spectrum.
Definition: ADLambda.h:28
int LAMBDA_DecodedQueueDepth
Definition: ADLambda.h:61
int LAMBDA_BadFrameCounter
Definition: ADLambda.h:64
static const int TWENTY_FOUR_BIT
Definition: ADLambda.h:31
static const char * driverName
Definition: ADLambda.h:30
int LAMBDA_BadImage
Definition: ADLambda.h:65
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:92
int LAMBDA_OperatingMode
Definition: ADLambda.h:62
Copyright (c) 2015, UChicago Argonne, LLC See LICENSE file.
Definition: ADLambda.h:14