Commit 2a7dadb2 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron
Browse files

Add Jungfrau::ImgSrc to test_sls_detector

parent cdb89322
......@@ -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
......
......@@ -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;
}
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment