FrelonInterface.sip 8.42 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2011
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This software is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//###########################################################################
kirov's avatar
kirov committed
22
23
24
25
26
27
28
29

namespace Frelon
{


//class Interface;


30
31
32
33
34
35
36
37
38
39
40
41
42
43
class AcqEndCallback : Espia::AcqEndCallback
{

%TypeHeaderCode
#include "FrelonInterface.h"
#include <algorithm>
%End

 public:
	AcqEndCallback(Frelon::Camera& cam);
	virtual ~AcqEndCallback();

 protected:
	virtual void acqFinished(const HwFrameInfoType& /*finfo*/);
44
45
46

 private:
	AcqEndCallback(Frelon::AcqEndCallback&);
47
48
49
};


50
51
52
53
54
55
56
57
58
59
60
61
62
63
class EventCallback : EventCallback
{

%TypeHeaderCode
#include "FrelonInterface.h"
#include <algorithm>
%End

 public:
	EventCallback(HwEventCtrlObj& ctrl_obj);
	virtual ~EventCallback();

 protected:
	virtual void processEvent(Event *event);
64
65
66

 private:
	EventCallback(const Frelon::EventCallback&);
67
68
69
};


kirov's avatar
kirov committed
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
class DetInfoCtrlObj : HwDetInfoCtrlObj
{

%TypeHeaderCode
#include "FrelonInterface.h"
#include <algorithm>
%End

 public:
	DetInfoCtrlObj(Frelon::Camera& cam);
	virtual ~DetInfoCtrlObj();

	virtual void getMaxImageSize(Size& max_image_size /Out/);
	virtual void getDetectorImageSize(Size& det_image_size /Out/);

	virtual void getDefImageType(ImageType& def_image_type /Out/);
	virtual void getCurrImageType(ImageType& curr_image_type /Out/);
	virtual void setCurrImageType(ImageType  curr_image_type);

89
	virtual void getPixelSize(double& x_size /Out/, double& y_size /Out/);
kirov's avatar
kirov committed
90
91
92
	virtual void getDetectorType(std::string& det_type /Out/);
	virtual void getDetectorModel(std::string& det_model /Out/);

ahoms's avatar
ahoms committed
93
94
95
96
	virtual void registerMaxImageSizeCallback(
					HwMaxImageSizeCallback& cb);
	virtual void unregisterMaxImageSizeCallback(
					HwMaxImageSizeCallback& cb);
97
98
99

 private:
	DetInfoCtrlObj(const Frelon::DetInfoCtrlObj&);
kirov's avatar
kirov committed
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
};


class BufferCtrlObj : HwBufferCtrlObj
{

%TypeHeaderCode
#include "FrelonInterface.h"
#include <algorithm>
%End

 public:
	BufferCtrlObj(BufferCtrlMgr& buffer_mgr);
	virtual ~BufferCtrlObj();

	virtual void setFrameDim(const FrameDim& frame_dim);
116
	virtual void getFrameDim(      FrameDim& frame_dim /Out/);
kirov's avatar
kirov committed
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134

	virtual void setNbBuffers(int  nb_buffers);
	virtual void getNbBuffers(int& nb_buffers /Out/);

	virtual void setNbConcatFrames(int  nb_concat_frames);
	virtual void getNbConcatFrames(int& nb_concat_frames /Out/);

	virtual void getMaxNbBuffers(int& max_nb_buffers /Out/);

	virtual void *getBufferPtr(int buffer_nb, int concat_frame_nb = 0);
	virtual void *getFramePtr(int acq_frame_nb);

	virtual void getStartTimestamp(Timestamp& start_ts /Out/);
	virtual void getFrameInfo(int acq_frame_nb, HwFrameInfoType& info /Out/);

	virtual void   registerFrameCallback(HwFrameCallback& frame_cb);
	virtual void unregisterFrameCallback(HwFrameCallback& frame_cb);

135
136
 private:
	BufferCtrlObj(const Frelon::BufferCtrlObj&);
kirov's avatar
kirov committed
137
138
139
140
141
142
143
144
145
146
147
148
};


class SyncCtrlObj : HwSyncCtrlObj
{

%TypeHeaderCode
#include "FrelonInterface.h"
#include <algorithm>
%End

