Commit 3be56345 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by operator for beamline
Browse files

Build with debug & tests, export Eiger::ParallelMode to SIP, update doc

* Fix bug in the call order of Model members' constructors
parent 4f41dc2c
......@@ -1239,11 +1239,13 @@ Compile *Lima*, including *slsDetectorPackage* using *CMake*:
::
(bliss) lid10eiger1:~ % cd ${LIMA_DIR}
(bliss) lid10eiger1:~/esrf/sls_detectors/Lima % cp scripts/config.txt_default scripts/config.txt
(bliss) lid10eiger1:~/esrf/sls_detectors/Lima % echo "CMAKE_BUILD_TYPE=RelWithDebInfo" >> scripts/config.txt
(bliss) lid10eiger1:~/esrf/sls_detectors/Lima % mkdir -p ${LIMA_DIR}/install/python
(bliss) lid10eiger1:~/esrf/sls_detectors/Lima % ./install.sh \
--install-prefix=${LIMA_DIR}/install \
--install-python-prefix=${LIMA_DIR}/install/python \
slsdetector sps-image gldisplay edfgz python pytango-server
slsdetector sps-image gldisplay edfgz python pytango-server tests
...
Build the documentation:
......@@ -1291,11 +1293,14 @@ to activate the high voltage; answer *No*. In the GUI, disable the *File
Name* check box and press *Start* for a single acquisition. A frame
should be taken.
Finally, test the *Lima* plugin:
Finally, test the *Lima* plugin without and with *CtControl* instantiation:
::
(bliss) lid10eiger1:~ % cd ${LIMA_DIR}
(bliss) lid10eiger1:~/esrf/sls_detectors/Lima % rm -f /tmp/eiger.edf && \
build/camera/slsdetector/test/test_slsdetector -c ${EIGER_CONFIG}
...
(bliss) lid10eiger1:~/esrf/sls_detectors/Lima % mkdir -p /nobackup/lid10eiger12/data/eiger/lima
(bliss) lid10eiger1:~/esrf/sls_detectors/Lima % ln -s /nobackup/lid10eiger12/data/eiger/lima data
(bliss) lid10eiger1:~/esrf/sls_detectors/Lima % rm -f data/img*.edf && \
......
......@@ -84,14 +84,15 @@ class Model
virtual void processRecvPort(int port_idx, FrameType frame, char *dptr,
uint32_t dsize, char *bptr) = 0;
AutoPtr<slsDetectorUsers> m_det;
private:
friend class Camera;
friend class Receiver;
Camera *m_cam;
Type m_type;
protected:
AutoPtr<slsDetectorUsers> m_det;
};
......
......@@ -36,6 +36,10 @@ class Eiger : public SlsDetector::Model
%End
public:
enum ParallelMode {
NonParallel, Parallel, Safe,
};
class Correction : public LinkTask
{
public:
......@@ -62,6 +66,9 @@ class Eiger : public SlsDetector::Model
virtual void getTimeRanges(SlsDetector::TimeRanges& time_ranges /Out/);
void setParallelMode(SlsDetector::Eiger::ParallelMode mode);
void getParallelMode(SlsDetector::Eiger::ParallelMode& mode);
protected:
virtual void updateImageSize();
......
......@@ -144,6 +144,7 @@ void Camera::AcqThread::threadFunction()
startAcq();
}
m_state = Running;
DEB_TRACE() << DEB_VAR1(m_state);
m_cond.broadcast();
SeqFilter seq_filter;
......@@ -173,8 +174,10 @@ void Camera::AcqThread::threadFunction()
}
}
} while ((m_state != StopReq) && cont_acq);
State prev_state = m_state;
m_state = Stopping;
DEB_TRACE() << DEB_VAR2(prev_state, m_state);
{
AutoMutexUnlock u(l);
stopAcq();
......@@ -197,6 +200,7 @@ void Camera::AcqThread::threadFunction()
}
m_state = Stopped;
DEB_TRACE() << DEB_VAR1(m_state);
m_cond.broadcast();
}
......
......@@ -28,7 +28,7 @@ using namespace lima::SlsDetector;
Model::Model(Camera *cam, Type type)
: m_cam(cam), m_det(m_cam->m_det), m_type(type)
: m_cam(cam), m_type(type), m_det(m_cam->m_det)
{
DEB_CONSTRUCTOR();
DEB_PARAM() << DEB_VAR1(type);
......
......@@ -140,6 +140,13 @@ TestApp::TestApp(int argc, char *argv[])
m_alloc_mgr = new SoftBufferAllocMgr();
m_buffer_mgr = new StdBufferCbMgr(*m_alloc_mgr);
m_buffer_mgr->registerFrameCallback(m_cb);
m_cam->setBufferCbMgr(m_buffer_mgr);
Type det_type = m_cam->getType();
if (det_type != EigerDet)
THROW_HW_ERROR(Error) << "Unknown detector: " << det_type;
m_model = new Eiger(m_cam);
}
void TestApp::run()
......@@ -157,7 +164,6 @@ void TestApp::run()
int max_buffers = m_buffer_mgr->getMaxNbBuffers(frame_dim, 1);
int nb_buffers = min(m_pars.nb_frames, max_buffers);
m_buffer_mgr->allocBuffers(nb_buffers, 1, frame_dim);
m_cam->setBufferCbMgr(m_buffer_mgr);
m_cam->prepareAcq();
m_last_msg_timestamp = Timestamp::now();
......
......@@ -24,9 +24,12 @@
#define __TEST_SLS_DETECTOR_H
#include "SlsDetectorCamera.h"
#include "SlsDetectorEiger.h"
#include "lima/AcqState.h"
#include <cstdlib>
#include <iomanip>
#include <fstream>
namespace lima
{
......@@ -153,9 +156,10 @@ class TestApp
void save_edf_frame(ofstream& of, int acq_idx, int edf_idx);
Pars m_pars;
AutoPtr<Camera> m_cam;
AutoPtr<SoftBufferAllocMgr> m_alloc_mgr;
AutoPtr<StdBufferCbMgr> m_buffer_mgr;
AutoPtr<Camera> m_cam;
AutoPtr<Model> m_model;
AcqState m_state;
FrameCallback m_cb;
Timestamp m_last_msg_timestamp;
......
Supports Markdown
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