...
 
Commits (32)
###########################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2017
# European Synchrotron Radiation Facility
# CS40220 38043 Grenoble Cedex 9
# FRANCE
#
# Contact: lima@esrf.fr
#
# 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/>.
############################################################################
set(NAME "marccd")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--add-needed")
set(${NAME}_srcs src/MarccdCamera.cpp src/MarccdInterface.cpp
src/MarccdDetInfoCtrlObj.cpp src/MarccdSyncCtrlObj.cpp
src/MarccdBinCtrlObj.cpp src/MarccdBufferCtrlObj.cpp
src/MarccdRoiCtrlObj.cpp src/MarccdReader.cpp)
add_library(lima${NAME} SHARED ${${NAME}_srcs})
target_include_directories(lima${NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_include_directories(lima${NAME} PUBLIC "/usr/local/yat/include")
find_library(MARCCD_YAT_LIB yat /usr/local/yat/lib64)
find_library(MARCCD_RT_LIB rt)
if("${MARCCD_RT_LIB}" STREQUAL "MARCCD_RT_LIB-NOTFOUND")
message(FATAL_ERROR "${NAME} : librt not found, you can search it in cmake-gui or try to install it if it isn't here.")
endif()
if("${MARCCD_YAT_LIB}" STREQUAL "MARCCD_YAT_LIB-NOTFOUND")
message(FATAL_ERROR "${NAME} : libyat not found, you can search it in cmake-gui or try to install it if it isn't here.")
endif()
target_link_libraries(lima${NAME} limacore)
target_link_libraries(lima${NAME} ${MARCCD_YAT_LIB})
target_link_libraries(lima${NAME} ${MARCCD_RT_LIB})
limatools_set_library_soversion(lima${NAME} "VERSION")
install(TARGETS lima${NAME} LIBRARY DESTINATION lib)
if(LIMA_ENABLE_PYTHON)
limatools_run_sip_for_camera(${NAME})
install(FILES python/__init__.py DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Marccd")
endif()
src-dirs = src
test-dirs =
include ../../global.inc
.. _camera-marccd:
MarCCD
-------
------
.. image:: marccd.png
......@@ -8,39 +10,25 @@ Intoduction
The SX165 features a round, 165 mm diameter active area, and a versatile, high resolution CCD chip. It is the ideal X-ray detector for research applications with both synchrotrons and rotating anode X-ray sources.
Module configuration
````````````````````
The minimum configuration file is *config.inc* :
.. code-block:: sh
Prerequisite
````````````
The MarCCD software server should be started on the MarCCD host computer, by running the command:
COMPILE_CORE=1
COMPILE_SIMULATOR=0
COMPILE_SPS_IMAGE=1
COMPILE_ESPIA=0
COMPILE_FRELON=0
COMPILE_MAXIPIX=0
COMPILE_PILATUS=0
COMPILE_BASLER=0
COMPILE_MARCCD=1
COMPILE_CBF_SAVING=0
export COMPILE_CORE COMPILE_SPS_IMAGE COMPILE_SIMULATOR \
COMPILE_ESPIA COMPILE_FRELON COMPILE_MAXIPIX COMPILE_PILATUS COMPILE_MARCCD\
COMPILE_BASLER COMPILE_CBF_SAVING
.. code-block:: bash
marccd -r
See :ref:`Compilation`
Then you can launch your lima/marccd client on another host, as the MarCCD server can be reached by network
Installation
`````````````
- First you have to start the server part on the Marccd host: marccd -r
- Then you can launch your lima/marccd client on another host, as the marccd server can be reached by network
Initialisation and Capabilities
````````````````````````````````
In order to help people to understand how the camera plugin has been implemented in LImA this section
provide some important information about the developer's choices.
Configuration
``````````````
Camera initialisation
......................
There are 4 parameter to be filled by your Lima client:
......@@ -49,3 +37,66 @@ There are 4 parameter to be filled by your Lima client:
- The detector target path: the path where will be saved the marccd image files
- Reader timeout: in ms, the timeout after which the plugin will be in fault if no marccd image file is present
Std capabilites
................
This plugin has been implemented in respect of the mandatory capabilites but with some limitations according
to some programmer's choices. We only provide here extra information for a better understanding
of the capabilities for the MarCCD camera.
* HwDetInfo
- Max image size is : 4096 * 4096
- 16 bit unsigned type is supported
* HwSync
trigger type supported are:
- IntTrig
Optional capabilites
........................
* HwBin
- 2 * 2
- 4 * 4
- 8 * 8
* HwRoi
Configuration
`````````````
No Specific hardware configuration are needed
How to use
````````````
here is the list of accessible fonctions to configure and use the MarCCD detector:
.. code-block:: cpp
void getDetectorImageSize(Size& size);
void setImagePath(const std::string& path);
const std::string& getImagePath(void);
void setImageFileName(const std::string& imgName);
const std::string& getImageFileName();
void setImageIndex(int newImgIdx);
int getImageIndex();
int getFirstImage();
bool isStopSequenceFinished();
void saveBGFrame(bool);
void setBeamX(float);
float getBeamX();
void setBeamY(float);
float getBeamY();
void setDistance(float);
float getDistance();
void setWavelength(float);
float getWavelength();
//###########################################################################
// 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/>.
//###########################################################################
#ifndef MARCCDBINCTRLOBJ_H
#define MARCCDBINCTRLOBJ_H
#include "MarccdCamera.h"
#include "lima/HwBinCtrlObj.h"
namespace lima
{
namespace Marccd
{
/*******************************************************************
* \class BinCtrlObj
* \brief Control object providing MarCCD Bin interface
*******************************************************************/
class BinCtrlObj : public HwBinCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera,"BinCtrlObj","MarCCD");
public:
BinCtrlObj(Camera&);
virtual ~BinCtrlObj();
virtual void setBin(const Bin& bin);
virtual void getBin(Bin& bin);
virtual void checkBin(Bin& bin);
private:
Camera& m_cam;
};
} // namespace Marccd
} // namespace lima
#endif // MARCCDBINCTRLOBJ_H
//###########################################################################
// 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/>.
//###########################################################################
#ifndef MARCCDBUFFERCTRLOBJ_H
#define MARCCDBUFFERCTRLOBJ_H
#include "MarccdCamera.h"
#include "MarccdReader.h"
#include "lima/HwBufferCtrlObj.h"
//#include "HwBufferMgr.h"
namespace lima
{
namespace Marccd
{
//*******************************************************************
// \class BufferCtrlObj
// \brief Control object providing Marccd buffering interface
//*******************************************************************
class BufferCtrlObj : public HwBufferCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "BufferCtrlObj", "MarCCD");
public:
BufferCtrlObj(Camera& simu);
virtual ~BufferCtrlObj();
virtual void setFrameDim(const FrameDim& frame_dim);
virtual void getFrameDim(FrameDim& frame_dim);
virtual void setNbBuffers(int nb_buffers);
virtual void getNbBuffers(int& nb_buffers);
virtual void setNbConcatFrames(int nb_concat_frames);
virtual void getNbConcatFrames(int& nb_concat_frames);
virtual void getMaxNbBuffers(int& max_nb_buffers);
virtual void *getBufferPtr(int buffer_nb, int concat_frame_nb = 0);
virtual void *getFramePtr(int acq_frame_nb);
virtual void getStartTimestamp(Timestamp& start_ts);
virtual void getFrameInfo(int acq_frame_nb, HwFrameInfoType& info);
// -- Buffer control object
BufferCtrlMgr& getBufferMgr()
{
return m_buffer_ctrl_mgr;
};
StdBufferCbMgr& getBufferCbMgr()
{
return m_buffer_cb_mgr;
};
virtual void registerFrameCallback(HwFrameCallback& frame_cb);
virtual void unregisterFrameCallback(HwFrameCallback& frame_cb);
// Reader stuff
void start();
void reset();
int getLastAcquiredFrame();
bool isTimeoutSignaled(void);
bool isRunning(void);
void setTimeout(int TO);
void setWaitFileOnDiskTime(double value);
double getWaitFileOnDiskTime(void);
int* getHeader(void);
private:
SoftBufferAllocMgr m_buffer_alloc_mgr;
StdBufferCbMgr m_buffer_cb_mgr;
BufferCtrlMgr m_buffer_ctrl_mgr;
Camera& m_cam;
Reader* m_reader;
};
} // namespace Marccd
} // namespace lima
#endif // MARCCDBUFFERCTRLOBJ_H
......@@ -7,7 +7,7 @@
#include <yat/threading/Task.h>
#include <yat/network/ClientSocket.h>
#include <yat/time/Time.h>
#include <Timer.h>
#include "lima/Timer.h"
#define kLO_WATER_MARK 128
#define kHI_WATER_MARK 512
......@@ -19,7 +19,7 @@
#include <stdlib.h>
#include <limits>
#include "HwBufferMgr.h"
#include "lima/HwBufferMgr.h"
namespace lima
{
......@@ -247,8 +247,8 @@ namespace lima
yat::ClientSocket m_sock;
//- mutex's to protect some variables from acces read/write from device & task
yat::Mutex m_lock;
yat::Mutex m_lock_flag;
yat::Mutex m_lock_data;
yat::Mutex m_lock_cmd;
yat::Mutex m_lock_status;
//- image/file stuff
......
//###########################################################################
// 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/>.
//###########################################################################
#ifndef MARCCDDETINFOCTRLOBJ_H
#define MARCCDDETINFOCTRLOBJ_H
#include "MarccdCamera.h"
#include "lima/HwDetInfoCtrlObj.h"
#include "lima/HwMaxImageSizeCallback.h"
namespace lima
{
namespace Marccd
{
//*******************************************************************
// \class DetInfoCtrlObj
// \brief Control object providing Marccd detector info interface
//*******************************************************************
class DetInfoCtrlObj : public HwDetInfoCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "DetInfoCtrlObj","MarCCD");
public:
DetInfoCtrlObj(Camera&);
virtual ~DetInfoCtrlObj();
virtual void getMaxImageSize(Size& max_image_size);
virtual void getDetectorImageSize(Size& det_image_size);
virtual void getDefImageType(ImageType& def_image_type);
virtual void getCurrImageType(ImageType& curr_image_type);
virtual void setCurrImageType(ImageType curr_image_type);
virtual void getPixelSize(double& x_size,double &y_size);
virtual void getDetectorType(std::string& det_type);
virtual void getDetectorModel(std::string& det_model);
virtual void registerMaxImageSizeCallback(HwMaxImageSizeCallback& cb) {} //- unused for Marccd
virtual void unregisterMaxImageSizeCallback(HwMaxImageSizeCallback& cb) {} //- unused for Marccd
private:
Camera& m_cam;
};
} // namespace Marccd
} // namespace lima
#endif // MARCCDDETINFOCTRLOBJ_H
//###########################################################################
// 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/>.
//###########################################################################
#ifndef MARCCD_INTERFACE_H
#define MARCCD_INTERFACE_H
#include "HwInterface.h"
#include "lima/HwInterface.h"
#include "MarccdCamera.h"
#include "MarccdReader.h"
#include "MarccdDetInfoCtrlObj.h"
#include "MarccdBufferCtrlObj.h"
#include "MarccdSyncCtrlObj.h"
#include "MarccdRoiCtrlObj.h"
#include "MarccdBinCtrlObj.h"
namespace lima
{
namespace Marccd
{
class Interface;
//*******************************************************************
// \class DetInfoCtrlObj
// \brief Control object providing Marccd detector info interface
//*******************************************************************
class DetInfoCtrlObj : public HwDetInfoCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "DetInfoCtrlObj", "Marccd");
public:
DetInfoCtrlObj(Camera& cam);
virtual ~DetInfoCtrlObj();
virtual void getMaxImageSize(Size& max_image_size);
virtual void getDetectorImageSize(Size& det_image_size);
virtual void getDefImageType(ImageType& def_image_type);
virtual void getCurrImageType(ImageType& curr_image_type);
virtual void setCurrImageType(ImageType curr_image_type);
virtual void getPixelSize(double& x_size, double &y_size);
virtual void getDetectorType(std::string& det_type);
virtual void getDetectorModel(std::string& det_model);
virtual void registerMaxImageSizeCallback(HwMaxImageSizeCallback& cb);
virtual void unregisterMaxImageSizeCallback(HwMaxImageSizeCallback& cb);
private:
class MaxImageSizeCallbackGen : public HwMaxImageSizeCallbackGen
{
protected:
virtual void setMaxImageSizeCallbackActive(bool cb_active);
};
Camera& m_cam;
MaxImageSizeCallbackGen m_mis_cb_gen;
};
//*******************************************************************
// \class BufferCtrlObj
// \brief Control object providing Marccd buffering interface
//*******************************************************************
class BufferCtrlObj : public HwBufferCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "BufferCtrlObj", "Marccd");
public:
BufferCtrlObj(Camera& simu);
virtual ~BufferCtrlObj();
virtual void setFrameDim(const FrameDim& frame_dim);
virtual void getFrameDim(FrameDim& frame_dim);
virtual void setNbBuffers(int nb_buffers);
virtual void getNbBuffers(int& nb_buffers);
virtual void setNbConcatFrames(int nb_concat_frames);
virtual void getNbConcatFrames(int& nb_concat_frames);
virtual void getMaxNbBuffers(int& max_nb_buffers);
virtual void *getBufferPtr(int buffer_nb, int concat_frame_nb = 0);
virtual void *getFramePtr(int acq_frame_nb);
virtual void getStartTimestamp(Timestamp& start_ts);
virtual void getFrameInfo(int acq_frame_nb, HwFrameInfoType& info);
// -- Buffer control object
BufferCtrlMgr& getBufferMgr()
{
return m_buffer_ctrl_mgr;
};
StdBufferCbMgr& getBufferCbMgr()
{
return m_buffer_cb_mgr;
};
virtual void registerFrameCallback(HwFrameCallback& frame_cb);
virtual void unregisterFrameCallback(HwFrameCallback& frame_cb);
// Reader stuff
void start();
void reset();
int getLastAcquiredFrame();
bool isTimeoutSignaled(void);
bool isRunning(void);
void setTimeout(int TO);
int* getHeader(void);
private:
SoftBufferAllocMgr m_buffer_alloc_mgr;
StdBufferCbMgr m_buffer_cb_mgr;
BufferCtrlMgr m_buffer_ctrl_mgr;
Camera& m_cam;
Reader* m_reader;
};
//*******************************************************************
// * \class SyncCtrlObj
// * \brief Control object providing Marccd synchronization interface
// *******************************************************************/
class SyncCtrlObj : public HwSyncCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "SyncCtrlObj", "Marccd");
public:
SyncCtrlObj(Camera& cam);
virtual ~SyncCtrlObj();
virtual bool checkTrigMode(TrigMode trig_mode);
virtual void setTrigMode(TrigMode trig_mode);
virtual void getTrigMode(TrigMode& trig_mode);
virtual void setExpTime(double exp_time);
virtual void getExpTime(double& exp_time);
virtual void setLatTime(double lat_time); //- Not supported by Marccd, simulate it using the theoric readout values
virtual void getLatTime(double& lat_time); //- Not supported by Marccd, simulate it using the theoric readout values
virtual void setNbFrames(int nb_frames);
virtual void getNbFrames(int& nb_frames);
virtual void setNbHwFrames(int nb_frames);
virtual void getNbHwFrames(int& nb_frames);
virtual void getValidRanges(ValidRangesType& valid_ranges);
private:
Camera& m_cam;
};
/*******************************************************************
* \class RoiCtrlObj
* \brief Control object providing Basler Roi interface
*******************************************************************/
class RoiCtrlObj : public HwRoiCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "RoiCtrlObj", "MarCCD");
public:
RoiCtrlObj(Camera& cam);
virtual ~RoiCtrlObj();
virtual void setRoi(const Roi& set_roi);
virtual void getRoi(Roi& hw_roi);
virtual void checkRoi(const Roi& set_roi, Roi& hw_roi);
private:
Camera& m_cam;
};
/*******************************************************************
* \class BinCtrlObj
* \brief Control object providing MarCCD Bin interface
*******************************************************************/
class BinCtrlObj : public HwBinCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "BinCtrlObj", "MarCCD");
public:
BinCtrlObj(Camera& cam);
virtual ~BinCtrlObj();
virtual void setBin(const Bin& bin);
virtual void getBin(Bin& bin);
virtual void checkBin(Bin& bin);
private:
Camera& m_cam;
};
//*******************************************************************
// * \class Interface
// * \brief Marccd hardware interface
//*******************************************************************/
class Interface : public HwInterface
{
DEB_CLASS_NAMESPC(DebModCamera, "Interface", "Marccd");
DEB_CLASS_NAMESPC(DebModCamera, "Interface", "MarCCD");
public:
Interface(Camera& cam);
......@@ -208,34 +53,17 @@ namespace lima
virtual void startAcq();
virtual void stopAcq();
virtual void getStatus(StatusType& status);
virtual int getNbAcquiredFrames();
virtual int getNbHwAcquiredFrames();
void takeBackgroundFrame();
void saveBGFrame();
void setImageIndex(int imgIdx);
int getImageIndex(void);
//! get the camera object to access it directly from client
Camera& getCamera()
{ return m_cam; }
void setImageFileName(const string& name);
const string& getImageFileName(void);
void setImagePath(const string& path);
const string& getImagePath(void);
void setBeamX(float);
void setBeamY(float);
void setDistance(float);
void setWavelength(float);
float getBeamX();
float getBeamY();
float getDistance();
float getWavelength();
int* getHeader(void);
//- Allow the Reader to wait a file on disk during TO (in s)
//- Specific to MarCCD
int* getHeader();
void setTimeout(int TO);
void setWaitFileOnDiskTime(double value);
double getWaitFileOnDiskTime(void);
private:
Camera& m_cam;
......@@ -245,7 +73,6 @@ namespace lima
SyncCtrlObj m_sync;
RoiCtrlObj m_roi;
BinCtrlObj m_bin;
};
} // namespace Marccd
......
......@@ -14,16 +14,8 @@
#include <limits>
//#include "Debug.h"
#include "Data.h"
#include "HwMaxImageSizeCallback.h"
#include "lima/HwMaxImageSizeCallback.h"
#include "MarccdCamera.h"
#include "HwBufferCtrlObj.h"
using namespace lima;
using namespace lima::Marccd;
using namespace std;
......@@ -34,11 +26,11 @@ namespace lima
/***
* MarCCD header structure
***/
#define UINT32 unsigned int
#define UINT16 unsigned short
#define INT32 signed int
#define INT16 signed short
#define MARCCD_MAXIMAGES 9
typedef unsigned int UINT32;
typedef unsigned short UINT16;
typedef signed int INT32;
typedef signed short INT16;
const int MARCCD_MAXIMAGES = 9;
typedef struct
{
......@@ -227,6 +219,8 @@ namespace lima
bool isRunning();
//- define max allowed time to _read image file
void setTimeout(double);
void setWaitFileOnDiskTime(double value);
double getWaitFileOnDiskTime(void);
//- get last image header
int* getHeader();
......@@ -250,7 +244,8 @@ namespace lima
//- Timeout management (while processing image file)
yat::Timeout m_timeout;
int m_timeout_value;
int m_timeout_value;
double m_wait_file_on_disk_time;//in ms
MARCCD_HEADER_UNION hccd;
};
......
//###########################################################################
// 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/>.
//###########################################################################
#ifndef MARCCDROICTRLOBJ_H
#define MARCCDROICTRLOBJ_H
#include "MarccdCamera.h"
#include "lima/HwRoiCtrlObj.h"
namespace lima
{
namespace Marccd
{
/*******************************************************************
* \class RoiCtrlObj
* \brief Control object providing Marccd Roi interface
*******************************************************************/
class RoiCtrlObj : public HwRoiCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera,"RoiCtrlObj","MarCCD");
public:
RoiCtrlObj(Camera&);
virtual ~RoiCtrlObj();
virtual void setRoi(const Roi& set_roi);
virtual void getRoi(Roi& hw_roi);
virtual void checkRoi(const Roi& set_roi, Roi& hw_roi);
private:
Camera& m_cam;
};
} // namespace Marccd
} // namespace lima
#endif // MARCCDROICTRLOBJ_H
//###########################################################################
// 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/>.
//###########################################################################
#ifndef MARCCDSYNCCTRLOBJ_H
#define MARCCDSYNCCTRLOBJ_H
#include "MarccdCamera.h"
#include "lima/HwSyncCtrlObj.h"
namespace lima
{
namespace Marccd
{
//*******************************************************************
// * \class SyncCtrlObj
// * \brief Control object providing Marccd synchronization interface
// *******************************************************************/
class SyncCtrlObj : public HwSyncCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera,"SyncCtrlObj","MarCCD");
public:
SyncCtrlObj(Camera&);
virtual ~SyncCtrlObj();
virtual bool checkTrigMode(TrigMode trig_mode);
virtual void setTrigMode(TrigMode trig_mode);
virtual void getTrigMode(TrigMode& trig_mode);
virtual void setExpTime(double exp_time);
virtual void getExpTime(double& exp_time);
virtual void setLatTime(double lat_time); //- Not supported by Marccd, simulate it using the theoric readout values
virtual void getLatTime(double& lat_time); //- Not supported by Marccd, simulate it using the theoric readout values
virtual void setNbHwFrames(int nb_frames);
virtual void getNbHwFrames(int& nb_frames);
virtual void getValidRanges(ValidRangesType& valid_ranges);
private:
Camera& m_cam;
};
} // namespace Marccd
} // namespace lima
#endif // MARCCDSYNCCTRLOBJ_H
......@@ -2,39 +2,93 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>fr.soleil.lib.Lima</groupId>
<artifactId>Camera</artifactId>
<version>1.2.3</version>
<groupId>fr.soleil</groupId>
<artifactId>super-pom-C-CPP</artifactId>
<version>RELEASE</version>
</parent>
<groupId>fr.soleil.lib.Lima.Camera</groupId>
<artifactId>LimaMarccd-${aol}-shared-${mode}</artifactId>
<packaging>nar</packaging>
<version>1.3.4</version>
<name>LimaMarccd</name> <!-- use for the name of executable -->
<packaging>nar</packaging>
<name>LimaMarccd</name>
<description>This module controls the MarCCD SX 165 Detector</description>
<scm>
<connection>scm:git:git://github.com/soleil-ica/Lima-camera-marccd.git</connection>
<developerConnection>scm:git:git://github.com/soleil-ica/Lima-camera-marccd.git</developerConnection>
<url>https://github.com/soleil-ica/Lima-camera-marccd</url>
</scm>
<dependencies>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>LimaCore-${aol}-shared-${mode}</artifactId>
<version>1.3.4</version>
</dependency>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>YAT-${aol}-${library}-${mode}</artifactId>
</dependency>
<dependency>
<groupId>ncsa.uiuc.edu</groupId>
<artifactId>HDF5-${aol}-shared-release</artifactId>
<version>1.8.13</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.freehep</groupId>
<artifactId>freehep-nar-plugin</artifactId>
<configuration>
<cpp>
<defines>
<define>LOG4TANGO_HAVE_INT64_T</define>
</defines>
</cpp>
</configuration>
</plugin>
</plugins>
<plugins>
<plugin>
<groupId>org.freehep</groupId>
<artifactId>freehep-nar-plugin</artifactId>
<configuration>
<cpp>
<sourceDirectory>src</sourceDirectory>
<includePaths>
<includePath>include</includePath>
</includePaths>
<!-- define less verbose mode for gcc-->
<options>
<option>-w</option>
</options>
</cpp>
<libraries>
<library>
<type>shared</type>
</library>
</libraries>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>uk.ac.ccp4</groupId>
<artifactId>DiffractionImage-${aol}-shared-release</artifactId>
</dependency>
</dependencies>
<developers>
<developer>
<id>langlois</id>
<name>langlois</name>
<url>http://controle/</url>
<organization>Synchrotron Soleil</organization>
<organizationUrl>http://www.synchrotron-soleil.fr</organizationUrl>
<roles>
<role>manager</role>
</roles>
<timezone>1</timezone>
</developer>
<developer>
<id>noureddine</id>
<name>noureddine</name>
<url>http://controle/</url>
<organization>Synchrotron Soleil</organization>
<organizationUrl>http://www.synchrotron-soleil.fr</organizationUrl>
<roles>
<role>developer</role>
</roles>
<timezone>1</timezone>
</developer>
</developers>
</project>
......@@ -34,9 +34,8 @@ namespace Marccd
void start();
void stop();
void take_background_frame();
void prepare(); //- USEFULL ?
// -- detector info
void getImageSize(Size& size /Out/);
......@@ -63,13 +62,11 @@ namespace Marccd
void getStatus(Marccd::Camera::Status& status /Out/);
unsigned int getState();
void getFrameRate(double& frame_rat /Out/);
void setBinning(const Bin&);
void getBinning(Bin& /Out/);
void checkBin(Bin& /In,Out/);
bool is_stop_sequence_finished();
void setImagePath(const std::string& path);
const std::string& getImagePath();
......@@ -79,12 +76,10 @@ namespace Marccd
void setImageFileName(const std::string& imgName);
const std::string& getImageFileName();
const std::string& getFullImgName();
void setImageIndex(int newImgIdx);
int getImageIndex();
int getFirstImage() ;
void saveBG(bool);
void setBeamX(float);
void setBeamY(float);
......
......@@ -12,7 +12,7 @@ class Interface : HwInterface
%End
public:
Interface(Marccd::Camera& cam);
Interface(Marccd::Camera& cam /KeepReference/);
virtual ~Interface();
//- From HwInterface
......@@ -26,29 +26,6 @@ class Interface : HwInterface
virtual int getNbAcquiredFrames();
virtual int getNbHwAcquiredFrames();
void takeBackgroundFrame();
void saveBG();
void getFrameRate(double& frame_rate);
void setImageIndex(int imgIdx);
int getImageIndex();
void setImageFileName(const std::string& name);
const std::string& getImageFileName();
void setImagePath(const std::string& path);
const std::string& getImagePath();
unsigned int getCamState();
void setBeamX(float);
void setBeamY(float);
void setDistance(float);
void setWavelength(float);
float getBeamX();
float getBeamY();
float getDistance();
float getWavelength();
SIP_PYDICT getHeader();
%MethodCode
......
marccd-objs = MarccdInterface.o MarccdCamera.o MarccdReader.o
SRCS = $(marccd-objs:.o=.cpp)
CXXFLAGS += -I../include -I../../../hardware/include -I../../../common/include \
-I../../../third-party/Processlib/core/include \
-I../../../../include/DiffractionImage \
-I../../../third-party/yat/include \
-Wall -pthread -fPIC -g
#CXXFLAGS += -fPIC -I../../../third-party/Processlib/core/include \
# -I../../../../DiffractionImage \
# -I../../../third-party/yat/include \
# -I../include \
# -I../../../hardware/include \
# -I../../../common/include
# -pthread -fPIC -g \
# -L../../../third-party/yat/src/.libs -lyat \
# -L../../../../DiffractionImage/.libs -lDiffractionImage
all: Marccd.o
Marccd.o: $(marccd-objs)
$(LD) -o $@ -r $+
clean:
rm -f *.o *.P
%.o : %.cpp
$(COMPILE.cpp) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
.PHONY: check-syntax
check-syntax:
$(CXX) -Wall -Wextra -fsyntax-only $(CXXFLAGS) $(CHK_SOURCES)
//###########################################################################
// 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/>.
//###########################################################################
#include "MarccdBinCtrlObj.h"
#include "MarccdCamera.h"
using namespace lima;
using namespace lima::Marccd;
#define MINBINX 1
#define MAXBINX 8
#define MINBINY 1
#define MAXBINY 8
/*******************************************************************
* \brief BinCtrlObj constructor
*******************************************************************/
BinCtrlObj::BinCtrlObj(Camera& cam) :
m_cam(cam)
{
DEB_CONSTRUCTOR();
}
//-----------------------------------------------------
//
//-----------------------------------------------------
BinCtrlObj::~BinCtrlObj()
{
DEB_DESTRUCTOR();
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BinCtrlObj::setBin(const Bin& aBin)
{
DEB_MEMBER_FUNCT();
Bin myBin = aBin;
checkBin(myBin);
m_cam.setBinning(myBin);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BinCtrlObj::getBin(Bin &aBin)
{
DEB_MEMBER_FUNCT();
m_cam.getBinning(aBin);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BinCtrlObj::checkBin(Bin &aBin)
{
DEB_MEMBER_FUNCT();
m_cam.checkBin(aBin);
}
//###########################################################################
// 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/>.
//###########################################################################
#include "MarccdBufferCtrlObj.h"
#include "MarccdCamera.h"
using namespace lima;
using namespace lima::Marccd;
/*******************************************************************
* \brief BufferCtrlObj constructor
*******************************************************************/
BufferCtrlObj::BufferCtrlObj(Camera& cam)
: m_buffer_cb_mgr(m_buffer_alloc_mgr),
m_buffer_ctrl_mgr(m_buffer_cb_mgr),
m_cam(cam)
{
DEB_CONSTRUCTOR();
m_reader = new Reader(cam, *this);
m_reader->go(2000);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
BufferCtrlObj::~BufferCtrlObj()
{
DEB_DESTRUCTOR();
m_reader->reset();
m_reader->exit();
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::setFrameDim(const FrameDim& frame_dim)
{
DEB_MEMBER_FUNCT();
m_buffer_ctrl_mgr.setFrameDim(frame_dim);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::getFrameDim(FrameDim& frame_dim)
{
DEB_MEMBER_FUNCT();
m_buffer_ctrl_mgr.getFrameDim(frame_dim);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::setNbBuffers(int nb_buffers)
{
DEB_MEMBER_FUNCT();
m_buffer_ctrl_mgr.setNbBuffers(nb_buffers);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::getNbBuffers(int& nb_buffers)
{
DEB_MEMBER_FUNCT();
m_buffer_ctrl_mgr.getNbBuffers(nb_buffers);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::setNbConcatFrames(int nb_concat_frames)
{
DEB_MEMBER_FUNCT();
m_buffer_ctrl_mgr.setNbConcatFrames(nb_concat_frames);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::getNbConcatFrames(int& nb_concat_frames)
{
DEB_MEMBER_FUNCT();
m_buffer_ctrl_mgr.getNbConcatFrames(nb_concat_frames);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::getMaxNbBuffers(int& max_nb_buffers)
{
DEB_MEMBER_FUNCT();
m_buffer_ctrl_mgr.getMaxNbBuffers(max_nb_buffers);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void *BufferCtrlObj::getBufferPtr(int buffer_nb, int concat_frame_nb)
{
DEB_MEMBER_FUNCT();
return m_buffer_ctrl_mgr.getBufferPtr(buffer_nb, concat_frame_nb);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void *BufferCtrlObj::getFramePtr(int acq_frame_nb)
{
DEB_MEMBER_FUNCT();
return m_buffer_ctrl_mgr.getFramePtr(acq_frame_nb);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::getStartTimestamp(Timestamp& start_ts)
{
DEB_MEMBER_FUNCT();
m_buffer_ctrl_mgr.getStartTimestamp(start_ts);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::getFrameInfo(int acq_frame_nb, HwFrameInfoType& info)
{
DEB_MEMBER_FUNCT();
m_buffer_ctrl_mgr.getFrameInfo(acq_frame_nb, info);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::registerFrameCallback(HwFrameCallback& frame_cb)
{
DEB_MEMBER_FUNCT();
m_buffer_ctrl_mgr.registerFrameCallback(frame_cb);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::unregisterFrameCallback(HwFrameCallback& frame_cb)
{
DEB_MEMBER_FUNCT();
m_buffer_ctrl_mgr.unregisterFrameCallback(frame_cb);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::start()
{
DEB_MEMBER_FUNCT();
//- start thread which will _read the new image from file
m_reader->start();
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::reset()
{
DEB_MEMBER_FUNCT();
m_reader->reset();
}
//-----------------------------------------------------
//
//-----------------------------------------------------
int BufferCtrlObj::getLastAcquiredFrame()
{
return m_reader->getLastAcquiredFrame();
}
//-----------------------------------------------------
//
//-----------------------------------------------------
bool BufferCtrlObj::isTimeoutSignaled()
{
return m_reader->isTimeoutSignaled();
}
//-----------------------------------------------------
//
//-----------------------------------------------------
bool BufferCtrlObj::isRunning()
{
return m_reader->isRunning();
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::setTimeout(int TO)
{
DEB_MEMBER_FUNCT();
m_reader->setTimeout(TO);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void BufferCtrlObj::setWaitFileOnDiskTime(double value)
{
DEB_MEMBER_FUNCT();
m_reader->setWaitFileOnDiskTime(value);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
double BufferCtrlObj::getWaitFileOnDiskTime(void)
{
DEB_MEMBER_FUNCT();
return m_reader->getWaitFileOnDiskTime();
}
//-----------------------------------------------------
//
//-----------------------------------------------------
int* BufferCtrlObj::getHeader()
{
DEB_MEMBER_FUNCT();
return m_reader->getHeader();
}
This diff is collapsed.
//###########################################################################
// 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/>.
//###########################################################################
#include "MarccdDetInfoCtrlObj.h"
#include "MarccdCamera.h"
using namespace lima;
using namespace lima::Marccd;
/*******************************************************************
* \brief DetInfoCtrlObj constructor
*******************************************************************/
DetInfoCtrlObj::DetInfoCtrlObj(Camera& cam):
m_cam(cam)
{
DEB_CONSTRUCTOR();
}
//-----------------------------------------------------
//
//-----------------------------------------------------
DetInfoCtrlObj::~DetInfoCtrlObj()
{
DEB_DESTRUCTOR();
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void DetInfoCtrlObj::getMaxImageSize(Size& max_image_size)
{
DEB_MEMBER_FUNCT();
m_cam.getDetectorImageSize(max_image_size);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void DetInfoCtrlObj::getDetectorImageSize(Size& det_image_size)
{
DEB_MEMBER_FUNCT();
m_cam.getDetectorImageSize(det_image_size);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void DetInfoCtrlObj::getDefImageType(ImageType& def_image_type)
{
DEB_MEMBER_FUNCT();
m_cam.getImageType(def_image_type);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void DetInfoCtrlObj::getCurrImageType(ImageType& curr_image_type)
{
DEB_MEMBER_FUNCT();
m_cam.getImageType(curr_image_type);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void DetInfoCtrlObj::setCurrImageType(ImageType curr_image_type)
{
DEB_MEMBER_FUNCT();
ImageType valid_image_type;
getDefImageType(valid_image_type);
if (curr_image_type != valid_image_type)
THROW_HW_ERROR(Error) << "Cannot change to " << DEB_VAR2(curr_image_type, valid_image_type);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void DetInfoCtrlObj::getPixelSize(double& x_size,double& y_size)
{
DEB_MEMBER_FUNCT();
m_cam.getPixelSize(x_size, y_size);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void DetInfoCtrlObj::getDetectorType(std::string& det_type)
{
DEB_MEMBER_FUNCT();
m_cam.getDetectorType(det_type);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void DetInfoCtrlObj::getDetectorModel(std::string& det_model)
{
DEB_MEMBER_FUNCT();
m_cam.getDetectorModel(det_model);
}
This diff is collapsed.
//###########################################################################
// 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/>.