Commit 8f7effd5 authored by claustre's avatar claustre

OK first commit of the new camera plugin for Andor.

parent ba3bdda8
*~
*bck
*.swp
*target*
\ No newline at end of file
*target*
src-dirs = src
test-dirs =
include ../../global.inc
Andor
-------
.. image:: andor.png
Intoduction
```````````
Andor Technology manufactuer offers a large catalogue of scientific cameras. Covered scientific applications are low ligth imaging, spectroscopy, microscopy, time-resolved and high energy detection.
Andor is providing a unique Software Development Tool (SDK) for both Windows and Linux, supporting different interface buses such as USB, CameraLink and also some specific acquisition PCI board.
The Lima module as been tested only with this cameras models:
- IKon-M (USB interface, Linux OS)
Module configuration
````````````````````
Previously to this you have to install the Andor SDK the default path (/usrlocal)
Andor python module needs at least the lima core module.
The minimum configuration file is *config.inc* :
.. code-block:: sh
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_ANDOR=1
COMPILE_CBF_SAVING=0
export COMPILE_CORE COMPILE_SPS_IMAGE COMPILE_SIMULATOR \
COMPILE_ESPIA COMPILE_FRELON COMPILE_MAXIPIX COMPILE_PILATUS \
COMPILE_BASLER COMPILE_ANDOR COMPILE_CBF_SAVING
See :ref:`Compilation`
Installation
`````````````
- After installing andor modules :ref:`installation`
- And probably Tango server :ref:`tango_installation`
Configuration
``````````````
- blabla
- blabla
This diff is collapsed.
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2012
// 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 ANDORINTERFACE_H
#define ANDORINTERFACE_H
#include "HwInterface.h"
#include "AndorCamera.h"
namespace lima
{
namespace Andor
{
class Interface;
/*******************************************************************
* \class DetInfoCtrlObj
* \brief Control object providing Andor detector info interface
*******************************************************************/
class DetInfoCtrlObj : public HwDetInfoCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "DetInfoCtrlObj", "Andor");
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& pixel_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:
Camera& m_cam;
};
/*******************************************************************
* \class SyncCtrlObj
* \brief Control object providing Andor synchronization interface
*******************************************************************/
class SyncCtrlObj : public HwSyncCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "SyncCtrlObj", "Andor");
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);
virtual void getLatTime(double& lat_time);
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 Andor Roi interface
*******************************************************************/
class RoiCtrlObj : public HwRoiCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "RoiCtrlObj", "Andor");
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 Andor Bin interface
*******************************************************************/
class BinCtrlObj : public HwBinCtrlObj
{
public:
BinCtrlObj(Camera& cam);
virtual ~BinCtrlObj() {}
virtual void setBin(const Bin& bin);
virtual void getBin(Bin& bin);
//allow all binning
virtual void checkBin(Bin& bin);
private:
Camera& m_cam;
};
/*******************************************************************
* \class Interface
* \brief Andor hardware interface
*******************************************************************/
class Interface : public HwInterface
{
DEB_CLASS_NAMESPC(DebModCamera, "AndorInterface", "Andor");
public:
Interface(Camera& cam);
virtual ~Interface();
//- From HwInterface
virtual void getCapList(CapList&) const;
virtual void reset(ResetLevel reset_level);
virtual void prepareAcq();
virtual void startAcq();
virtual void stopAcq();
virtual void getStatus(StatusType& status);
virtual int getNbHwAcquiredFrames();
void getFrameRate(double& frame_rate);
void setTimeout(int TO);
private:
Camera& m_cam;
CapList m_cap_list;
DetInfoCtrlObj m_det_info;
SyncCtrlObj m_sync;
BinCtrlObj m_bin;
RoiCtrlObj m_roi;
mutable Cond m_cond;
};
} // namespace Andor
} // namespace lima
#endif // ANDORINTERFACE_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/>.
############################################################################
import os, sys, imp, glob, DLFCN
root_name = __path__[0]
mod_name = os.path.basename(root_name)
def version_code(s):
return map(int, s.strip('v').split('.'))
def version_cmp(x, y):
return cmp(version_code(x), version_code(y))
env_var_name = 'LIMA_%s_VERSION' % mod_name.upper()
try:
version = os.environ[env_var_name]
except KeyError:
version = 'LAST'
req_version = version
if version.upper() == 'LAST':
version_dirs = [x for x in os.listdir(root_name) if x.startswith('v')]
version_dirs.sort(version_cmp)
version = version_dirs[-1]
else:
if version[0] != 'v':
version = 'v' + version
mod_path = os.path.join(root_name, version)
if not (os.path.isdir(mod_path) or os.path.islink(mod_path)):
raise ImportError('Invalid %s: %s' % (env_var_name, req_version))
__path__.append(mod_path)
ld_open_flags = sys.getdlopenflags()
sys.setdlopenflags(ld_open_flags | DLFCN.RTLD_GLOBAL)
from Lima.Andor.limaandor import Andor as _A
globals().update(_A.__dict__)
sys.setdlopenflags(ld_open_flags)
del root_name, mod_name, mod_path, x, env_var_name
del version, req_version, version_dirs, version_code, version_cmp
del os, sys, imp, glob, DLFCN
namespace Andor
{
class Camera
{
%TypeHeaderCode
#include <AndorCamera.h>
%End
public:
enum Status {
Ready, Exposure, Readout, Latency,
};
Camera(const std::string& camera_ip,int mtu_size = -1);
~Camera();
void startAcq();
void stopAcq();
// -- detector info
void getImageType(ImageType& type /Out/);
void getDetectorType(std::string& type /Out/);
void getDetectorModel(std::string& model /Out/);
void getDetectorImageSize(Size& size /Out/);
HwBufferCtrlObj* getBufferMgr();
void setTrigMode(TrigMode mode);
void getTrigMode(TrigMode& mode /Out/);
void setExpTime(double exp_time);
void getExpTime(double& exp_time /Out/);
void setLatTime(double lat_time);
void getLatTime(double& lat_time /Out/);
void getExposureTimeRange(double& min_expo /Out/, double& max_expo /Out/) const;
void getLatTimeRange(double& min_lat /Out/, double& max_lat /Out/) const;
void setNbFrames(int nb_frames);
void getNbFrames(int& nb_frames /Out/);
void checkRoi(const Roi& set_roi, Roi& hw_roi /Out/);
void setRoi(const Roi& set_roi);
void getRoi(Roi& hw_roi /Out/);
void checkBin(Bin& /In,Out/);
void setBin(const Bin&);
void getBin(Bin& /Out/);
void getStatus(Andor::Camera::Status& status /Out/);
void getFrameRate(double& frame_rate /Out/);
void setTimeout(int TO);
};
};
namespace Andor
{
class Interface : HwInterface
{
%TypeHeaderCode
#include <AndorInterface.h>
%End
public:
Interface(Andor::Camera& cam);
virtual ~Interface();
//- From HwInterface
// virtual void getCapList(CapList& /Out/) const;
virtual void getCapList(std::vector<HwCap> &cap_list /Out/) const;
virtual void reset(ResetLevel reset_level);
virtual void prepareAcq();
virtual void startAcq();
virtual void stopAcq();
virtual void getStatus(StatusType& status /Out/);
virtual int getNbHwAcquiredFrames();
void getFrameRate(double& frame_rate /Out/);
void setTimeout(int);
};
};
*.o
*.P
*.d
This diff is collapsed.
This diff is collapsed.
andor-objs = AndorCamera.o AndorInterface.o
SRCS = $(andor-objs:.o=.cpp)
CXXFLAGS += -I../include -I../../../hardware/include -I../../../common/include \
-I/usr/local/include \
-Wall -pthread -fPIC -g
all: Andor.o
Andor.o: $(andor-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)
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