Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LimaGroup
Lima-camera-slsdetector
Commits
2a7dadb2
Commit
2a7dadb2
authored
May 23, 2021
by
Alejandro Homs Puron
Browse files
Add Jungfrau::ImgSrc to test_sls_detector
parent
cdb89322
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/SlsDetectorJungfrau.h
View file @
2a7dadb2
...
...
@@ -552,6 +552,7 @@ class Jungfrau : public Model
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
Jungfrau
::
GainPed
::
MapType
map_type
);
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
Jungfrau
::
ImgSrc
src
);
std
::
istream
&
operator
>>
(
std
::
istream
&
is
,
Jungfrau
::
ImgSrc
&
src
);
}
// namespace SlsDetector
...
...
src/SlsDetectorJungfrau.cpp
View file @
2a7dadb2
...
...
@@ -1104,3 +1104,18 @@ std::ostream& lima::SlsDetector::operator <<(std::ostream& os,
return
os
<<
name
;
}
std
::
istream
&
lima
::
SlsDetector
::
operator
>>
(
std
::
istream
&
is
,
Jungfrau
::
ImgSrc
&
img_src
)
{
std
::
string
s
;
is
>>
s
;
if
(
s
==
"Raw"
)
img_src
=
Jungfrau
::
Raw
;
else
if
(
s
==
"GainPedCorr"
)
img_src
=
Jungfrau
::
GainPedCorr
;
else
throw
LIMA_HW_EXC
(
InvalidValue
,
"Invalid Jungfrau::ImgSrc: "
)
<<
s
;
return
is
;
}
test/test_slsdetector.cpp
View file @
2a7dadb2
...
...
@@ -56,6 +56,7 @@ void TestApp::Pars::loadDefaults()
raw_mode
=
false
;
debug_type_flags
=
0
;
out_dir
=
"/tmp"
;
jungfrau_img_src
=
Jungfrau
::
Raw
;
}
void
TestApp
::
Pars
::
loadOpts
()
...
...
@@ -90,6 +91,11 @@ void TestApp::Pars::loadOpts()
o
=
new
ArgOpt
<
string
>
(
out_dir
,
"-o"
,
"--out-dir"
,
"out_dir"
);
m_opt_list
.
insert
(
o
);
o
=
new
ArgOpt
<
Jungfrau
::
ImgSrc
>
(
jungfrau_img_src
,
"-i"
,
"--jungfrau-img-src"
,
"Jungfrau image source"
);
m_opt_list
.
insert
(
o
);
}
void
TestApp
::
Pars
::
parseArgs
(
Args
&
args
)
...
...
@@ -148,7 +154,10 @@ TestApp::TestApp(int argc, char *argv[])
if
(
det_type
==
EigerDet
)
{
m_model
=
new
Eiger
(
m_cam
);
}
else
if
(
det_type
==
JungfrauDet
)
{
m_model
=
new
Jungfrau
(
m_cam
);
Jungfrau
*
jungfrau
=
new
Jungfrau
(
m_cam
);
DEB_ALWAYS
()
<<
"Junfrau: ImgSrc="
<<
m_pars
.
jungfrau_img_src
;
jungfrau
->
setImgSrc
(
m_pars
.
jungfrau_img_src
);
m_model
=
jungfrau
;
}
else
THROW_HW_ERROR
(
Error
)
<<
"Unknown detector: "
<<
det_type
;
...
...
test/test_slsdetector.h
View file @
2a7dadb2
...
...
@@ -24,6 +24,8 @@
#define __TEST_SLS_DETECTOR_H
#include "SlsDetectorCamera.h"
#include "SlsDetectorEiger.h"
#include "SlsDetectorJungfrau.h"
#include "lima/AcqState.h"
#include <cstdlib>
...
...
@@ -54,6 +56,7 @@ class TestApp
bool
raw_mode
;
int
debug_type_flags
;
std
::
string
out_dir
;
Jungfrau
::
ImgSrc
jungfrau_img_src
;
Pars
();
void
parseArgs
(
Args
&
args
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment