areaDetector  3-14
EPICS areaDetector framework
PhotonII.h
Go to the documentation of this file.
1 /* PhotonII.h
2  * This is a driver for Bruker Instrument Service (PhotonII) detectors.
3  *
4  * Author: Mark Rivers
5  * University of Chicago
6  *
7  * Created: June 11, 2017
8  *
9  */
10 
11 #include <epicsEvent.h>
12 #include <epicsTimer.h>
13 
14 #include <ADDriver.h>
15 
16 #define DRIVER_VERSION 1
17 #define DRIVER_REVISION 0
18 #define DRIVER_MODIFICATION 0
19 
20 #define PII_MAX_MESSAGE_SIZE 512
21 
22 #define PII_DRSumEnableString "PII_DRSUM_ENABLE"
23 #define PII_NumDarksString "PII_NUM_DARKS"
24 #define PII_TriggerTypeString "PII_TRIGGER_TYPE"
25 #define PII_TriggerEdgeString "PII_TRIGGER_EDGE"
26 #define PII_NumSubFramesString "PII_NUM_SUBFRAMES"
27 
28 
30 class PhotonII : public ADDriver {
31 public:
32  PhotonII(const char *portName, const char *PhotonIICommandPort,
33  int maxBuffers, size_t maxMemory,
34  int priority, int stackSize);
35 
36  /* These are the methods that we override from ADDriver */
37  virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
38  virtual asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value);
39  void report(FILE *fp, int details);
40  /* These are new methods. These should be private but are called from C so must be public */
41  void PhotonIITask();
42  asynStatus p2util(const char* command);
43  epicsEventId stopEventId_;
45  protected:
47 #define FIRST_PII_PARAM PII_DRSumEnable
52 
53  private:
54  /* These are the methods that are new to this class */
55  asynStatus readRaw(const char *fileName, epicsTimeStamp *pStartTime, double timeout, NDArray *pImage);
56  asynStatus writePhotonII(double timeout);
57  asynStatus readPhotonII(double timeout);
58 
59  /* Our data */
60  epicsEventId startEventId_;
61  char toPhotonII_[PII_MAX_MESSAGE_SIZE];
62  char fromPhotonII_[PII_MAX_MESSAGE_SIZE];
63  asynUser *pasynUserCommand_;
64  int detSizeX_;
65  int detSizeY_;
66 };
67 
#define PII_MAX_MESSAGE_SIZE
Definition: PhotonII.h:20
Class from which areaDetector drivers are directly derived.
Definition: ADDriver.h:132
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:99
Driver for Bruker Photon II detector using their p2util server over TCP/IP socket.
Definition: PhotonII.h:30
virtual asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value)
Called when asyn clients call pasynFloat64->write().
Definition: PhotonII.cpp:534
asynStatus p2util(const char *command)
Definition: PhotonII.cpp:589
int PII_TriggerType
Definition: PhotonII.h:49
int PII_NumSubFrames
Definition: PhotonII.h:51
PhotonII(const char *portName, const char *PhotonIICommandPort, int maxBuffers, size_t maxMemory, int priority, int stackSize)
Constructor for PhotonII driver; most parameters are simply passed to ADDriver::ADDriver.
Definition: PhotonII.cpp:83
int PII_NumDarks
Definition: PhotonII.h:48
int PII_DRSumEnable
Definition: PhotonII.h:46
void report(FILE *fp, int details)
Report status of the driver.
Definition: PhotonII.cpp:573
int PII_TriggerEdge
Definition: PhotonII.h:50
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value)
Called when asyn clients call pasynInt32->write().
Definition: PhotonII.cpp:461
epicsEventId stopEventId_
This should be private but is accessed from C, must be public.
Definition: PhotonII.h:43
void PhotonIITask()
This thread controls acquisition, reads SFRM files to get the image data, and does the callbacks to s...
Definition: PhotonII.cpp:268
list value
Definition: makeDbAndEdl.py:234