FrelonInterface.sip 7.46 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
44
45
46
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*/);
};


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);
};


kirov's avatar
kirov committed
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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);

83
	virtual void getPixelSize(double& x_size /Out/, double& y_size /Out/);
kirov's avatar
kirov committed
84
85
86
	virtual void getDetectorType(std::string& det_type /Out/);
	virtual void getDetectorModel(std::string& det_model /Out/);

ahoms's avatar
ahoms committed
87
88
89
90
	virtual void registerMaxImageSizeCallback(
					HwMaxImageSizeCallback& cb);
	virtual void unregisterMaxImageSizeCallback(
					HwMaxImageSizeCallback& cb);
kirov's avatar
kirov committed
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
};


class BufferCtrlObj : HwBufferCtrlObj
{

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

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

	virtual void setFrameDim(const FrameDim& frame_dim);
107
	virtual void getFrameDim(      FrameDim& frame_dim /Out/);
kirov's avatar
kirov committed
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137

	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);

};


class SyncCtrlObj : HwSyncCtrlObj
{

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

 public:
138
	SyncCtrlObj(Espia::Acq& acq, Frelon::Camera& cam);
kirov's avatar
kirov committed
139
140
	virtual ~SyncCtrlObj();

141
	virtual bool checkTrigMode(TrigMode trig_mode);
kirov's avatar
kirov committed
142
143
144
145
146
147
148
149
150
151
152
153
	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/);

154
	virtual void getValidRanges(HwSyncCtrlObj::ValidRangesType& valid_ranges /Out/);
kirov's avatar
kirov committed
155
156
157
158

};


159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
class BinChangedCallback 
{

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

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

 protected:
	virtual void hwBinChanged(const Bin& hw_bin) = 0;
};


kirov's avatar
kirov committed
176
177
178
179
180
181
182
183
184
185
186
187
188
189
class BinCtrlObj : HwBinCtrlObj
{

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

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

	virtual void setBin(const Bin& bin);
	virtual void getBin(Bin& bin /Out/);
190
	virtual void checkBin(Bin& bin /In,Out/);
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210

	void registerBinChangedCallback  (Frelon::BinChangedCallback& chg_cb);
	void unregisterBinChangedCallback(Frelon::BinChangedCallback& chg_cb);
};


class RoiChangedCallback 
{

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

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

 protected:
	virtual void hwRoiChanged(const Roi& hw_roi) = 0;
kirov's avatar
kirov committed
211
212
213
214
215
216
217
218
219
220
221
222
};


class RoiCtrlObj : HwRoiCtrlObj
{

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

 public:
223
	RoiCtrlObj(Espia::Acq& acq, Frelon::Camera& cam);
kirov's avatar
kirov committed
224
225
226
227
228
	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/);
229
230
231

	void registerRoiChangedCallback  (Frelon::RoiChangedCallback& chg_cb);
	void unregisterRoiChangedCallback(Frelon::RoiChangedCallback& chg_cb);
kirov's avatar
kirov committed
232
233
234
};


235
236
237
238
239
240
241
242
243
244
245
246
247
class FlipCtrlObj : HwFlipCtrlObj
{

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

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

	virtual void setFlip(const Flip& flip);
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
	virtual void getFlip(Flip& flip /Out/);
	virtual void checkFlip(Flip& flip /In,Out/);
};


class ShutterCtrlObj : HwShutterCtrlObj
{

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

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

265
266
267
268
	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/);
269

270
271
	virtual void setState(bool  shut_open);
	virtual void getState(bool& shut_open /Out/);
272
273
274
275
276

	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/);
277

278
279
280
};


281
282
283
284
285
286
287
288
289
290
291
292
293
294
class EventCtrlObj : HwEventCtrlObj
{

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

public:
	EventCtrlObj();
	virtual ~EventCtrlObj();
};


kirov's avatar
kirov committed
295
296
297
298
299
300
301
302
303
class Interface : HwInterface
{

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

 public:
304
305
	Interface(Espia::Acq& acq, BufferCtrlMgr& buffer_mgr, 
		  Frelon::Camera& cam);
kirov's avatar
kirov committed
306
307
308
	virtual ~Interface();

//	virtual const HwInterface::CapList& getCapList() const;
309
	virtual void getCapList(std::vector<HwCap> &cap_list /Out/) const;
kirov's avatar
kirov committed
310
311
312
313
314
315
316

	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();
317
318
319
320
321
322
323
324
325
326
327
328
329

	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
kirov's avatar
kirov committed
330
331
332
333
};


}; // namespace Frelon