SlsDetectorCamera.sip 4.21 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//###########################################################################
// 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/>.
//###########################################################################

namespace SlsDetector
{

%TypeHeaderCode
#include "SlsDetectorCamera.h"
%End

30
class Camera : public HwMaxImageSizeCallbackGen, public EventCallbackGen
31
32
{
public:
33
	Camera(std::string config_fname, int det_id = 0);
34
35
	virtual ~Camera();

36
37
	SlsDetector::Type getType();
	SlsDetector::Model *getModel();
38
39
	std::vector<std::string> getHostnameList();
	int getNbDetModules();
40

41
42
43
	void setModuleActive(int mod_idx, bool  active);
	void getModuleActive(int mod_idx, bool& active /Out/);

44
	SlsDetector::BufferMgr *getBuffer();
45

46
47
	void setPixelDepth(SlsDetector::PixelDepth  pixel_depth);
	void getPixelDepth(SlsDetector::PixelDepth& pixel_depth /Out/);
48

49
50
	void setRawMode(bool  raw_mode);
	void getRawMode(bool& raw_mode /Out/);
51

52
53
54
	SlsDetector::AcqState getAcqState();
	void waitAcqState(SlsDetector::AcqState state);
	SlsDetector::AcqState waitNotAcqState(SlsDetector::AcqState state);
55

56
	void getFrameDim(FrameDim& frame_dim /Out/, bool raw = false);
57

58
	SlsDetector::FrameMap *getFrameMap();
59
60
61
62

	void putCmd(const std::string& s, int idx = -1);
	std::string getCmd(const std::string& s, int idx = -1);

63
	int getFramesCaught();
64
	SlsDetector::Defs::DetStatus getDetStatus();
65
	SlsDetector::Defs::DetStatus getDetTrigStatus();
66

67
68
	void setTrigMode(SlsDetector::Defs::TrigMode  trig_mode);
	void getTrigMode(SlsDetector::Defs::TrigMode& trig_mode /Out/);
69
70
	void setNbFrames(unsigned long  nb_frames);
	void getNbFrames(unsigned long& nb_frames /Out/);
71
72
	void setExpTime(double  exp_time);
	void getExpTime(double& exp_time /Out/);
73
74
	void setLatTime(double  lat_time);
	void getLatTime(double& lat_time /Out/);
75
76
77
	void setFramePeriod(double  frame_period);
	void getFramePeriod(double& frame_period /Out/);

Alejandro Homs Puron's avatar
Alejandro Homs Puron committed
78
79
80
	void setSkipFrameFreq(unsigned long  skip_frame_freq);
	void getSkipFrameFreq(unsigned long& skip_frame_freq /Out/);

81
82
	// setDAC: mod_idx: 0-N=module, -1=all
	void setDAC(int mod_idx, SlsDetector::Defs::DACIndex dac_idx,
83
		    int  val,       bool milli_volt = false);
84
	void getDAC(int mod_idx, SlsDetector::Defs::DACIndex dac_idx,
85
86
87
88
89
	     	    int& val /Out/, bool milli_volt = false);
	void getDACList(SlsDetector::Defs::DACIndex dac_idx,
			std::vector<int>& val_list /Out/,
			bool milli_volt = false);

90
	void getADC(int mod_idx, SlsDetector::Defs::ADCIndex adc_idx,
91
92
93
94
		    int& val /Out/);
	void getADCList(SlsDetector::Defs::ADCIndex adc_idx,
		        std::vector<int>& val_list /Out/);

95
96
	void setSettings(SlsDetector::Defs::Settings  settings);
	void getSettings(SlsDetector::Defs::Settings& settings /Out/);
97

98
99
100
	void setTolerateLostPackets(bool  tol_lost_packets);
	void getTolerateLostPackets(bool& tol_lost_packets /Out/);

101
102
	int getNbBadFrames(int recv_idx);
	void getBadFrameList(int recv_idx, int first_idx, int last_idx,
103
			     std::vector<int>& bad_frame_list /Out/);
104
	void getBadFrameList(int recv_idx, 
105
			     std::vector<int>& bad_frame_list /Out/);
106

107
108
109
	void prepareAcq();
	void startAcq();
	void stopAcq();
110

111
112
	void triggerFrame();

113
	void getStats(SlsDetector::Stats& stats /Out/, int recv_idx=-1);
114
115

	void setPixelDepthCPUAffinityMap(
116
		SlsDetector::PixelDepthCPUAffinityMap aff_map);
117
	void getPixelDepthCPUAffinityMap(
118
		SlsDetector::PixelDepthCPUAffinityMap& aff_map /Out/);
119

120
	SlsDetector::GlobalCPUAffinityMgr::ProcessingFinishedEvent *
121
		getProcessingFinishedEvent();
122
123
124

 private:
	Camera(const SlsDetector::Camera& o);
125
126
127
128
};


}; // namespace SlsDetector