ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcdcsAOCAL.hpp
Go to the documentation of this file.
1
8#ifndef ngcdcsAOCAL_H
9#define ngcdcsAOCAL_H
10
11
12#ifndef __cplusplus
13#error This is a C++ include file and cannot be used from plain C
14#endif
15
16/*
17 * Local headers
18 */
20
21
22/*
23 * Clibration filter algorithms
24 */
25#define ngcdcsAOCAL_MEDIAN 1 //< median filter
26#define ngcdcsAOCAL_MEAN 2 //< mean value
27
31#define ngcdcsAOCAL_MINPIX 40
32
36typedef float ngcdcs_ao_t;
37
42{
43public:
45 ngcdcsAOCAL(ngcdcsAO *module, const ngcb_fb_t &fb);
46
48 virtual ~ngcdcsAOCAL();
49
51 int Configure(ngcbPARAM_LIST *cfg);
52
54 int Process(void *buffer, ngcdcs_finfo_t *finfo);
55
56protected:
58 int Exec();
59
61 void Exit(int status);
62
64 void CfgStatus(ngcbPARAM_LIST *cfg);
65
66private:
68 void Init_();
69
71 ngcdcsAO *ao_;
72
74 int quadrant_;
75
77 int point_;
78
80 int maxLoop_;
81
83 double skipTime_;
84
86 int expAbort_;
87
89 char naming_[64];
90
92 char format_[64];
93
95 double dit_;
96
98 int ndit_;
99
101 int nditSkip_;
102
104 int nx_;
105
107 int ny_;
108
110 int modIdx_;
111
113 int point2_;
114
116 int point3_;
117
119 int gain2_;
120
122 int gain3_;
123
125 double fps_;
126
128 double dv2_;
129
131 double dv3_;
132
134 int loop_;
135
137 double hv2_[4];
138
140 double hv3_[4];
141
143 double hv02_[4];
144
146 double hv03_[4];
147
149 double prc2_[4];
150
152 double prc3_[4];
153
155 int chanMask_[4];
156
158 char *pixMask_;
159
161 int minPix_;
162
164 double thrMin_;
165
167 double thrMax_;
168
170 int filter_;
171
173 ngcdcs_ao_t *biasImg_;
174
176 ngcdcs_ao_t *x1Img_;
177
179 ngcdcs_ao_t *img_;
180
182 char targetFile_[256];
183
185 char logFile_[256];
186
188 char comment_[256];
189
191 FILE *logFd_;
192
194 int WriteTarget_();
195
197 int NumPix_() {return (nx_ * ny_);}
198
200 int Start_();
201
203 int SetupX1_();
204
206 int SetupPoint2_();
207
209 int SetupPoint3_();
210
212 int Completed_();
213
215 int InitPixMask_();
216
218 void Copy_(ngcdcs_ao_t *target, void *source, int dataType);
219
221 void Bias_(ngcdcs_ao_t *target, void *source, int dataType);
222
224 void Bias_(ngcdcs_ao_t *target);
225
227 int Used_(int q);
228
230 int Calibrate_(int gain);
231
233 void Path_(char *path, int size, const char *fileName, const char *dir=NULL);
234
236 double Median_(ngcdcs_ao_t *buffer, int n);
237
239 double Mean_(ngcdcs_ao_t *buffer, int n);
240
241};
242
247{
248public:
251
254
256 ngcdcsEXPDRV *Make(const char *desc, const ngcdcs_system_t &sys,
257 const ngcb_fb_t &fb) {
258 int id;
259 if (sys.ctrl == NULL)
260 {
261 strcpy(ErrMsg(), "no controller instance");
262 return (NULL);
263 }
264 if (sscanf(desc, "aocal%10d", &id) < 1) id = 1;
265 if ((id < 1) || (id > sys.ctrl->numAoMod))
266 {
267 sprintf(ErrMsg(), "AO camera instance out of range [1,%d]",
268 sys.ctrl->numAoMod);
269 return (NULL);
270 }
271 return (new ngcdcsAOCAL(sys.ctrl->ao[id - 1], fb));
272 }
273
274protected:
275private:
276};
277
278extern "C" {
283}
284
285#endif
Definition ngcbPARAM.hpp:201
Definition ngcdcsAOCAL.hpp:247
ngcdcsEXPDRV * Make(const char *desc, const ngcdcs_system_t &sys, const ngcb_fb_t &fb)
Creator.
Definition ngcdcsAOCAL.hpp:256
virtual ~ngcdcsAOCAL_FACTORY()
Destructor.
Definition ngcdcsAOCAL.hpp:253
ngcdcsAOCAL_FACTORY()
Constructor.
Definition ngcdcsAOCAL.hpp:250
Definition ngcdcsAOCAL.hpp:42
ngcdcsAOCAL(ngcdcsAO *module, const ngcb_fb_t &fb)
Constructor with associated AO camera module and feed-back channel.
Definition ngcdcsAOCAL.cpp:38
virtual ~ngcdcsAOCAL()
Destructor.
Definition ngcdcsAOCAL.cpp:48
int Configure(ngcbPARAM_LIST *cfg)
Configuration call-back.
Definition ngcdcsAOCAL.cpp:189
void Exit(int status)
Exposure sequence termination call-back.
Definition ngcdcsAOCAL.cpp:573
void CfgStatus(ngcbPARAM_LIST *cfg)
Configuration status call-back.
Definition ngcdcsAOCAL.cpp:502
int Process(void *buffer, ngcdcs_finfo_t *finfo)
Processing call-back.
Definition ngcdcsAOCAL.cpp:788
int Exec()
Execution block.
Definition ngcdcsAOCAL.cpp:616
Definition ngcdcsAO.hpp:312
ngcdcsAO * ao[ngcdcsCTRL_MAX_AO]
AO cameras.
Definition ngcdcsCTRL.hpp:125
int numAoMod
Number of AO cameras.
Definition ngcdcsCTRL.hpp:128
Definition ngcdcsEXPDRV.hpp:31
ngcdcsEXPDRV(const ngcb_fb_t &fb)
Constructor with feed-back channel.
Definition ngcdcsEXPDRV.hpp:55
ngcdcsFACTORY(const char *s)
Constructor.
Definition ngcdcsFACTORY.hpp:64
char * ErrMsg()
Error message.
Definition ngcdcsFACTORY.hpp:88
float ngcdcs_ao_t
Definition ngcdcsAOCAL.hpp:36
ngcdcsAOCAL_FACTORY ngcdcsAoCal
Definition ngcdcsAOCAL.cpp:32
Definition ngcbSTREAM.hpp:28
Definition ngcdcsFINFO.hpp:468
Definition ngcdcsFACTORY.hpp:23
ngcdcsCTRL * ctrl
Controller.
Definition ngcdcsFACTORY.hpp:25