areaDetector  3-5-0
EPICS areaDetector framework
PerkinElmer.h
Go to the documentation of this file.
1 /* PerkinElmer.h
2  *
3  * This is a driver the PerkinElmer Image Plates
4  * Models: XRD0820
5  * XRF0822
6  *
7  *
8  * Author: Brian Tieman
9  *
10  * Created: 07/24/2008
11  *
12  * Current author: Mark Rivers
13  *
14  */
15 
16 #ifndef PERKINELMER_H
17 #define PERKINELMER_H
18 
19 #include "ADDriver.h"
20 
21 #include <windows.h>
22 #include "Acq.h"
23 
24 //______________________________________________________________________________________________
25 
26 static const char *driverName = "PerkinElmer";
27 
28 //______________________________________________________________________________________________
29 
30 
31 typedef enum
32 {
37 
38 // We add an additional mode to ADImageMode = PEImageAverage
39 
40 typedef enum
41 {
47 
48 typedef enum
49 {
55 
56 typedef enum
57 {
63 } PESyncMode_t;
64 
65 
66 //______________________________________________________________________________________________
67 
68 class PerkinElmer;
69 
72 class PerkinElmer : public ADDriver
73 {
74 public:
75  PerkinElmer(const char *portName, int IDType, const char *IDValue,
76  int maxBuffers, size_t maxMemory,
77  int priority, int stackSize);
78 
79  /* These are the methods that we override from ADDriver */
80  virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
81  virtual asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value);
82  void report(FILE *fp, int details);
83 
84  // These should really be private, but they are called from C so must be public
85  void endFrameCallback(HACQDESC hAcqDesc);
86  void endAcqCallback(HACQDESC hAcqDesc);
87  void acquireStopTask(void);
88  ~PerkinElmer();
89 
90 protected:
92 #define PE_FIRST_PARAM PE_Initialize
112  int PE_Gain;
120  #define PE_LAST_PARAM PE_NumFramesToSkip
121 
122 
123 private:
124  int IDType_;
125  char *IDValue_;
126  HACQDESC hAcqDesc_;
127  epicsEventId acquireStopEvent_;
128  epicsUInt16 *pAcqBuffer_;
129  epicsUInt16 *pOffsetBuffer_;
130  DWORD *pGainBuffer_;
131  epicsUInt16 *pBadPixelMap_;
132  int *pPixelCorrectionList_;
133  unsigned int uiNumFrameBuffers_;
134  unsigned int uiNumBuffersInUse_;
135  int iAcqMode_;
136  // Keep a copy of parmeters for Acquistion_EnumSensors
137  unsigned int uiNumSensors_;
138  // Keep a copy of parmeters for Acquisition_GetCommChannel
139  unsigned int uiChannelType_;
140  int iChannelNum_;
141  // Keep a copy of parmeters from Acquisition_GetConfiguration
142  unsigned int uiDevFrames_;
143  unsigned int uiRows_;
144  unsigned int uiColumns_;
145  unsigned int uiDataType_;
146  unsigned int uiSortFlags_;
147  CHwHeaderInfo cHwHeaderInfo_;
148  CHwHeaderInfoEx cHwHeaderInfoEx_;
149  BOOL bEnableIRQ_;
150  DWORD dwAcqType_;
151  DWORD dwSystemID_;
152  DWORD dwSyncMode_;
153  DWORD dwHwAccess_;
154  DWORD dwBoardType_;
155  bool acquireSettingsChanged_;
156  bool doSoftwareTriggers_;
157 
158  bool initializeDetector (void);
159  void setBinning(void);
160  void reportSensors(FILE *fp, int details);
161 
162  void acquireSetup(void);
163  void acquireStop(void);
164  void acquireNormalImage(void);
165  void acquireOffsetImage(void);
166  void acquireGainImage(void);
167  void doSoftwareTrigger(void);
168 
169  asynStatus loadGainFile(void);
170  asynStatus saveGainFile(void);
171  asynStatus loadPixelCorrectionFile();
172 
173  void reportXISStatus(int errorCode, const char *functionName, const char *formatString, ...);
174 
175 };
176 
177 //______________________________________________________________________________________________
178 #define PE_SystemIDString "PE_SYSTEMID"
179 #define PE_InitializeString "PE_INITIALIZE"
180 #define PE_CorrectionsDirectoryString "PE_CORRECTIONS_DIRECTORY"
181 #define PE_AcquireOffsetString "PE_ACQUIRE_OFFSET"
182 #define PE_NumOffsetFramesString "PE_NUM_OFFSET_FRAMES"
183 #define PE_CurrentOffsetFrameString "PE_CURRENT_OFFSET_FRAME"
184 #define PE_UseOffsetString "PE_USE_OFFSET"
185 #define PE_OffsetAvailableString "PE_OFFSET_AVAILABLE"
186 #define PE_OffsetConstantString "PE_OFFSET_CONSTANT"
187 #define PE_AcquireGainString "PE_ACQUIRE_GAIN"
188 #define PE_NumGainFramesString "PE_NUM_GAIN_FRAMES"
189 #define PE_CurrentGainFrameString "PE_CURRENT_GAIN_FRAME"
190 #define PE_UseGainString "PE_USE_GAIN"
191 #define PE_GainAvailableString "PE_GAIN_AVAILABLE"
192 #define PE_GainFileString "PE_GAIN_FILE"
193 #define PE_LoadGainFileString "PE_LOAD_GAIN_FILE"
194 #define PE_SaveGainFileString "PE_SAVE_GAIN_FILE"
195 #define PE_UsePixelCorrectionString "PE_USE_PIXEL_CORRECTION"
196 #define PE_PixelCorrectionAvailableString "PE_PIXEL_CORRECTION_AVAILABLE"
197 #define PE_PixelCorrectionFileString "PE_PIXEL_CORRECTION_FILE"
198 #define PE_LoadPixelCorrectionFileString "PE_LOAD_PIXEL_CORRECTION_FILE"
199 #define PE_GainString "PE_GAIN"
200 #define PE_NumFrameBuffersString "PE_NUM_FRAME_BUFFERS"
201 #define PE_TriggerString "PE_TRIGGER"
202 #define PE_SyncModeString "PE_SYNC_MODE"
203 #define PE_FrameBufferIndexString "PE_FRAME_BUFFER_INDEX"
204 #define PE_ImageNumberString "PE_IMAGE_NUMBER"
205 #define PE_SkipFramesString "PE_SKIP_FRAMES"
206 #define PE_NumFramesToSkipString "PE_NUM_FRAMES_TO_SKIP"
207 
208 #define NUM_PERKIN_ELMER_PARAMS ((int)(&PE_LAST_PARAM - &PE_FIRST_PARAM + 1))
209 //______________________________________________________________________________________________
210 
211 #endif
Class from which areaDetector drivers are directly derived.
Definition: ADDriver.h:141
PerkinElmer(const char *portName, int IDType, const char *IDValue, int maxBuffers, size_t maxMemory, int priority, int stackSize)
Constructor for Perkin Elmer driver; most parameters are simply passed to ADDriver::ADDriver.
Definition: PerkinElmer.cpp:103
int PE_LoadPixelCorrectionFile
Definition: PerkinElmer.h:111
Definition: PerkinElmer.h:58
Definition: PerkinElmer.h:59
void report(FILE *fp, int details)
Report status of the driver.
Definition: PerkinElmer.cpp:572
int PE_SkipFrames
Definition: PerkinElmer.h:118
int PE_OffsetAvailable
Definition: PerkinElmer.h:98
void endFrameCallback(HACQDESC hAcqDesc)
callback function that is called by XISL every frame at end of data transfer
Definition: PerkinElmer.cpp:780
int PE_LoadGainFile
Definition: PerkinElmer.h:106
int PE_OffsetConstant
Definition: PerkinElmer.h:99
Definition: PerkinElmer.h:52
Definition: PerkinElmer.h:51
Definition: PerkinElmer.h:35
int PE_GainFile
Definition: PerkinElmer.h:105
Definition: PerkinElmer.h:50
virtual asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value)
Called when asyn clients call pasynFloat64->write().
Definition: PerkinElmer.cpp:1157
list value
Definition: makeDbAndEdl.py:234
int PE_AcquireGain
Definition: PerkinElmer.h:100
int PE_Initialize
Definition: PerkinElmer.h:91
int PE_FrameBufferIndex
Definition: PerkinElmer.h:116
int PE_PixelCorrectionFile
Definition: PerkinElmer.h:110
char * portName
The name of this asyn port.
Definition: asynPortDriver.h:179
PEAcquisitionMode_t
Definition: PerkinElmer.h:31
Definition: PerkinElmer.h:61
void endAcqCallback(HACQDESC hAcqDesc)
callback function that is called by XISL at end of acquisition
Definition: PerkinElmer.cpp:986
int PE_NumGainFrames
Definition: PerkinElmer.h:101
int PE_SyncMode
Definition: PerkinElmer.h:115
Definition: PerkinElmer.h:33
int PE_ImageNumber
Definition: PerkinElmer.h:117
int PE_CorrectionsDirectory
Definition: PerkinElmer.h:93
Definition: PerkinElmer.h:45
~PerkinElmer()
Destructor for Perkin Elmer driver; most parameters are simply passed to ADDriver::ADDriver.
Definition: PerkinElmer.cpp:207
Definition: PerkinElmer.h:34
Definition: PerkinElmer.h:62
Definition: PerkinElmer.h:43
int PE_UseOffset
Definition: PerkinElmer.h:97
void acquireStopTask(void)
Definition: PerkinElmer.cpp:1467
Definition: PerkinElmer.h:53
PESyncMode_t
Definition: PerkinElmer.h:56
int PE_NumFrameBuffers
Definition: PerkinElmer.h:113
int PE_NumOffsetFrames
Definition: PerkinElmer.h:95
int PE_CurrentOffsetFrame
Definition: PerkinElmer.h:96
int PE_AcquireOffset
Definition: PerkinElmer.h:94
PETimingMode_t
Definition: PerkinElmer.h:48
Collect ADNumImages images per Acquire command.
Definition: ADDriver.h:52
Collect images continuously until Acquire is set to 0.
Definition: ADDriver.h:53
PEImageMode_t
Definition: PerkinElmer.h:40
int PE_UsePixelCorrection
Definition: PerkinElmer.h:108
int PE_GainAvailable
Definition: PerkinElmer.h:104
int PE_UseGain
Definition: PerkinElmer.h:103
int PE_NumFramesToSkip
Definition: PerkinElmer.h:119
Definition: PerkinElmer.h:44
Driver for the Perkin Elmer flat panel amorphous silicon detectors.
Definition: PerkinElmer.h:72
int PE_Trigger
Definition: PerkinElmer.h:114
Definition: PerkinElmer.h:42
int PE_Gain
Definition: PerkinElmer.h:112
int PE_CurrentGainFrame
Definition: PerkinElmer.h:102
#define DWORD
Definition: pco_structures.h:443
Definition: PerkinElmer.h:60
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value)
Called when asyn clients call pasynInt32->write().
Definition: PerkinElmer.cpp:1051
Collect a single image per Acquire command.
Definition: ADDriver.h:51
int PE_PixelCorrectionAvailable
Definition: PerkinElmer.h:109
int PE_SaveGainFile
Definition: PerkinElmer.h:107