areaDetector  3-5-0
EPICS areaDetector framework
ADCameralink.h
Go to the documentation of this file.
1 
8 #ifndef _ADCAMERALINK_H
9 #define _ADCAMERALINK_H
10 
11 #include <epicsEvent.h>
12 #include <epicsMutex.h>
13 #include <epicsTime.h>
14 #include <epicsTimer.h>
15 #include "ADDriver.h"
16 #include "grabberInterface.h"
17 #include "logfile.h"
18 
25 class epicsShareClass ADCameralink : public ADDriver {
26  public:
27  ADCameralink(const char *portName, const char *ADCameralinkPort,
28  int numparams, int maxBuffers, size_t maxMemory, int priority,
29  int stackSize);
30 
31  /* These are the methods that we override from ADDriver */
32  virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
33  virtual asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value);
34 
35  virtual void report(FILE *fp, int details);
36  void getImageTask(int arg);
39  epicsEventId
43  // handla cameralink stuff. called by main()
44  virtual void oneLoopImage(void);
45  // after we get image from card, we call this. It does nothing, but can be
46  // overridden
47  virtual void processNewImage(void *img_ptr);
48  virtual void keepHouse(void);
49  void grabberSetup(int function);
50 
51  void loadCCF();
52 
53  // image_ram ram0;
54 
55  // cameralinkCCDClass *cameralink_card;
58 
59  double elapsed_time, last_time;
60 
61  unsigned int last_timestamp;
62  unsigned int ts_diff_last, ts_diff;
63 
64  protected:
66 #define FIRST_ADCameralink_PARAM ADCameralink_first
67 
74  int is_grab;
75  int is_abort;
76  int is_snap;
77 
78  int is_freeze;
88 
92  int size_x;
93  int size_y;
97  int num_coreco_buffers; // number of buffers to request
99 
100  int is_mult_width2; // used for 8bit data
101  int cor_check_timestamps; // causes check of time stamps. otherwize ignore
102  // time stamps
103  int cor_num_free_buffers; // number of free buffers in grabber
104  int cor_num_buffers; // number of buffers we actially have in grabber
105  int cor_cant_get_ndarray; // counts num of tims we cant get nd array
106  int cor_max_ndbuffers; // limit on buffers in pool
107  int cor_max_ndmemory; // limit on memory for array pool
108  int cor_free_ndbuffers; // alloc but free nd arrays in pool
109  int cor_num_ndbuffers; // alloc nd arrays in array pool
110  int cor_alloc_ndmemory; // alloc mem in bytes in array pool
111 
112  int cor_est_buffers_left; // mamory left counted in buffgers; before we run
113  // out of mem
114  int cor_nd_datasize; // size in bytes of nd array
115  int cor_num_repeat_timestamp; // counters for missed and repeated time
116  // stamps; from corecoticks
118  int cor_missed_ts_wait; // time between shots where we dont count as missed
119  // shot- say if we stop and start acq
120  int cor_use_image_mode; // causes grabber to not grab more then ADNumImages
121  // if in multi mode; or single mode. otheruse grab
122  // all shots
123  int cor_reset_buff_index; // reset buffer index to clear untransfered
124  // frames...
126 
127  // got frame but threw away- counter
129 
131 
133 #define LAST_ADCameralink_PARAM ADCameralink_last
134 
135  enum { ADCameralink_paramint, ADCameralink_paramdoub };
136 
137  virtual void grabSerialMutex(void);
138  virtual void releaseSerialMutex(void);
139  virtual void grabGrabberMutex(void);
140  virtual void releaseGrabberMutex(void);
141 
142  virtual void setDebuggingMessage(int level);
143 
144  virtual int getSemaphore(void);
145 
146  virtual void incSemaphore(void);
147 
148  volatile int dbg_msg_level;
149 
150  int getIntParam(int param);
151  double getDoubleParam(int param);
152 
153  char *getStringParam(int param);
154 
155  // int function;
156 
157  char cpstr[256];
158  /* Our data */
159  epicsEventId startEventId;
160  epicsEventId imageEventId;
161  epicsTimeStamp acqStartTime;
162  epicsTimeStamp acqEndTime;
163  epicsTimerId timerId;
166 
167  asynUser *pasynUserServer;
169  size_t dims[2];
170  // mutex protexted counter
171  volatile int semaphore_counter;
172  epicsMutexId cntMutex;
173  epicsMutexId serialMutex;
174  epicsMutexId grabberMutex;
175 
177 };
178 
179 #define NUM_ADCameralink_PARAMS \
180  (&LAST_ADCameralink_PARAM - &FIRST_ADCameralink_PARAM + 1)
181 
182 #endif
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value)
Sets an int32 parameter.
Definition: ADDriver.cpp:114
Class from which areaDetector drivers are directly derived.
Definition: ADDriver.h:141
The NDArrayPool class manages a free list (pool) of NDArray objects.
Definition: NDArray.h:161
Virtual class to represent any vendor frame grabber.
Definition: grabberInterface.h:13
virtual asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value)
Called when asyn clients call pasynFloat64->write().
Definition: asynPortDriver.cpp:2083
virtual void report(FILE *fp, int details)
Report status of the driver.
Definition: asynNDArrayDriver.cpp:679
virtual asynStatus getStringParam(int index, int maxChars, char *value)
Returns the value for a string from the parameter library.
Definition: asynPortDriver.cpp:1474
virtual asynStatus getDoubleParam(int index, double *value)
Returns the value for a double from the parameter library.
Definition: asynPortDriver.cpp:1449
list value
Definition: makeDbAndEdl.py:234
Class LOG_FILE.
Definition: logfile.h:38
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:92