 public:
149
	SyncCtrlObj(Espia::Acq& acq, Frelon::Camera& cam);
kirov's avatar
kirov committed
150
151
	virtual ~SyncCtrlObj();

152
	virtual bool checkTrigMode(TrigMode trig_mode);
kirov's avatar
kirov committed
153
154
155
156
157
158
159
160
161
162
163
164
	virtual void setTrigMode(TrigMode  trig_mode);
	virtual void getTrigMode(TrigMode& trig_mode /Out/);

	virtual void setExpTime(double  exp_time);
	virtual void getExpTime(double& exp_time /Out/);

	virtual void setLatTime(double  lat_time);
	virtual void getLatTime(double& lat_time /Out/);

	virtual void setNbHwFrames(int  nb_frames);
	virtual void getNbHwFrames(int& nb_frames /Out/);

165
	virtual void getValidRanges(HwSyncCtrlObj::ValidRangesType& valid_ranges /Out/);
kirov's avatar
kirov committed
166

167
168
 private:
	SyncCtrlObj(const Frelon::SyncCtrlObj&);
kirov's avatar
kirov committed
169
170
171
};


172
173
174
175
176
177
178
179
180
181
182
183
184
185
class BinChangedCallback 
{

%TypeHeaderCode
#include "FrelonInterface.h"
#include <algorithm>
%End

 public:
	BinChangedCallback();
	virtual ~BinChangedCallback();

 protected:
	virtual void hwBinChanged(const Bin& hw_bin) = 0;
186
187
188

 private:
	BinChangedCallback(const Frelon::BinChangedCallback&);
189
190
191
};


kirov's avatar
kirov committed
192
193
194
195
196
197
198
199
200
class BinCtrlObj : HwBinCtrlObj
{

%TypeHeaderCode
#include "FrelonInterface.h"
#include <algorithm>
%End

 public:
201
	BinCtrlObj(Espia::Acq& acq, Frelon::Camera& cam);
kirov's avatar
kirov committed
202
203
204
205
	virtual ~BinCtrlObj();

	virtual void setBin(const Bin& bin);
	virtual void getBin(Bin& bin /Out/);
206
	virtual void checkBin(Bin& bin /In,Out/);
207
208
209

	void registerBinChangedCallback  (Frelon::BinChangedCallback& chg_cb);
	void unregisterBinChangedCallback(Frelon::BinChangedCallback& chg_cb);
210
211
212

 private:
	BinCtrlObj(const Frelon::BinCtrlObj&);
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
};


class RoiChangedCallback 
{

%TypeHeaderCode
#include "FrelonInterface.h"
#include <algorithm>
%End

 public:
	RoiChangedCallback();
	virtual ~RoiChangedCallback();

 protected:
	virtual void hwRoiChanged(const Roi& hw_roi) = 0;
230
231
232

 private:
	RoiChangedCallback(const Frelon::RoiChangedCallback&);
kirov's avatar
kirov committed
233
234
235
236
237
238
239
240
241
242
243
244
};


class RoiCtrlObj : HwRoiCtrlObj
{

%TypeHeaderCode
#include "FrelonInterface.h"
#include <algorithm>
%End

 public:
245
	RoiCtrlObj(Espia::Acq& acq, Frelon::Camera& cam);
kirov's avatar
kirov committed
246
247
248
249
250
	virtual ~RoiCtrlObj();

	virtual void checkRoi(const Roi& set_roi, Roi& hw_roi /Out/);
	virtual void setRoi(const Roi& set_roi);
	virtual void getRoi(Roi& hw_roi /Out/);
251
252
253

	void registerRoiChangedCallback  (Frelon::RoiChangedCallback& chg_cb);
	void unregisterRoiChangedCallback(Frelon::RoiChangedCallback& chg_cb);
254
255
256
257

 private:
	RoiCtrlObj(const Frelon::RoiCtrlObj&);

kirov's avatar
kirov committed
258
259
260
};


261
262
263
264
265
266
267
268
269
class FlipCtrlObj : HwFlipCtrlObj
{

%TypeHeaderCode
#include "FrelonInterface.h"
#include <algorithm>
%End

