...
 
Commits (75)
......@@ -2,3 +2,4 @@
*bck
*.swp
*target*
build/
stages:
- build
- build-noarch
- deploy
.build-conda: &build-conda
stage: build
artifacts:
paths:
- dist/
tags:
- conda
build-linux:
<<: *build-conda
script:
- conda build ./conda/camera --prefix-length=80 --output-folder=dist/ --channel=http://bcu-ci.esrf.fr/stable
tags:
- linux
build-win:
<<: *build-conda
script:
- conda build ./conda/camera --prefix-length=80 --output-folder=dist/ --channel=http://bcu-ci.esrf.fr/stable
tags:
- win
build-noarch:
<<: *build-conda
stage: build-noarch
script:
- conda build ./conda/tango --prefix-length=80 --output-folder=dist/ -c tango-controls --channel=http://bcu-ci.esrf.fr/stable
dependencies:
- build-linux
- build-win
deploy-devel:
stage: deploy
environment:
name: devel/$CI_COMMIT_REF_NAME
url: http://bcu-ci.esrf.fr/devel
dependencies:
- build-linux
- build-win
- build-noarch
script:
- cp -Rf dist/* /conda-devel/
- conda index /conda-devel/
tags:
- conda
- linux
only:
- branches
except:
- master
when: manual
deploy-stable:
stage: deploy
environment:
name: production
url: http://bcu-ci.esrf.fr/stable
dependencies:
- build-linux
- build-win
- build-noarch
script:
- cp -Rf dist/* /conda/
- conda index /conda/
tags:
- conda
- linux
only:
- tags
###########################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2019
# 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/>.
############################################################################
cmake_minimum_required(VERSION 3.1)
project(andor)
# Include additional modules that are used inconditionnaly
include(GNUInstallDirs)
include(GenerateExportHeader)
# If conda build, always set lib dir to 'lib'
if($ENV{CONDA_BUILD})
set(CMAKE_INSTALL_LIBDIR "lib")
endif()
# Set lower / upper case project names
string(TOUPPER "${PROJECT_NAME}" PROJECT_NAME_UPPER)
string(TOLOWER "${PROJECT_NAME}" PROJECT_NAME_LOWER)
# Set targets export name (used by lima and dependencies)
set(TARGETS_EXPORT_NAME "${PROJECT_NAME_LOWER}-targets")
#set(namespace "${PROJECT_NAME}::")
# Check if project is being used directly or via add_subdirectory
set(CAMERA_MASTER_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(CAMERA_MASTER_PROJECT ON)
endif()
if (CAMERA_MASTER_PROJECT)
find_package(Lima REQUIRED COMPONENTS devel tools)
endif()
# CMake additional macros
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${LIMA_CMAKE_INCLUDE_DIRS} ${CMAKE_MODULE_PATH})
include(LimaTools)
# Set version
include(project_version)
# Enable python binding code compilation using sip generator
if (CAMERA_MASTER_PROJECT)
option(LIMA_ENABLE_PYTHON "compile python binding code?" OFF)
option(LIMA_ENABLE_PYTANGO_SERVER "install python tango server?" OFF)
if (LIMA_ENABLE_PYTHON)
limatools_find_python_and_sip()
endif()
endif()
find_package(Andor REQUIRED)
file(GLOB_RECURSE ANDOR_INCS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
# Library definition
add_library(andor SHARED
src/AndorCamera.cpp
src/AndorInterface.cpp
src/AndorDetInfoCtrlObj.cpp
src/AndorSyncCtrlObj.cpp
src/AndorBinCtrlObj.cpp
src/AndorShutterCtrlObj.cpp
src/AndorRoiCtrlObj.cpp
${ANDOR_INCS}
)
# Generate export macros
generate_export_header(andor)
# Set version and output name
set_target_properties(andor PROPERTIES
OUTPUT_NAME "lima${PROJECT_NAME_LOWER}"
VERSION "${PROJECT_VERSION}"
SOVERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}")
# Add dependencies
target_include_directories(andor
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>" # For export header
PUBLIC "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_link_libraries(andor PUBLIC limacore)
target_compile_definitions(andor PUBLIC ${ANDOR_DEFINITIONS})
target_include_directories(andor PUBLIC ${ANDOR_INCLUDE_DIRS})
target_link_libraries(andor PUBLIC ${ANDOR_LIBRARIES})
if(WIN32)
target_compile_definitions(andor
PRIVATE andor_EXPORTS
PUBLIC NOMINMAX)
set_target_properties(andor PROPERTIES PREFIX "lib" IMPORT_PREFIX "lib")
endif()
# Binding code for python
if(LIMA_ENABLE_PYTHON)
limatools_run_sip_for_camera(andor)
endif()
# Generate and install package config file and version
if(CAMERA_MASTER_PROJECT)
set (PROJECT_LIBRARIES andor)
set(SIP_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/sip/lima)
set(CMAKE_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/cmake/lima)
include(package_config)
endif()
## Installation
install(
TARGETS andor
EXPORT "${TARGETS_EXPORT_NAME}"
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} # import library
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} # .so files are libraries
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} # .dll files are binaries
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} # this does not actually install anything (but used by downstream projects)
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
COMPONENT devel
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/project_version.h
${PROJECT_BINARY_DIR}/andor_export.h
COMPONENT devel
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
if(LIMA_ENABLE_PYTHON)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/python/
DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Andor"
)
if (LIMA_ENABLE_PYTANGO_SERVER)
add_subdirectory(tango)
endif()
endif()
## Tests
if(CAMERA_ENABLE_TESTS)
enable_testing()
#add_subdirectory(test)
endif()
This diff is collapsed.
src-dirs = src
test-dirs =
include ../../global.inc
[![License](https://img.shields.io/github/license/esrf-bliss/lima.svg?style=flat)](https://opensource.org/licenses/GPL-3.0)
[![Gitter](https://img.shields.io/gitter/room/esrf-bliss/lima.svg?style=flat)](https://gitter.im/esrf-bliss/LImA)
[![Conda](https://img.shields.io/conda/dn/esrf-bcu/lima-camera-andor.svg?style=flat)](https://anaconda.org/esrf-bcu)
[![Version](https://img.shields.io/conda/vn/esrf-bcu/lima-camera-andor.svg?style=flat)](https://anaconda.org/esrf-bcu)
[![Platform](https://img.shields.io/conda/pn/esrf-bcu/lima-camera-andor.svg?style=flat)](https://anaconda.org/esrf-bcu)
# LImA Andor CCD Camera Plugin
This is the LImA plugin for Andor CCD cameras.
## Install
### Camera python
conda install -c esrf-bcu lima-camera-andor
### Camera tango device server
conda install -c tango-controls -c esrf-bcu lima-camera-andor-tango
# LImA
Lima ( **L** ibrary for **Im** age **A** cquisition) is a project for the unified control of 2D detectors. The aim is to clearly separate hardware specific code from common software configuration and features, like setting standard acquisition parameters (exposure time, external trigger), file saving and image processing.
Lima is a C++ library which can be used with many different cameras. The library also comes with a [Python](http://python.org) binding and provides a [PyTango](http://pytango.readthedocs.io/en/stable/) device server for remote control.
## Documentation
The documentation is available [here](https://lima.blissgarden.org)
set(ANDOR_INCLUDE_DIRS)
set(ANDOR_LIBRARIES)
set(ANDOR_DEFINITIONS)
if(WIN32)
# Missing find_path here
find_library(ANDOR_LIBRARIES atmcd64m)
find_path(ANDOR_INCLUDE_DIRS "atmcd32d.h")
else()
find_path(ANDOR_INCLUDE_DIRS "atmcdLXd.h")
find_library(ANDOR_LIBRARIES andor)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Andor DEFAULT_MSG
ANDOR_LIBRARIES
ANDOR_INCLUDE_DIRS
)
# Config file for @PROJECT_NAME_LOWER@
#
# It defines the following variables:
#
# @PROJECT_NAME_UPPER@_INCLUDE_DIRS - include directory
# @PROJECT_NAME_UPPER@_LIBRARIES - all dynamic libraries
# @PROJECT_NAME_UPPER@_STATIC_LIBRARIES - all static libraries
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(Lima)
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
check_required_components("@PROJECT_NAME@")
check_required_components(@PROJECT_NAME_LOWER@)
cmake -Bbuild -H. -G "%CMAKE_GENERATOR%" -DLIMA_ENABLE_PYTHON=1 -DCAMERA_ENABLE_TESTS=1 -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DPYTHON_SITE_PACKAGES_DIR=%SP_DIR% -DCMAKE_FIND_ROOT_PATH=%LIBRARY_PREFIX%
IF %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
cmake --build build --config Release --target install
IF %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
#!/bin/bash
cmake -Bbuild -H. -DLIMA_ENABLE_PYTHON=1 -DCAMERA_ENABLE_TESTS=1 -DCMAKE_INSTALL_PREFIX=$PREFIX -DPYTHON_SITE_PACKAGES_DIR=$SP_DIR -DCMAKE_FIND_ROOT_PATH=$PREFIX
cmake --build build --target install
blas_impl:
- mkl # [x86_64]
c_compiler:
- vs2017 # [win]
cxx_compiler:
- vs2017 # [win]
python:
- 2.7 # [linux]
- 3.6
- 3.7
# This differs from target_platform in that it determines what subdir the compiler
# will target, not what subdir the compiler package will be itself.
# For example, we need a win-64 vs2008_win-32 package, so that we compile win-32
# code on win-64 miniconda.
cross_compiler_target_platform:
- win-64 # [win]
target_platform:
- win-64 # [win]
vc:
- 14
zip_keys:
- # [win]
- vc # [win]
- c_compiler # [win]
- cxx_compiler # [win]
# Strip the 'v' from the version tag
{% if GIT_DESCRIBE_TAG is defined %}
{% set version = GIT_DESCRIBE_TAG[1:] %}
{% else %}
{% set version = "0.0.0" %}
{% endif %}
package:
name: lima-camera-andor
version: {{ version }}
source:
path: ../..
build:
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
requirements:
host:
- python {{ python }}
- numpy
- sip 4.19.8 # For compatibility with pyqt 5.9.2
- lima-core
- andor2-sdk >=2.102.30013 # [win]
- andor2-sdk >=2.103.30022 # [linux]
build:
- git
- cmake
- {{ compiler('cxx') }}
run:
- python {{ python }}
- sip >=4.19.4, <=4.19.8 # For compatibility with pyqt 5.9.2
- {{ pin_compatible('lima-core', max_pin='x.x') }}
- andor2-sdk >=2.102.30013 # [win]
- andor2-sdk >=2.103.30022 # [linux]
test:
requires:
- cmake
imports:
- Lima.Andor
commands:
- cmake --version
- ctest --version
- cpack --version
about:
home: https://github.com/esrf-bliss/Lima
license: GPL
license_file: COPYING
summary: a library for the unified control of 2D detectors
cd tango
cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DPYTHON_SITE_PACKAGES_DIR=%SP_DIR% -DCMAKE_FIND_ROOT_PATH=%LIBRARY_PREFIX%
IF %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
cmake --build build --config Release --target install
IF %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
#!/bin/bash
cd tango/
cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=$PREFIX -DPYTHON_SITE_PACKAGES_DIR=$SP_DIR -DCMAKE_FIND_ROOT_PATH=$PREFIX
cmake --build build --target install
# Strip the 'v' from the version tag
{% if GIT_DESCRIBE_TAG is defined %}
{% set version = GIT_DESCRIBE_TAG[1:] %}
{% else %}
{% set version = "0.0.0" %}
{% endif %}
package:
name: lima-camera-andor-tango
version: {{ version }}
source:
path: ../..
build:
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
noarch: python
requirements:
build:
- cmake
- git
- lima-core
run:
- lima-tango-server
- lima-camera-andor
about:
home: https://github.com/esrf-bliss/Lima
license: GPL
license_file: COPYING
summary: a library for the unified control of 2D detectors
Andor
-------
.. _camera-andor:
.. image:: ikon-m_934_header.jpg
Andor SDK2 camera plugin
------------------------
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.
.. image:: ikon-m_934_header.jpg
.. image:: ikon-L.jpg
Introduction
````````````
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)
The Lima module as been tested only with these camera models:
- IKon-M and IKon-L (USB interface, Linux OS debian 6)
- IKon-L (USB interface, Windows XP - 32bits)
Prerequisites
`````````````
Linux
.....
Module configuration
````````````````````
Previously to this you have to install the Andor SDK the default path (/usr/local).
For our test we us the SDK for Linux version **V2.91.30001.0** and ran the install script "install_andor"
for which option 5 (All USB Cameras) was selected, the default installation is made under /usr/local/ with:
First, you have to install the Andor Software developpement Kit (SDK) in the default path (/usr/local). For our tests, we used the SDK for Linux version **V2.91.30001.0** and ran the install script ``install_andor`` for which option 5 (All USB Cameras) was selected, the default installation is made under ``/usr/local/`` with:
- /usr/local/include, header files
- /usr/local/lib, library files
- /usr/local/etc/andor, configuration files
- ``/usr/local/include``, header files
- ``/usr/local/lib``, library files
- ``/usr/local/etc/andor``, configuration files
The Linux SSK 2.91 has shared libraries which has been compiled on recent linux kernel, check first you have the right kernel and
The Linux SDK 2.91 has shared libraries which has been compiled on recent linux kernel, check first you have the right kernel and
libc available by compiling one of the example program available under examples/console.
Andor python module needs at least the lima core module.
For the USB camera the SDK is using the libusb under linux, check first your system is equiped with the libusb package otherwise you
will not compile the Andor Lima plugin.
The minimum configuration file is *config.inc* :
Windows XP - 32 bits
....................
First, you have to install the Andor Software developpement Kit (SDK) in default path (``C:\\Program Files (x86)\\Andor iKon\\Drivers``).
Add the location of the file ``\\Lima\\camera\\andor\\sdk\\msvc\\bin\\ATMCD32D.DLL`` to your ``PATH`` environment variable.
Installation & Module configuration
```````````````````````````````````
Follow the generic instructions in :ref:`build_installation`. If using CMake directly, add the following flag:
.. 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
-DLIMACAMERA_ANDOR=true
For the Tango server installation, refers to :ref:`tango_installation`.
See :ref:`Compilation`
Initialisation and Capabilities
```````````````````````````````
Installation
`````````````
Implementing a new plugin for new detector is driven by the LIMA framework but the developer has some freedoms to choose which standard and specific features will be made available. This section is supposed to give you the correct information regarding how the camera is exported within the LIMA framework.
Camera initialisation
.....................
The camera will be initialized within the :cpp:class:`AndorCamera` object. The :cpp:func:`AndorCamera()` contructor sets the camera with default parameters for Preampifier-Gain, VerticalShiftSpeed and the ADC/HorizontalSpeed.
These parameters are optimized for the faster mode, which means the maximum gain, the "fasten recommended" VSSpeed (i.e as returned
by GetFastestRecommendedVSSpeed() SDK function call) and the ADC with the faster Horizontal speed.
All the parameters can be set and get using the corresponding methods, the default values (max speeds and gain)
can be applied with -1 as passed value:
set/getPGain()
set/getVsSpeed()
set/getADCSpeed()
Some other methods are available but they can not be supported depending on which camera model you are using:
set/getHighCapacity()
set/getFanMode()
set/getBaselineClamp()
The above parameters, only support enumerate type for values.
Std capabilities
................
This plugin has been implemented in respect of the mandatory capabilites but with some limitations which
are due to the camera and SDK features. We only provide here extra information for a better understanding
of the capabilities for Andor cameras.
* HwDetInfo
getCurrImageType/getDefImageType(): the methods call the SDK GetBitDepth() function to resolve the image
data type. The bit-depth correspond to the AD channel dynamic range which depends on the selected ADC channel.
By experience and with IKon detectors we only have Bpp16 of dynamic range, but the methods can return Bpp8 and Bpp32
as well.
setCurrImageType(): this method do not change the image type which is fixed to 16bpp.
- After installing andor modules :ref:`installation`
* HwSync
- And probably Tango server :ref:`tango_installation`
get/setTrigMode(): the only supported mode are IntTrig, ExtTrigSingle, ExtGate and IntTrigMult
Optional capabilities
.....................
In addition to the standard capabilities, we make the choice to implement some optional capabilities which
are supported by the SDK and the I-Kon cameras. A Shutter control, a hardware ROI and a hardware Binning are available.
* HwShutter
setMode(): only ShutterAuto and ShutterManual modes are supported
* HwRoi
There is no restriction for the ROI setting
* HwBin
There is no restriction for the Binning but the maximum binning is given by the SDK function GetMaximumBinning() which depends
on the camera model
Configuration
`````````````
- Plug your USB camera on any USB port of the computer, that's all !!!
Plug your USB camera on any USB port of the computer, that's all !
How to use
````````````
This is a python code example for a simple test:
.. code-block:: python
from Lima import Andor
from lima import Core
cam = Andor.Camera("/usr/local/etc/andor", 0)
hwint = Andor.Interface(cam)
ct = Core.CtControl(hwint)
acq = ct.acquisition()
# configure some hw parameters
hwint.setTemperatureSP(-30)
hwint.setCooler(True)
.... wait here for cooling
# set some low level configuration
hwint.setPGain(2)
hwint.setCooler(True)
hwint.setFanMode(cam.FAN_ON_FULL)
hwint.setHighCapacity(cam.HIGH_SENSITIVITY)
hwint.setBaselineClamp(cam.BLCLAMP_ENABLED)
hwint.setFastExtTrigger(False)
hwint.setShutterLevel(1)
# setting new file parameters and autosaving mode
saving=ct.saving()
pars=saving.getParameters()
pars.directory='/buffer/lcb18012/opisg/test_lima'
pars.prefix='test1_'
pars.suffix='.edf'
pars.fileFormat=Core.CtSaving.EDF
pars.savingMode=Core.CtSaving.AutoFrame
saving.setParameters(pars)
# set accumulation mode
acq_pars= acq.getPars()
#0-normal,1-concatenation,2-accumu
acq_pars.acqMode = 2
acq_pars.accMaxExpoTime = 0.05
acq_pars.acqExpoTime =1
acq_pars.acqNbFrames = 1
acq.setPars(acq_pars)
# here we should have 21 accumalated images per frame
print acq.getAccNbFrames()
# now ask for 2 sec. exposure and 10 frames
acq.setAcqExpoTime(2)
acq.setNbImages(10)
ct.prepareAcq()
ct.startAcq()
# wait for last image (#9) ready
lastimg = ct.getStatus().ImageCounters.LastImageReady
while lastimg !=9:
time.sleep(1)
lastimg = ct.getStatus().ImageCounters.LastImageReady
# read the first image
im0 = ct.ReadImage(0)
Andor Tango device
=====================
This is the reference documentation of the Andor Tango device.
you can also find some useful information about prerequisite/installation/configuration/compilation in the :ref:`Andor camera plugin <camera-andor>` section.
Properties
----------
================= =============== =============== =========================================================================
Property name Mandatory Default value Description
================= =============== =============== =========================================================================
adc_speed No max. The adc/Horiz. speed pair
baseline_clamp No Off Clamping for baseline threshold, ON or OFF
camera_number No N/A The camera number, default is 0
cooler No Off Start/stop the cooling system of the camera mode
config_path No N/A The configuration path, for linux default is /usr/local/etc/andor
fast_ext_trigger No Off Fast external trigger mode, see Andor documentation for usage
fan_mode No N/A FAN mode, FAN_ON_FULL/FAN_ON_LOW/FAN_OFF
high_capacity No High_capacity Camera can run in two modes, HIGH_CAPACITY or HIGH_SENSITIVITY
p_gain No max. The preamplifier gain [X1-Xn] (see detector spec.)
shutter_level No High The shutter output level mode
temperature_sp No N/A The temperature setpoint in Celsius
vs_speed No fasten The vertical shift speed (see detector spec.)
================= =============== =============== =========================================================================
Attributes
----------
======================= ======= ======================= ======================================================================
Attribute name RW Type Description
======================= ======= ======================= ======================================================================
adc_speed rw DevString The ADC and Horizontal shift speed, in ADCchannel/Freq.Mhz, check
the documentatio for more help **(\*)**
baseline_clamp rw DevString The baseline clamping for threshold: **(\*\*)**
- **ON**
- **OFF**
cooler rw DevString Start/stop the cooling system of the camera mode:
- **ON**, the cooler is started
- **OFF**, the cooler is stopped
cooling_status ro DevString The status of the cooling system, tell if the setpoint
temperature is reached
fan_mode rw DevString The FAN mode for extra-cooling: **(\*\*)**
- **FAN_OFF**
- **FAN_ON_FULL**
- **FAN_ON_LOW**
fast_ext_trigger rw DevString Fast external trigger mode, see Andor documentation for usage Mode are:
- **ON**, fast mode, the camera will not wait until the a keep clean cycle has been completed before accepting the next
trigger
- **OFF**, slow mode
high_capacity rw DevString Off/On the High Capacity mode: **(\*\*)**
- **HIGH_CAPACITY**
- **HIGH_SENSITIVITY**
p_gain rw DevString The preamplifier gain from X1 to Xn (see detector spec.) **(\*)**
shutter_level rw DevString The shutter output level mode:
- **LOW"**, output TTL low signal to open shutter
- **HIGH**, output TTL high signal to open shutter
temperature ro DevShort The current sensor temperature in Celsius
temperature_sp rw DevShort The temperature setpoint in Celsius
timing ro Spectrum The exposure and latency times
vs_speed rw DevString The vertical shift speed, in us/pixel **(\*)**
======================= ======= ======================= ======================================================================
**(\*)** Use the command getAttrStringValueList to get the list of the supported value for these attributes.
**(\*\*)** These attributes can not be supported by some camera models and the return value will be set to **UNSUPPORTED**.
Commands
--------
======================= =============== ======================= ===========================================
Command name Arg. in Arg. out Description
======================= =============== ======================= ===========================================
Init DevVoid DevVoid Do not use
State DevVoid DevLong Return the device state
Status DevVoid DevString Return the device state as a string
getAttrStringValueList DevString: DevVarStringArray: Return the authorized string value list for
Attribute name String value list a given attribute name
======================= =============== ======================= ===========================================
......@@ -22,7 +22,9 @@
#ifndef ANDORBINCTRLOBJ_H
#define ANDORBINCTRLOBJ_H
#include "HwInterface.h"
#include <andor_export.h>
#include "lima/HwBinCtrlObj.h"
#include "AndorCamera.h"
namespace lima
......@@ -34,7 +36,7 @@ namespace lima
* \class BinCtrlObj
* \brief Control object providing Andor Bin interface
*******************************************************************/
class BinCtrlObj : public HwBinCtrlObj
class ANDOR_EXPORT BinCtrlObj : public HwBinCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "BinCtrlObj", "Andor");
public:
......
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2012
// Copyright (C) : 2009-2016
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
......@@ -27,72 +27,61 @@
# define GENAPI_DECL_ABSTRACT __attribute__((visibility("default")))
#endif
#include <atmcdLXd.h>
#ifndef DRV_P11INVALID
#include <andor_export.h>
#if defined(WIN32)
#define DRV_P11INVALID 20087
#define DRV_GATESTEPERROR 20092
#define DRV_INVALID_COUNTCONVERT_MODE 20101
#define DRV_OA_NULL_ERROR 20173
#define DRV_OA_PARSE_DTD_ERROR 20174
#define DRV_OA_DTD_VALIDATE_ERROR 20175
#define DRV_OA_FILE_ACCESS_ERROR 20176
#define DRV_OA_FILE_DOES_NOT_EXIST 20177
#define DRV_OA_XML_INVALID_OR_NOT_FOUND_ERROR 20178
#define DRV_OA_PRESET_FILE_NOT_LOADED 20179
#define DRV_OA_USER_FILE_NOT_LOADED 20180
#define DRV_OA_PRESET_AND_USER_FILE_NOT_LOADED 20181
#define DRV_OA_INVALID_FILE 20182
#define DRV_OA_FILE_HAS_BEEN_MODIFIED 20183
#define DRV_OA_BUFFER_FULL 20184
#define DRV_OA_INVALID_STRING_LENGTH 20185
#define DRV_OA_INVALID_CHARS_IN_NAME 20186
#define DRV_OA_INVALID_NAMING 20187
#define DRV_OA_GET_CAMERA_ERROR 20188
#define DRV_OA_MODE_ALREADY_EXISTS 20189
#define DRV_OA_STRINGS_NOT_EQUAL 20190
#define DRV_OA_NO_USER_DATA 20191
#define DRV_OA_VALUE_NOT_SUPPORTED 20192
#define DRV_OA_MODE_DOES_NOT_EXIST 20193
#define DRV_OA_CAMERA_NOT_SUPPORTED 20194
#define DRV_OA_FAILED_TO_GET_MODE 20195
#include <ATMCD32D.H>
#include <sys/timeb.h>
#include <time.h>
#else
#include <atmcdLXd.h>
#endif
#ifndef DRV_P11INVALID
#define DRV_P11INVALID 20087
#define DRV_GATESTEPERROR 20092
#define DRV_INVALID_COUNTCONVERT_MODE 20101
#define DRV_OA_NULL_ERROR 20173
#define DRV_OA_PARSE_DTD_ERROR 20174
#define DRV_OA_DTD_VALIDATE_ERROR 20175
#define DRV_OA_FILE_ACCESS_ERROR 20176
#define DRV_OA_FILE_DOES_NOT_EXIST 20177
#define DRV_OA_XML_INVALID_OR_NOT_FOUND_ERROR 20178
#define DRV_OA_PRESET_FILE_NOT_LOADED 20179
#define DRV_OA_USER_FILE_NOT_LOADED 20180
#define DRV_OA_PRESET_AND_USER_FILE_NOT_LOADED 20181
#define DRV_OA_INVALID_FILE 20182
#define DRV_OA_FILE_HAS_BEEN_MODIFIED 20183
#define DRV_OA_BUFFER_FULL 20184
#define DRV_OA_INVALID_STRING_LENGTH 20185
#define DRV_OA_INVALID_CHARS_IN_NAME 20186
#define DRV_OA_INVALID_NAMING 20187
#define DRV_OA_GET_CAMERA_ERROR 20188
#define DRV_OA_MODE_ALREADY_EXISTS 20189
#define DRV_OA_STRINGS_NOT_EQUAL 20190
#define DRV_OA_NO_USER_DATA 20191
#define DRV_OA_VALUE_NOT_SUPPORTED 20192
#define DRV_OA_MODE_DOES_NOT_EXIST 20193
#define DRV_OA_CAMERA_NOT_SUPPORTED 20194
#define DRV_OA_FAILED_TO_GET_MODE 20195
#endif
#include <stdlib.h>
#include <limits>
#include "HwMaxImageSizeCallback.h"
#include "HwBufferMgr.h"
#include "lima/HwMaxImageSizeCallback.h"
#include "lima/HwBufferMgr.h"
#include <ostream>
using namespace std;
#include <string>
namespace lima
{
namespace Andor
{
/*******************************************************************
* \class Camera
* \brief object controlling the andor camera via Pylon driver
*******************************************************************/
class Camera
{
DEB_CLASS_NAMESPC(DebModCamera, "Camera", "Andor");
friend class Interface;
public:
enum Status {
Ready, Exposure, Readout, Latency, Fault
};
enum ShutterMode {
FRAME,
MANUAL
};
enum SpoolingMethod
{
SM_SEQ_INT32 = 0,
......@@ -108,6 +97,7 @@ namespace lima
enum HighCapacityMode
{
HC_UNSUPPORTED = -1,
HIGH_SENSITIVITY = 0,
HIGH_CAPACITY
};
......@@ -130,10 +120,45 @@ namespace lima
SINGLE_TRACK,
IMAGE
};
enum FanMode
{
FAN_UNSUPPORTED = -1,
FAN_ON_FULL = 0,
FAN_ON_LOW,
FAN_OFF,
};
enum BaselineClamp
{
BLCLAMP_UNSUPPORTED = -1,
BLCLAMP_DISABLED = 0,
BLCLAMP_ENABLED = 1
};
/*******************************************************************
* \class Camera
* \brief object controlling the andor camera via Pylon driver
*******************************************************************/
class ANDOR_EXPORT Camera
{
DEB_CLASS_NAMESPC(DebModCamera, "Camera", "Andor");
friend class Interface;
public:
enum Status {
Ready, Exposure, Readout, Latency, Fault
};
enum ShutterMode {
FRAME,
MANUAL
};
Camera(const std::string& config_path,int camera_number=0);
~Camera();
void prepareAcq();
void startAcq();
void stopAcq();
......@@ -191,16 +216,24 @@ namespace lima
void reset();
// -- andor specific, LIMA don't worry about it !
void _mapAndorError();
bool andorError(unsigned int code);
// -- andor specific
void initialiseController();
void initAdcSpeed();
void setAdcSpeed(int adc);
void initVSS();
void setVSS(int vss);
void setAdcSpeed(int index);
void getAdcSpeed(int& index);
void getAdcSpeedInMhz(float& speed);
void getAdcSpeedMaxIndex(int &max_index);
void getAdcSpeedPaireString(int index, std::string& paire);
void initVsSpeed();
void setVsSpeed(int vss);
void getVsSpeed(int& vss);
void getVsSpeedMaxIndex(int& max_index);
void getVsSpeedString(int index, std::string& speed);
void initPGain();
void setPGain(int gain);
void getPGain(int& gain);
void getPGainMaxIndex(int& max_index);
void getPGainString(int index, std::string& pgain);
void setFastExtTrigger(bool flag);
void getFastExtTrigger(bool& flag);
void setShutterLevel(int level);
......@@ -213,11 +246,14 @@ namespace lima
void getCoolingStatus(std::string& status);
void setSpooling(bool flag, SpoolingMethod method, std::string path, int frameBufferSize);
void setHighCapacity(HighCapacityMode mode);
void getHighCapacity(HighCapacityMode& mode);
void setFanMode(FanMode mode);
void getFanMode(FanMode& mode);
void setGateMode(GateMode mode);
void setReadMode(ReadMode mode);
//void setReadMode(ReadMode mode);
void setBaselineClamp(BaselineClamp mode);
void getBaselineClamp(BaselineClamp& mode);
private:
class _AcqThread;
friend class _AcqThread;
......@@ -247,16 +283,18 @@ namespace lima
bool m_shutter_state;
//- camera stuff
string m_detector_model;
string m_detector_type;
std::string m_detector_model;
std::string m_detector_type;
int m_detector_serial;
FanMode m_fan_mode;
HighCapacityMode m_high_capacity;
BaselineClamp m_baseline_clamp;
//- andor SDK stuff
string m_config_path;
std::string m_config_path;
int m_camera_number;
at_32 m_camera_handle;
AndorCapabilities m_camera_capabilities;
string m_camera_error_str;
int m_camera_error;
struct Adc
{
......@@ -267,8 +305,8 @@ namespace lima
Adc* m_adc_speeds;
int m_adc_speed_number;
int m_adc_speed_max;
int m_adc;
int m_adc_speed_max_index;
int m_adc_speed_index;
int m_vss_number;
float* m_vsspeeds;
int m_vss_best;
......@@ -285,13 +323,18 @@ namespace lima
bool m_cooler;
int m_read_mode;
int m_acq_mode;
map<TrigMode, int> m_trig_mode_maps;
std::map<TrigMode, int> m_trig_mode_maps;
float m_exp_time;
float m_exp_time_max;
float m_kin_time;
#if defined(WIN32)
long m_ring_buffer_size;
#else
int m_ring_buffer_size;
map<int, string> m_andor_type_maps;
map<int, string> m_andor_error_maps;
#endif
std::map<int, std::string> m_andor_type_maps;
std::map<int, std::string> m_adcspeed_maps;
std::map<int, std::string> m_vsspeed_maps;
};
} // namespace Andor
} // namespace lima
......
......@@ -22,7 +22,9 @@
#ifndef ANDORDETINFOCTRLOBJ_H
#define ANDORDETINFOCTRLOBJ_H
#include "HwInterface.h"
#include <andor_export.h>
#include "lima/HwDetInfoCtrlObj.h"
#include "AndorCamera.h"
namespace lima
......@@ -35,7 +37,7 @@ namespace lima
* \brief Control object providing Andor detector info interface
*******************************************************************/
class DetInfoCtrlObj : public HwDetInfoCtrlObj
class ANDOR_EXPORT DetInfoCtrlObj : public HwDetInfoCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "DetInfoCtrlObj", "Andor");
......
//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2012
// Copyright (C) : 2009-2016
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
......@@ -22,7 +22,9 @@
#ifndef ANDORINTERFACE_H
#define ANDORINTERFACE_H
#include "HwInterface.h"
#include <andor_export.h>
#include "lima/HwInterface.h"
#include "AndorCamera.h"
#include "AndorDetInfoCtrlObj.h"
#include "AndorSyncCtrlObj.h"
......@@ -30,19 +32,19 @@
#include "AndorBinCtrlObj.h"
#include "AndorRoiCtrlObj.h"
namespace lima
{
namespace Andor
{
class Interface;
/*******************************************************************
* \class Interface
* \brief Andor hardware interface
*******************************************************************/
class Interface : public HwInterface
class ANDOR_EXPORT Interface : public HwInterface
{
DEB_CLASS_NAMESPC(DebModCamera, "AndorInterface", "Andor");
......@@ -59,6 +61,40 @@ namespace lima
virtual void getStatus(StatusType& status);
virtual int getNbHwAcquiredFrames();
// - From AndorCamera
void setAdcSpeed(int index);
void getAdcSpeed(int& index);
void getAdcSpeedMaxIndex(int& max_index){m_cam.getAdcSpeedMaxIndex(max_index);};
void getAdcSpeedPaireString(int index, std::string& pgain){m_cam.getAdcSpeedPaireString(index, pgain);};
void setVsSpeed(int index);
void getVsSpeed(int& index);
void getVsSpeedMaxIndex(int& max_index){m_cam.getVsSpeedMaxIndex(max_index);};
void getVsSpeedString(int index, std::string& speed){m_cam.getVsSpeedString(index, speed);};
void setPGain(int index);
void getPGain(int& index);
void getPGainMaxIndex(int& max_index) {m_cam.getPGainMaxIndex(max_index);};
void getPGainString(int index, std::string& pgain){m_cam.getPGainString(index, pgain);};
void setFastExtTrigger(bool flag);
void getFastExtTrigger(bool& flag);
void setShutterLevel(int level);
void getShutterLevel(int& level);
void setTemperatureSP(int temp);
void getTemperatureSP(int& temp);
void getTemperature(int& temp);
void setCooler(bool flag);
void getCooler(bool& flag);
void getCoolingStatus(std::string& status);
void setSpooling(bool flag, SpoolingMethod method, std::string path, int frameBufferSize);
void setHighCapacity(HighCapacityMode mode);
void getHighCapacity(HighCapacityMode& mode);
void setFanMode(FanMode mode);
void getFanMode(FanMode& mode);
void setGateMode(GateMode mode);
//! get the camera object to access it directly from client
Camera& getCamera() { return m_cam;}
void setBaselineClamp(BaselineClamp mode);
void getBaselineClamp(BaselineClamp& mode);
private:
Camera& m_cam;
CapList m_cap_list;
......
......@@ -22,7 +22,9 @@
#ifndef ANDORROICTRLOBJ_H
#define ANDORROICTRLOBJ_H
#include "HwInterface.h"
#include <andor_export.h>
#include "lima/HwRoiCtrlObj.h"
#include "AndorCamera.h"
namespace lima
......@@ -36,7 +38,7 @@ namespace lima
* \brief Control object providing Andor Roi interface
*******************************************************************/
class RoiCtrlObj : public HwRoiCtrlObj
class ANDOR_EXPORT RoiCtrlObj : public HwRoiCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "RoiCtrlObj", "Andor");
......
......@@ -22,7 +22,9 @@
#ifndef ANDORSHUTTERCTRLOBJ_H
#define ANDORSHUTTERCTRLOBJ_H
#include "HwInterface.h"
#include <andor_export.h>
#include "lima/HwShutterCtrlObj.h"
#include "AndorCamera.h"
namespace lima
......@@ -35,7 +37,7 @@ namespace lima
* \brief Control object providing Andor shutter interface
*******************************************************************/
class ShutterCtrlObj : public HwShutterCtrlObj
class ANDOR_EXPORT ShutterCtrlObj : public HwShutterCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "ShutterCtrlObj", "Andor");
......
......@@ -22,7 +22,9 @@
#ifndef ANDORSYNCCTRLOBJ_H
#define ANDORSYNCCTRLOBJ_H
#include "HwInterface.h"
#include <andor_export.h>
#include "lima/HwInterface.h"
#include "AndorCamera.h"
namespace lima
......@@ -36,7 +38,7 @@ namespace lima
* \brief Control object providing Andor synchronization interface
*******************************************************************/
class SyncCtrlObj : public HwSyncCtrlObj
class ANDOR_EXPORT SyncCtrlObj : public HwSyncCtrlObj
{
DEB_CLASS_NAMESPC(DebModCamera, "SyncCtrlObj", "Andor");
......
<?xml version="1.0" encoding="UTF-8"?>
<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</groupId>
<artifactId>super-pom-C-CPP</artifactId>
<version>RELEASE</version>
</parent>
<groupId>fr.soleil.lib.Lima.Camera</groupId>
<artifactId>LimaAndor-${aol}-shared-${mode}</artifactId>
<version>1.3.6</version>
<packaging>nar</packaging>
<name>LimaAndor</name>
<description>This module controls the Xpad Detector</description>
<scm>
<connection>scm:git:git://github.com/soleil-ica/Lima-camera-andor.git</connection>
<developerConnection>scm:git:git://github.com/soleil-ica/Lima-camera-andor.git</developerConnection>
<url>https://github.com/soleil-ica/Lima-camera-andor</url>
</scm>
<dependencies>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>LimaCore-${aol}-shared-${mode}</artifactId>
<version>1.3.5</version>
</dependency>
<dependency>
<groupId>com.andor</groupId>
<artifactId>ATMCD-${aol}-shared-${mode}</artifactId>
<version>2.83.3</version>
</dependency>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>NexusCPP-${aol}-static-${mode}</artifactId>
<version>3.0.7-vc9</version>
</dependency>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>YAT-${aol}-static-${mode}</artifactId>
<version>1.10.1-vc9</version>
</dependency>
<dependency>
<groupId>ncsa.uiuc.edu</groupId>
<artifactId>HDF5-${aol}-shared-release</artifactId>
<version>1.8.13-vc9</version>
</dependency>
</dependencies>
<build>
<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>
<defines>
<define>LIBANDOR_EXPORTS</define>
<define>WIN32</define>
<define>NDEBUG</define>
<define>_WINDOWS</define>
<define>_USRDLL</define>
<define>_WIN32_WINNT=0x0502</define> <!-- For Windows XP Support -->
</defines>
</cpp>
<libraries>
<library>
<type>shared</type>
</library>
</libraries>
</configuration>
</plugin>
</plugins>
</build>
<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>
......@@ -19,22 +19,6 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
from Lima import module_helper
mod_path = __path__
depends_on = 'Core'
has_dependent = False
cleanup_data = module_helper.load_prepare(mod_path, depends_on, has_dependent)
from Lima import Core
cleanup_data = module_helper.load_dep_cleanup(cleanup_data)
from Lima.Andor.limaandor import Andor as _A
from limaandor import Andor as _A
globals().update(_A.__dict__)
module_helper.load_cleanup(cleanup_data)
del mod_path, depends_on, has_dependent, cleanup_data
del module_helper
This diff is collapsed.
namespace Andor
{
class Camera
{
%TypeHeaderCode
#include <AndorCamera.h>
%End
public: