DexelaDetector API: DexelaDetector.h Source File

Dexela API

DexelaDetector.h
Go to the documentation of this file.
1 // DexelaDetector.h : main header file for the DexelaDetector DLL
2 //
4 #pragma once
5 #ifndef DEX_BUILD
6 #ifdef _DEBUG
7 #pragma comment(lib,"DexelaDetector-d.lib")
8 #else
9 #pragma comment(lib,"DexelaDetector.lib")
10 #endif
11 #endif
12 
13 #include <vector>
14 #include "DexDefs.h"
15 #include "DexImage.h"
16 #include "DexelaException.h"
17 #include <boost/shared_ptr.hpp>
18 
19 
20 #pragma warning(disable: 4251)
21 
27 class DllExport DexelaDetector
28 {
29  typedef void (*IMAGE_CALLBACK)(int fc, int buf, DexelaDetector* det);
30 
31 private:
32 
33  void* pyData;
34  char param[50];
35  DexelaException* cbException;
36 
37  bool callbackActive;
38  UINT CallbackCounterThread();
39  IMAGE_CALLBACK callback;
40 
41  HANDLE* detHandle;
42 
43  void* callbackWorker;
44 
45  //struct containing relevant info for threads
46  struct threadInfo
47  {
48  int FC;
49  int bufNum;
50  DexelaDetector* det;
51  threadInfo(int fc, int BufNum, DexelaDetector* Det)
52  {
53  FC = fc;
54  bufNum = BufNum;
55  det = Det;
56  }
57  };
58 
59 protected:
60  boost::shared_ptr<baseDetector> base;
61  boost::shared_ptr<gigEDetector> gigeDet;
62  boost::shared_ptr<camLinkDetector> clDet;
63 public:
64 
65  DexelaDetector(DevInfo &devInfo);
66  DexelaDetector(DetectorInterface transport, int unit, const char* params);
67  virtual ~DexelaDetector(void);
68 
69  virtual void OpenBoard();
70  void OpenBoard(int NumBufs);
71  void CloseBoard();
72 
73  int GetBufferXdim(void);
74  int GetBufferYdim(void);
75  int GetNumBuffers(void);
76  int GetCapturedBuffer(void);
77  int GetFieldCount(void);
78  void ReadBuffer(int bufNum, byte* buffer);
79  void ReadBuffer(int bufNum, DexImage &img, int iZ=0);
80  void WriteBuffer(int bufNum, byte* buffer);
81 
82  void SetFullWellMode(FullWellModes fwm);
83  void SetExposureMode( ExposureModes mode);
84  void SetExposureTime(float timems);
85  void SetBinningMode(bins flag);
86  void SetTestMode(BOOL SetTestOn);
87  void SetTriggerSource( ExposureTriggerSource ets);
88  void SetNumOfExposures(int num);
89  int GetNumOfExposures();
90  void SetGapTime(float timems);
91  float GetGapTime();
92  bool IsConnected();
93 
94  ExposureModes GetExposureMode();
95  float GetExposureTime();
96  DetStatus GetDetectorStatus();
97  ExposureTriggerSource GetTriggerSource();
98  BOOL GetTestMode();
99  FullWellModes GetFullWellMode();
100  bins GetBinningMode();
101  int GetSerialNumber();
102  int GetModelNumber();
103  int GetFirmwareVersion();
104  void GetFirmwareBuild(int& iDayAndMonth, int& iYear, int& iTime);
105  DetectorInterface GetTransportMethod();
106  double GetReadOutTime();
107  //float GetReadOutTime();
108  bool IsCallbackActive();
109  bool IsLive();
110 
111  void Snap(int buffer, int timeout);
112 
113  int ReadRegister(int address, int sensorNum=1);
114  void WriteRegister(int address, int value, int sensorNum=0);
115  void ClearCameraBuffer(int i);
116  void ClearBuffers();
117  void LoadSensorConfigFile(char* filename);
118  void SoftReset(void);
119 
120  void GoLiveSeq(int start, int stop,int numBuf);
121  void GoLiveSeq();
122  void GoUnLive();
123 
124  void SoftwareTrigger();
125 
126  void EnablePulseGenerator(float frequency);
127  void EnablePulseGenerator();
128  void DisablePulseGenerator();
129  void ToggleGenerator(BOOL onOff);
130 
131  void WaitImage(int timeout);
132 
133  void SetCallback(IMAGE_CALLBACK func);
134  void StopCallback();
135 
136  void CheckForCallbackError();
137  void CheckForLiveError();
138 
139  void SetPreProgrammedExposureTimes(int numExposures, float* exposuretimes_ms);
140 
141  void SetROICoordinates(unsigned short usStartColumn, unsigned short usStartRow, unsigned short usROIWidth, unsigned short usROIHeight);
142  void GetROICoordinates(unsigned short& usStartColumn,unsigned short& usStartRow,unsigned short& usROIWidth,unsigned short& usROIHeight);
143  void EnableROIMode(bool bEnableROI);
144  bool GetROIState();
145  unsigned short GetSensorHeight(unsigned short uiSensorID=1);
146  unsigned short GetSensorWidth(unsigned short uiSensorID=1);
148  bool IsFrameCntWithinImage();
149  void EnableFrameCntWithinImage(unsigned short usEnable);
150  void SetSlowed(bool flag);
151 
152  void SetReadoutMode(ReadoutModes mode);
153  ReadoutModes GetReadoutMode();
154  int QueryReadoutMode(ReadoutModes mode);
155  int QueryExposureMode( ExposureModes mode);
156  int QueryTriggerSource( ExposureTriggerSource ets);
157  int QueryFullWellMode(FullWellModes fwm);
158  int QueryBinningMode(bins flag);
159 
160  friend class baseBusScanner;
161  friend class MockSetter;
162  friend class DexelaDetectorPy;
163  friend class Dex_CL;
164 };
165 
172 typedef void (*IMAGE_CALLBACK)(int fc, int buf, DexelaDetector* det);
173 
ReadoutModes
An enumeration of ReadOut modes.
Definition: DexDefs.h:316
ExposureTriggerSource
An enumeration of exposure trigger sources.
Definition: DexDefs.h:248
void(* IMAGE_CALLBACK)(int fc, int buf, DexelaDetector *det)
Image callback function signature. This is the signature that any user-passed callback funcitons must...
Definition: DexelaDetector.h:172
FullWellModes
An enumeration of the available full well modes
Definition: DexDefs.h:185
Structure to hold the detector current status.
Definition: DexDefs.h:283
This class is used to control any interface-type Detector and acquire images from it...
Definition: DexelaDetector.h:27
This class contains information about any possible error's in the API. In the event of a problem a De...
Definition: DexelaException.h:21
A structure to hold device information.
Definition: DexDefs.h:42
ExposureModes
An enumeration of exposure modes.
Definition: DexDefs.h:224
This class is used to store and handle the images acquired from a detector.
Definition: DexImage.h:27
bins
An enumeration of the different bin levels available
Definition: DexDefs.h:73
DetectorInterface
An enumeration of detector interface types.
Definition: DexDefs.h:12
Generated on Tue Nov 25 2014 10:22:44 for DexelaDetector API by   doxygen 1.8.7