 public:
270
	FlipCtrlObj(Espia::Acq& acq, Frelon::Camera& cam);
271
272
273
	virtual ~FlipCtrlObj();

	virtual void setFlip(const Flip& flip);
274
	virtual void getFlip(Flip& flip /Out/);
275

276
	virtual void checkFlip(Flip& flip /In,Out/);
277
278
279

 private:
	FlipCtrlObj(const Frelon::FlipCtrlObj&);
280
281
282
283
284
285
286
287
288
289
290
};


class ShutterCtrlObj : HwShutterCtrlObj
{

%TypeHeaderCode
#include "FrelonInterface.h"
#include <algorithm>
%End

291
 public:
292
293
294
	ShutterCtrlObj(Frelon::Camera& cam);
	virtual ~ShutterCtrlObj();

295
296
297
298
	virtual bool checkMode(ShutterMode shut_mode);
	virtual void getModeList(ShutterModeList&  mode_list /Out/);
	virtual void setMode(ShutterMode  shut_mode);
	virtual void getMode(ShutterMode& shut_mode /Out/);
299

300
301
	virtual void setState(bool  shut_open);
	virtual void getState(bool& shut_open /Out/);
302
303
304
305
306

	virtual void setOpenTime (double  shut_open_time);
	virtual void getOpenTime (double& shut_open_time /Out/);
	virtual void setCloseTime(double  shut_close_time);
	virtual void getCloseTime(double& shut_close_time /Out/);
307

308
309
 private:
	ShutterCtrlObj(const Frelon::ShutterCtrlObj&);
310
311
312
};


313
314
315
316
317
318
319
320
class EventCtrlObj : HwEventCtrlObj
{

%TypeHeaderCode
#include "FrelonInterface.h"
#include <algorithm>
%End

321
 public:
322
323
	EventCtrlObj();
	virtual ~EventCtrlObj();
324
325
326
	
 private:
	EventCtrlObj(const Frelon::EventCtrlObj&);
327
328
329
};


kirov's avatar
kirov committed
330
331
332
333
334
335
class Interface : HwInterface
{

%TypeHeaderCode
#include "FrelonInterface.h"
#include <algorithm>
336
337
338

#define LIMA_HWCAP_TO_SIP_FRELON_CTRLOBJ_CASE(cppHwCap, aCap)		\
	LIMA_HWCAP_TO_SIP_CTRLOBJ_CASE(cppHwCap, aCap, Frelon::aCap##CtrlObj)
kirov's avatar
kirov committed
339
340
341
%End

 public:
342
343
344
	Interface(Espia::Acq& acq /KeepReference/,
	          BufferCtrlMgr& buffer_mgr /KeepReference/, 
		  Frelon::Camera& cam /KeepReference/);
kirov's avatar
kirov committed
345
346
347
	virtual ~Interface();

//	virtual const HwInterface::CapList& getCapList() const;
348
	virtual void getCapList(std::vector<HwCap> &cap_list /Out/) const;
kirov's avatar
kirov committed
349
350
351
352
353
354
355

	virtual void reset(HwInterface::ResetLevel reset_level);
	virtual void prepareAcq();
	virtual void startAcq();
	virtual void stopAcq();
	virtual void getStatus(HwInterface::StatusType& status /Out/);
	virtual int getNbHwAcquiredFrames();
356

357
358
	void resetDefaults();

359
360
361
362
363
364
365
366
367
368
369
370
	SIP_PYOBJECT getHwCtrlObj(HwCap::Type cap_type);
%MethodCode
	HwInterface::CapList cap_list;
	sipCpp->getCapList(cap_list);

	typedef HwInterface::CapList::const_iterator It;
	for (It i = cap_list.begin(); i != cap_list.end(); ++i)
		if (i->getType() == a0) {
			LIMA_CONVERT_HWCAP_TO_SIP_CTRLOBJ(i, FRELON);
			break;
		}
%End
371
372
373

 private:
	Interface(const Frelon::Interface&);
kirov's avatar
kirov committed
374
375
376
377
};


}; // namespace Frelon