areaDetector  3-5-0
EPICS areaDetector framework
coreco.h
Go to the documentation of this file.
1 
12 // AncDemoRotationExpDlg.h : header file
13 //
14 #ifdef USE_SAP
15 
16 
17 #ifndef _CORECO_H
18 #define _CORECO_H
19 #include "grabberInterface.h"
20 #include "SapClassBasic.h"
21 //#include "SapClassGui.h"
22 
23 //#include "genCamController_S.h"
24 //#include <AncDlgLogo.h>
25 
26 // only needed if rtpro firmware will be changed dynamically
27 #define ALLOW_LOADING_FIRMWARE TRUE
28 
29 // description for each design
30 #define EXPANSION_RTPRO_ROTATION_STR "Rotation using Expansion Rtpro"
31 
33 // CAncDemoRotationExpDlg dialog
34 
35 class coreco : public grabberInterface {
36  // Construction
37  public:
38  coreco(bool is_use_fpga); // standard constructor
39 
40  int getGrabberType();
41  bool CreateObjects();
42  bool DestroyObjects();
44  static void XferCallback(SapXferCallbackInfo *pInfo);
45  static void SignalCallback(SapAcqCallbackInfo *pInfo);
46  void GetSignalStatus();
47  void GetSignalStatus(SapAcquisition::SignalStatus signalStatus);
48 
49  int getNumFreeBuffers(void);
50  int getNumBuffers(void);
51 
52  // inc missed frames counter
53  void incMissedFrames(void);
54 
55  void setCamController(void *cc);
56 
57  // bool m_bEnableRtPro;
58 
59  CORACQ hAcq;
60 
61  SapAcquisition *m_Acq;
62  SapBuffer *m_Buffers;
63  SapView *m_View;
64  SapTransfer *m_Xfer;
65  // SapRTProDesign *m_RtproDesign;
66 
67  // true to call resetServer on initialize...
68  bool is_rst_server;
69 
70  bool m_IsSignalDetected; // TRUE if camera signal is detected
71 
72  // unsigned long m_SelectedRtProDesign;
73 
74  // SapRTProDesign *NewRtproDesign( SapLocation location);
75  // bool DeleteRtproDesign( SapRTProDesign *pRtproDesign);
76  // bool InitializeRtProDesignParameters( SapRTProDesign *pRtProDesign);
77 
78  // bool readFPGARegFile(char *filename,int num_vals);
79  // bool readFPGARegsToFile(char *filename,int num_vals);
80  // bool writeFPGAReg16(int address,int value);
81 
82  virtual bool initialize(int size_x, int size_y);
83  // use to override the image size in the ccf file.
84  virtual bool initialize(int size_x, int size_y, bool is_force_size);
85  void setConfigFileName(char *name);
86  // void setFpgaFileName(char *name);
87  SapAcquisition *makeAcquision();
88  // void loadFPGA();
89 
90  int acq_device_number;
91  SapLocation *sap_location;
92 
93  int getWidth(void);
94  int getHeight(void);
95 
96  // set CC pins on the card.
97  void setPin(char *pinstr, int val);
98  void snap();
99  void grab();
100  void freeze();
101  void abort();
102  bool isFrameAvailable(void);
103  bool getFrame(void *mem_ptr);
104  bool getFrame(void *mem_ptr, unsigned int *coreco_timestamp);
105  bool getFrame(void *copy_memory, unsigned int *coreco_timestamp, int nbytes);
106 
107  bool isMissedFrame(void);
108  void clearMissedFrames(void);
109  long getTotalMissedFrames(void);
110  long getRecentMissedFrames(void);
111  void setNumBuffers(int b);
112  void makeView(void);
113 
114  void setDoubleWidth(int isdw);
115 
116  void resetBufferCount(void);
117 
118  bool is_force_size;
119 
120  bool is_destroyed;
121 
122  volatile bool is_double_width;
123 
124  static volatile long frames_to_cpu;
125  static volatile long frame_count;
126  static volatile long missed_frames;
127  static volatile long recent_missed_frames;
128  static volatile bool is_missed_frame;
129 
130  static volatile int sap_buffer_count;
131  volatile int sensor_width;
132  volatile int sensor_height;
133  volatile int num_buffers;
134 
135  // static genCamController* cam_control;
136 
137  char camera_format_file[256];
138  // char fpga_file[256];
139  char acq_server_name[256];
140  char device_name[256];
141  // SapView *m_View;
142  SapView *m_View2;
143  static coreco *mycard;
144 
145  bool sap_result;
146  int grab_index;
147  unsigned short *image_address;
148 };
149 
150 #endif // !defined(AFX_ANCROTATIONDEMODLG_H__82BFE149_F01E_11D1_AF74_00A0C91AC0FB__INCLUDED_)
151 
152 #endif
virtual void grab()=0
virtual int getGrabberType()=0
virtual void snap()=0
Virtual class to represent any vendor frame grabber.
Definition: grabberInterface.h:13
virtual int getHeight(void)=0
virtual void setConfigFileName(char *name)=0
name
Definition: makeDbAndEdl.py:232
virtual long getRecentMissedFrames(void)=0
virtual void setCamController(void *cc)=0
virtual bool DestroyObjects()=0
virtual long getTotalMissedFrames(void)=0
virtual bool isMissedFrame(void)=0
virtual void resetBufferCount(void)=0
virtual bool DestroyObjectsNoDelete()=0
virtual void clearMissedFrames(void)=0
virtual int getNumBuffers(void)=0
virtual int getNumFreeBuffers(void)=0
virtual bool getFrame(void *mem_ptr)=0
virtual bool CreateObjects()=0
virtual void setNumBuffers(int b)=0
virtual void incMissedFrames(void)=0
virtual void setDoubleWidth(int isdw)=0
virtual void GetSignalStatus()=0
virtual int getWidth(void)=0
virtual void freeze()=0
virtual bool initialize(int size_x, int size_y)=0
virtual bool isFrameAvailable(void)=0
virtual void abort()=0
virtual void setPin(char *pinstr, int val)=0
virtual void makeView(void)=0